> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.houseofapps.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.houseofapps.ai/_mcp/server.

# Create prospect

POST https://api-dev.houseofapps.ai/v1/integrations/prospects
Content-Type: application/json

Same body as `POST /v1/prospects`. On `/v1` the prospect is unowned unless `owner_id` is sent; on `/v2` it defaults to the `userToken` member.

Reference: https://docs.houseofapps.ai/api-reference/overview/crm/prospects/external-create-prospect-v-1-integrations-prospects-post

## Request

### Headers

- `licenseKey` (string, required)
- `appSecret` (string, required)

### Body (application/json)

This endpoint expects a CreateProspectRequest.

- `contact_id` (string, optional, nullable)
- `contact` (CreateContactRequestStandalone, optional, nullable) — Full contact create payload (same as standalone contact create; no nested lead). Used when creating the contact with the prospect.
- `name` (string, optional, nullable) — Defaults to the linked contact's display name when omitted
- `owner_id` (string, optional, nullable) — Defaults to the caller when omitted
- `status_id` (string, optional, nullable) — Defaults to the organization's first status
- `type` (string, optional, nullable)
- `source` (string, optional, nullable)
- `tags` (list of string, optional)
- `lead_score` (integer, optional, nullable)
- `description` (string, optional, nullable)
- `notes` (list of NoteItemInput, optional)
- `product_interests` (list of ProductInterestInput, optional) — Optional catalog paths to attach as prospect-owned product interests (same shape as POST /product-interests). Persisted in the create call.

## Response

### 201

Created

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable success message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `data` (SuccessResponseData, optional, nullable) — Payload for this endpoint

## Errors

### 401 Unauthorized Error

Unauthorized

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 403 Forbidden Error

Forbidden

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 404 Not Found Error

Not Found

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 422 Unprocessable Entity Error

Unprocessable Entity

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

### 429 Too Many Requests Error

Too Many Requests

- `status` (string, required) — Response status
- `message` (string, required) — Human-readable error message
- `statusCode` (integer, required) — HTTP status code
- `code` (string, required) — Custom application status code
- `messageKey` (string, optional) — i18n key for the message
- `errors` (list of map from string to any, optional) — Optional field-level validation errors

## Types

### CreateContactRequestStandalone

Create a contact without allowing nested lead creation. This is used by endpoints that already own lead creation (e.g. external lead create), and want to optionally create a contact but forbid sending a `lead` block inside the contact payload.

- `email` (string, required) — Contact email address (required).
- `owner_id` (string, optional, nullable) — Owning user; defaults to the caller on internal create when omitted.
- `portal_access` (boolean, optional, default: false) — If true, provisions a portal user for this contact and sends an invite email.
- `prefix` (string, optional, nullable)
- `first_name` (string, optional, nullable)
- `middle_name` (string, optional, nullable)
- `last_name` (string, optional, nullable)
- `title` (string, optional, nullable)
- `date_of_birth` (date, optional, nullable)
- `profile_photo_url` (string, optional, nullable)
- `external_contact_id` (string, optional, nullable) — Optional identifier from an external system (immutable after create).
- `phones` (list of PhoneInput, optional)
- `tags` (list of string, optional)
- `social_pages` (list of SocialPage, optional)
- `websites` (list of Website, optional) — Websites for the contact (stored in additional_data.websites).
- `custom_fields` (list of map from string to any, optional) — Custom fields root cells payload (validated and stored as JSONB).
- `additional_data` (map from string to any, optional) — Free-form JSONB payload stored on the contact.
- `notes` (list of NoteItemInput, optional) — Structured notes
- `company_association` (ContactCompaniesCreate, optional, nullable) — Company association payload used during contact create. Mirrors the update naming, but allows only a single operation: - add an existing company membership (optional primary) - OR create exactly one new company and associate it (optional primary)
- `addresses` (list of AddressInput, optional)

### NoteItemInput

Client input for a structured note (title and content only).

- `title` (string, required)
- `content` (string, required)

### ProductInterestInput

One catalog selection as a typed ID path from root to the selected node. The last node is the interest. Parent nodes are context only (not separate interests). Same leaf under different paths are distinct selections.

- `path` (list of PathNode, required)
- `market_roles` (list of enum, optional, nullable) — Buyer and/or seller for this product/variant. Required for product interests; not allowed for brand or category. Send both values when the contact/company is a buyer and a seller of the same item.
  - Allowed values: `buyer`, `seller`

### SuccessResponseData

Payload for this endpoint

- map from string to any
- list of any
- string
- double
- boolean

### PhoneInput

Phone input for add operation (no id).

- `phone_number` (string, required) — Phone number
- `phone_isd_code` (string, required) — Phone ISD code
- `label` (string, optional, nullable) — Label (e.g. mobile, work)
- `is_primary` (boolean, optional, default: false) — Primary phone flag

### SocialPage

Social media page schema: platform (e.g. linkedin, instagram, twitter) and URL.

- `platform` (string, required) — Platform name
- `url` (string, required) — Profile/page URL
- `id` (string, optional, nullable) — Social page ID

### Website

Website schema.

- `url` (string, required) — Website URL
- `type` (string, required) — Website type
- `id` (string, optional, nullable) — Website ID
- `is_primary` (boolean, optional, default: false) — Primary website flag

### ContactCompaniesCreate

Company association payload used during contact create. Mirrors the update naming, but allows only a single operation: - add an existing company membership (optional primary) - OR create exactly one new company and associate it (optional primary)

- `add_association` (ContactCompanyAssociationAdd, optional, nullable) — Associate the contact with an existing company (single).
- `create_and_associate` (ContactCompanyAssociationCreateInline, optional, nullable) — Create exactly one new company and associate it to the contact (single).

### AddressInput

Address input for add operation.

- `place_id` (string, optional, nullable)
- `address_line1` (string, optional, nullable) — Primary address line
- `address_line2` (string, optional, nullable)
- `city` (string, optional, nullable)
- `state` (string, optional, nullable)
- `postal_code` (string, optional, nullable)
- `country` (string, optional, nullable)
- `latitude` (double, optional, nullable)
- `longitude` (double, optional, nullable)
- `address_type` (enum, optional, nullable) — Address type enumeration.
  - Allowed values: `work`, `home`, `billing`, `shipping`, `other`
- `address_data` (map from string to any, optional) — Extra address metadata (e.g. formatted line). Defaults to when omitted.
- `is_primary` (boolean, optional, default: false) — Primary address flag

### PathNode

One typed catalog ID in a selection path (request input).

- `entity_type` (enum, required)
  - Allowed values: `category`, `subcategory`, `brand`, `product`, `variant`
- `entity_id` (string, required)

### ContactCompanyAssociationAdd

Add an existing company membership for a contact.

- `company_id` (string, required) — Existing company id to link
- `is_primary` (boolean, optional, default: false) — If true, set this contact as the company's primary contact.

### ContactCompanyAssociationCreateInline

Create a new company inline and link it during contact create.

- `company` (CreateCompanyRequest, required) — New company payload (same shape as POST /companies).
- `is_primary` (boolean, optional, default: false) — If true, set this contact as the company's primary contact.

### CreateCompanyRequest

Create a company. Supports ADR operations: - company only - company + link existing contact (primary/non-primary) - company + create new contact + link (primary/non-primary)

- `name` (string, required)
- `owner_id` (string, optional, nullable) — Owning user; defaults to the caller on internal create when omitted.
- `industry` (string, optional, nullable)
- `profile_photo_url` (string, optional, nullable)
- `portal_access` (boolean, optional, default: false)
- `email` (string, optional, nullable)
- `phones` (list of Phone, optional)
- `tags` (list of string, optional)
- `websites` (list of Website, optional)
- `billing_preferences` (BillingPreferences, optional, nullable) — Billing preferences (defaults to empty preferences).
- `social_pages` (list of SocialPage, optional)
- `target_market_segments` (list of string, optional)
- `current_tech_stack` (list of string, optional)
- `preferred_communication_channels` (list of string, optional)
- `industry_specific_terminologies` (list of string, optional)
- `description` (string, optional, nullable)
- `custom_fields` (list of map from string to any, optional)
- `additional_data` (map from string to any, optional)
- `notes` (list of NoteItemInput, optional) — Structured notes
- `lead` (CompanyLeadAssociation, optional, nullable) — Optional lead creation. When provided, creates a lead and associates it with this company (and the linked contact if provided).
- `contact_association` (CompanyContactsCreate, optional, nullable) — Optional contact association (add existing OR create+associate).
- `addresses` (list of AddressInput, optional)

### Phone

Phone number item: id, phone_number, phone_isd_code, label, is_primary.

- `phone_number` (string, required) — Phone number
- `phone_isd_code` (string, required) — Phone ISD code
- `id` (string, optional, nullable) — Phone item ID
- `label` (string, optional, nullable) — Label (e.g. mobile, work)
- `is_primary` (boolean, optional, default: false) — Primary phone flag

### BillingPreferences

Billing preferences schema.

- `method` (string, optional, nullable) — Billing method
- `terms` (string, optional, nullable) — Payment terms

### CompanyLeadAssociation

Optional lead creation/linking on company create. Creates a new lead (v2 `public.leads`) and associates it with the created company, and also with the linked/created contact when present on the same request.

- `stage_id` (string, required) — Lead pipeline stage id (UUID).
- `intake_stage` (string, optional, nullable) — Optional intake stage label.
- `lead_score` (string, optional, nullable) — Optional lead score label/tier.

### CompanyContactsCreate

Contact association payload used during company create. Mirrors the update naming, but allows only a single operation: - add an existing contact membership (optional primary) - OR create exactly one new contact and associate it (optional primary)

- `add_association` (CompanyContactAssociationAdd, optional, nullable) — Associate an existing contact to this company (single).
- `create_and_associate` (CompanyContactAssociationCreate, optional, nullable) — Create exactly one new contact and associate it to the company (single).

### CompanyContactAssociationAdd

Add an existing contact membership for a company.

- `contact_id` (string, required) — Existing contact id to link
- `is_primary` (boolean, optional, default: false) — If true, set this contact as the company's primary contact.

### CompanyContactAssociationCreate

Create exactly one new contact and link it to the company.

- `contact` (CreateContactRequest, required) — New contact payload (same shape as POST /contacts).
- `is_primary` (boolean, optional, default: false) — If true, set the new contact as the company's primary contact.

### CreateContactRequest

Create a contact. Supports the operations from ADR: - contact only - contact + link to existing company (optionally primary) - contact + create new company + link (optionally primary)

- `email` (string, required) — Contact email address (required).
- `owner_id` (string, optional, nullable) — Owning user; defaults to the caller on internal create when omitted.
- `portal_access` (boolean, optional, default: false) — If true, provisions a portal user for this contact and sends an invite email.
- `prefix` (string, optional, nullable)
- `first_name` (string, optional, nullable)
- `middle_name` (string, optional, nullable)
- `last_name` (string, optional, nullable)
- `title` (string, optional, nullable)
- `date_of_birth` (date, optional, nullable)
- `profile_photo_url` (string, optional, nullable)
- `external_contact_id` (string, optional, nullable) — Optional identifier from an external system (immutable after create).
- `phones` (list of PhoneInput, optional)
- `tags` (list of string, optional)
- `social_pages` (list of SocialPage, optional)
- `websites` (list of Website, optional) — Websites for the contact (stored in additional_data.websites).
- `custom_fields` (list of map from string to any, optional) — Custom fields root cells payload (validated and stored as JSONB).
- `additional_data` (map from string to any, optional) — Free-form JSONB payload stored on the contact.
- `notes` (list of NoteItemInput, optional) — Structured notes
- `lead` (ContactLeadAssociation, optional, nullable) — Optional lead creation. When provided, creates a lead and associates it with this contact (and the linked company if provided).
- `company_association` (ContactCompaniesCreate, optional, nullable) — Optional company association (add existing OR create+associate).
- `addresses` (list of AddressInput, optional)

### ContactLeadAssociation

Optional lead creation/linking on contact create. This creates a new lead (v2 `public.leads`) and associates it with the created contact, and also with the linked/created company when present on the same request.

- `stage_id` (string, required) — Lead pipeline stage id (UUID).
- `name` (string, optional, nullable) — Optional lead display title. When omitted or blank, the lead name is derived from the contact first/last name (or email).
- `intake_stage` (string, optional, nullable) — Optional intake stage label.
- `lead_score` (string, optional, nullable) — Optional lead score label/tier.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "status": "success",
  "message": "Created successfully",
  "statusCode": 201,
  "code": "2001",
  "data": {}
}
```

**SDK Code**

```python Created
import requests

url = "https://api-dev.houseofapps.ai/v1/integrations/prospects"

payload = {}
headers = {
    "appSecret": "appSecret",
    "licenseKey": "licenseKey",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Created
const url = 'https://api-dev.houseofapps.ai/v1/integrations/prospects';
const options = {
  method: 'POST',
  headers: {
    appSecret: 'appSecret',
    licenseKey: 'licenseKey',
    'Content-Type': 'application/json'
  },
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Created
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-dev.houseofapps.ai/v1/integrations/prospects"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("appSecret", "appSecret")
	req.Header.Add("licenseKey", "licenseKey")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Created
require 'uri'
require 'net/http'

url = URI("https://api-dev.houseofapps.ai/v1/integrations/prospects")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["appSecret"] = 'appSecret'
request["licenseKey"] = 'licenseKey'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-dev.houseofapps.ai/v1/integrations/prospects")
  .header("appSecret", "appSecret")
  .header("licenseKey", "licenseKey")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-dev.houseofapps.ai/v1/integrations/prospects', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'appSecret' => 'appSecret',
    'licenseKey' => 'licenseKey',
  ],
]);

echo $response->getBody();
```

```csharp Created
using RestSharp;

var client = new RestClient("https://api-dev.houseofapps.ai/v1/integrations/prospects");
var request = new RestRequest(Method.POST);
request.AddHeader("appSecret", "appSecret");
request.AddHeader("licenseKey", "licenseKey");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Created
import Foundation

let headers = [
  "appSecret": "appSecret",
  "licenseKey": "licenseKey",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-dev.houseofapps.ai/v1/integrations/prospects")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```