> For the complete documentation index, see [llms.txt](https://detected.gitbook.io/detected-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://detected.gitbook.io/detected-api-docs/api-reference/profiles/profile-creation.md).

# Profile Creation

Everything needed to create a profile. The most common flow is to first search for an entity and then use the results to create the profile.

## Create a profile

> Creates a profile. There are two ways to do it, both using this endpoint with different fields.\
> \
> \### Option 1: create from a search result\
> \
> Use this after you have searched for the company with \*\*Search for an entity\*\* (\`POST /search\`). Send the \`lookup\_id\` from the search response and the \`response\_id\` of the result you want. The company details come from the search result, so do not send them yourself.\
> \
> \- Required: \`customer\_reference\`, \`lookup\_id\`, \`response\_id\`\
> \- Optional: \`type\`, \`domain\`, \`brand\_id\`\
> \
> \### Option 2: create manually\
> \
> Use this when the company cannot be found by search, or when you want to supply the details yourself. Send the company details.\
> \
> \- Required: \`customer\_reference\`, \`name\`, \`address\` (with \`country\_code\` and \`city\`)\
> \- Optional: \`type\`, \`company\_number\`, \`vat\_number\`, \`domain\`, \`brand\_id\`, and the rest of the address\
> \
> If you do not send \`type\`, \`company\_number\` is also required. If you send \`type\`, the exact company details that are required depend on the entity type.\
> \
> You cannot mix the two options: a request that contains \`lookup\_id\` or \`response\_id\` together with any of the company details (\`name\`, \`company\_number\`, \`vat\_number\` or \`address\`) is rejected with a \`422\` error.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Profile Creation","description":"Everything needed to create a profile. The most common flow is to first search for an entity and then use the results to create the profile."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token with **Create an access token** (`POST /oauth/token`), sending the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"schemas":{"CreateProfileRequest":{"title":"Create Profile Request","description":"Send one of two kinds of request: create a profile from a search result, or create one manually.","oneOf":[{"$ref":"#/components/schemas/CreateProfileFromSearchRequest"},{"$ref":"#/components/schemas/CreateProfileManualRequest"}]},"CreateProfileFromSearchRequest":{"title":"Create Profile From Search Request","description":"Creates a profile from a search result. Send the `lookup_id` and `response_id` of the result you want. The company details come from the search result, so you cannot send them yourself.","required":["customer_reference","lookup_id","response_id"],"properties":{"type":{"description":"Entity type of the profile.","type":"string","enum":["company","sole_trader","partnership","charity","government_entity","incorporated_syndicate","company_syndicate","syndicate","association","trust","fund","club","individual","joint_individual"],"nullable":false},"lookup_id":{"description":"Lookup ID returned by **Search for an entity** (`POST /search`). Send it with `response_id` to create the profile from a search result.","type":"integer","nullable":false},"response_id":{"description":"ID of the search result to create the profile from. Send it with `lookup_id`.","type":"integer","nullable":false},"customer_reference":{"description":"Your unique reference for the profile.","type":"string","nullable":false},"brand_id":{"description":"Brand UUID to assign to the profile.","type":"string","format":"uuid","nullable":true},"domain":{"description":"Company domain, without protocol or path, for example `detected.co`.","type":"string","nullable":false}},"type":"object","not":{"anyOf":[{"required":["name"]},{"required":["company_number"]},{"required":["vat_number"]},{"required":["address"]}]}},"CreateProfileManualRequest":{"title":"Create Profile Manual Request","description":"Creates a profile from company details that you provide. Use this when the company cannot be found by search.","required":["customer_reference","name","address"],"properties":{"type":{"description":"Entity type of the profile.","type":"string","enum":["company","sole_trader","partnership","charity","government_entity","incorporated_syndicate","company_syndicate","syndicate","association","trust","fund","club","individual","joint_individual"],"nullable":false},"customer_reference":{"description":"Your unique reference for the profile.","type":"string","nullable":false},"brand_id":{"description":"Brand UUID to assign to the profile.","type":"string","format":"uuid","nullable":true},"company_number":{"description":"Company registration number.","type":"string","nullable":false},"name":{"description":"Company name.","type":"string","nullable":false},"vat_number":{"description":"VAT number.","type":"string","nullable":false},"domain":{"description":"Company domain, without protocol or path, for example `detected.co`.","type":"string","nullable":false},"address":{"description":"Address of the company.","required":["country_code","city"],"properties":{"line_1":{"description":"First line of the address.","type":"string","nullable":false},"line_2":{"description":"Second line of the address.","type":"string","nullable":false},"country_code":{"description":"Country of the address, ISO 3166-1 alpha-2 country code.","type":"string","nullable":false},"town":{"description":"Town.","type":"string","nullable":false},"city":{"description":"City.","type":"string","nullable":false},"post_code":{"description":"Postcode.","type":"string","nullable":false},"province":{"description":"Province.","type":"string","nullable":false},"state":{"description":"State or region.","type":"string","nullable":false}},"type":"object","nullable":false}},"type":"object","not":{"anyOf":[{"required":["lookup_id"]},{"required":["response_id"]}]}},"ProfileListResource":{"title":"Profile List Resource","required":["id","customer_reference","review_status","updated_at","created_at"],"properties":{"id":{"description":"Profile UUID.","type":"string","nullable":false},"entity_type":{"description":"Entity type information.","properties":{"id":{"description":"Entity type ID.","type":"integer","nullable":true},"type":{"description":"Entity type value.","type":"string","enum":["company","sole_trader","partnership","charity","government_entity","incorporated_syndicate","company_syndicate","syndicate","association","trust","fund","club","individual","joint_individual"],"nullable":false},"label":{"description":"Entity type label.","type":"string","nullable":false}},"type":"object","nullable":false},"customer_reference":{"description":"Your unique reference for the profile.","type":"string","nullable":false},"company_name":{"description":"Name of the company.","type":"string","nullable":false},"risk":{"description":"Risk category assigned to the profile, or `null` if there is none.","properties":{"id":{"description":"Risk category ID.","type":"string","nullable":false},"label":{"description":"Label of the risk category.","type":"string","nullable":true},"category":{"description":"Category of the risk.","type":"string","nullable":true}},"type":"object","nullable":true},"team":{"description":"Team the profile is assigned to, or `null` if there is none.","properties":{"id":{"description":"Team ID.","type":"integer","nullable":false},"label":{"description":"Label of the team.","type":"string","nullable":true}},"type":"object","nullable":true},"configuration":{"description":"Configuration assigned to the profile, or `null` if there is none.","properties":{"id":{"description":"Configuration ID.","type":"integer","nullable":false},"name":{"description":"Name of the configuration.","type":"string","nullable":true}},"type":"object","nullable":true},"brand":{"description":"Brand assigned to the profile, or `null` if there is none.","properties":{"id":{"description":"Brand UUID.","type":"string","nullable":false},"name":{"description":"Brand name.","type":"string","nullable":false},"slug":{"description":"Brand slug.","type":"string","nullable":false}},"type":"object","nullable":true},"review_status":{"description":"Review status of the profile.","type":"string","enum":["Processed","Incomplete","Needs Review","Additional Info Required","Approved","Declined","Archived"],"nullable":false},"assignee":{"description":"Case management user the profile is assigned to, or `null` if there is none.","properties":{"id":{"description":"ID of the case management user.","type":"string","nullable":false},"name":{"description":"Name of the case management user.","type":"string","nullable":true}},"type":"object","nullable":true},"review_at":{"description":"Date the profile's current review period started. The next review falls a configured review period after this date. `null` if no review period has started.","type":"string","nullable":true},"updated_at":{"description":"Date and time the profile was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the profile was created.","type":"string","nullable":false}},"type":"object"}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"422":{"description":"Unprocessable Content. The request was understood but failed validation. `errors` lists each field that failed and why.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"A human-readable description of the first error.","type":"string"},"errors":{"description":"Validation errors, keyed by the name of the field that failed. Each field has a list of messages.","type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/profiles":{"post":{"tags":["Profile Creation"],"summary":"Create a profile","description":"Creates a profile. There are two ways to do it, both using this endpoint with different fields.\n\n### Option 1: create from a search result\n\nUse this after you have searched for the company with **Search for an entity** (`POST /search`). Send the `lookup_id` from the search response and the `response_id` of the result you want. The company details come from the search result, so do not send them yourself.\n\n- Required: `customer_reference`, `lookup_id`, `response_id`\n- Optional: `type`, `domain`, `brand_id`\n\n### Option 2: create manually\n\nUse this when the company cannot be found by search, or when you want to supply the details yourself. Send the company details.\n\n- Required: `customer_reference`, `name`, `address` (with `country_code` and `city`)\n- Optional: `type`, `company_number`, `vat_number`, `domain`, `brand_id`, and the rest of the address\n\nIf you do not send `type`, `company_number` is also required. If you send `type`, the exact company details that are required depend on the entity type.\n\nYou cannot mix the two options: a request that contains `lookup_id` or `response_id` together with any of the company details (`name`, `company_number`, `vat_number` or `address`) is rejected with a `422` error.","operationId":"create-profile-endpoint","requestBody":{"description":"Send either the search result fields (Option 1) or the company details (Option 2). See the description of this endpoint.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProfileRequest"}}}},"responses":{"201":{"description":"Created. The profile was created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ProfileListResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Search for an entity

> Searches for a company or other entity in our network of global data providers. We query several providers and return the most relevant results. Each result is scored against your search criteria using fuzzy matching.\
> \
> You can create a profile directly from a search result. Send the \`lookup\_id\` from the response, and the \`response\_id\` of the result you want, to \*\*Create a profile\*\* (\`POST /profiles\`). See the examples on that endpoint.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Profile Creation","description":"Everything needed to create a profile. The most common flow is to first search for an entity and then use the results to create the profile."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token with **Create an access token** (`POST /oauth/token`), sending the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"schemas":{"SearchRequest":{"title":"Search Request","required":["type","address"],"properties":{"type":{"description":"Entity type to search for.","type":"string","enum":["company","sole_trader","partnership","charity","government_entity","incorporated_syndicate","company_syndicate","syndicate","association","trust","fund","club","individual","joint_individual"],"nullable":false},"name":{"description":"Name of the company to search for. Required unless `company_number` is provided.","type":"string","nullable":false},"company_number":{"description":"Official company registration number or identifier used for searching.","type":"string","nullable":false},"address":{"description":"Address to search in.","required":["country_code"],"properties":{"country_code":{"description":"Country to search in, ISO 3166-1 alpha-2 country code.","type":"string","nullable":false},"city":{"description":"City. Required unless `company_number` is provided.","type":"string","nullable":false},"state":{"description":"State or region. Required when `country_code` is `US`, unless `company_number` is provided.","type":"string","nullable":false}},"type":"object","nullable":false}},"type":"object"},"SearchResponse":{"title":"Search Response","properties":{"data":{"description":"List of search results.","type":"array","items":{"properties":{"type":{"description":"Entity type of the result.","type":"string","enum":["company","sole_trader","partnership","charity","government_entity","incorporated_syndicate","company_syndicate","syndicate","association","trust","fund","club","individual","joint_individual"]},"name":{"description":"Company name.","type":"string"},"company_reference":{"description":"Company reference number, as supplied by the provider.","type":"string"},"provider":{"description":"Data provider that supplied the result.","type":"string"},"provider_reference":{"description":"Reference of the company at the provider.","type":"string"},"jurisdiction_code":{"description":"Jurisdiction code of the company, for example `gb`.","type":"string"},"company_type":{"description":"Type of company, for example `PRIVATE LIMITED COMPANY`.","type":"string"},"current_status":{"description":"Current status of the company, for example `Dissolved`.","type":"string"},"address":{"description":"Address of the company.","type":"string"},"vat_number":{"description":"VAT number of the company, if known.","type":"string","nullable":true},"province_code":{"description":"Province or region code of the company's address.","type":"string","nullable":true},"post_code":{"description":"Postcode of the company address.","type":"string"},"city":{"description":"City of the company address.","type":"string"},"confidence":{"description":"How closely the result matches your search criteria, as a score from 0 to 100.","type":"integer"},"response_id":{"description":"ID of this result. Send it, with `lookup_id`, to **Create a profile** (`POST /profiles`) to create a profile from the result.","type":"integer"}},"type":"object"}},"status":{"description":"Outcome of the search: `EMPTY` if there are no results, `PARTIAL` if the results only partly match, or `MATCH` if there is a match.","type":"string","enum":["EMPTY","PARTIAL","MATCH"]},"lookup_id":{"description":"ID of this search. Send it, with the `response_id` of a result, to **Create a profile** (`POST /profiles`) to create a profile from the result.","type":"integer"}},"type":"object"}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"404":{"description":"Not Found. The requested resource does not exist, or is not available to your account.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"},"error":{"description":"Machine-readable details of the error.","type":"object","properties":{"key":{"description":"Error code, for example `error.generic`.","type":"string"},"params":{"description":"Values used in the error message, if any.","type":"array","items":{}}}}},"type":"object"}}}},"422":{"description":"Unprocessable Content. The request was understood but failed validation. `errors` lists each field that failed and why.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"A human-readable description of the first error.","type":"string"},"errors":{"description":"Validation errors, keyed by the name of the field that failed. Each field has a list of messages.","type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/search":{"post":{"tags":["Profile Creation"],"summary":"Search for an entity","description":"Searches for a company or other entity in our network of global data providers. We query several providers and return the most relevant results. Each result is scored against your search criteria using fuzzy matching.\n\nYou can create a profile directly from a search result. Send the `lookup_id` from the response, and the `response_id` of the result you want, to **Create a profile** (`POST /profiles`). See the examples on that endpoint.","operationId":"search","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## List entity types

> Returns all the available entity types in the platform, and whether each can be searched for in the global data providers. Useful if you are building your own dynamic profile creation form.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Profile Creation","description":"Everything needed to create a profile. The most common flow is to first search for an entity and then use the results to create the profile."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token with **Create an access token** (`POST /oauth/token`), sending the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"schemas":{"SearchTypesResponse":{"title":"Search Types Response","properties":{"company":{"$ref":"#/components/schemas/EntityTypesConfig"},"sole_trader":{"$ref":"#/components/schemas/EntityTypesConfig"},"partnership":{"$ref":"#/components/schemas/EntityTypesConfig"},"charity":{"$ref":"#/components/schemas/EntityTypesConfig"},"government_entity":{"$ref":"#/components/schemas/EntityTypesConfig"},"incorporated_syndicate":{"$ref":"#/components/schemas/EntityTypesConfig"},"company_syndicate":{"$ref":"#/components/schemas/EntityTypesConfig"},"syndicate":{"$ref":"#/components/schemas/EntityTypesConfig"},"association":{"$ref":"#/components/schemas/EntityTypesConfig"},"trust":{"$ref":"#/components/schemas/EntityTypesConfig"},"fund":{"$ref":"#/components/schemas/EntityTypesConfig"},"individual":{"$ref":"#/components/schemas/EntityTypesConfig"},"joint_individual":{"$ref":"#/components/schemas/EntityTypesConfig"},"club":{"$ref":"#/components/schemas/EntityTypesConfig"}},"type":"object"},"EntityTypesConfig":{"title":"Entity Types Config","properties":{"label":{"description":"Display name of the entity type.","type":"string"},"search_enabled":{"description":"Whether search is enabled for the entity type.","type":"boolean"}},"type":"object"}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/search/types":{"get":{"tags":["Profile Creation"],"summary":"List entity types","description":"Returns all the available entity types in the platform, and whether each can be searched for in the global data providers. Useful if you are building your own dynamic profile creation form.","operationId":"search-types-list","responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchTypesResponse"}}}},"401":{"$ref":"#/components/responses/401"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Retrieve search type configuration

> Returns all of the required search inputs based on an entity type and country code. Useful if you are building your own dynamic profile creation form.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Profile Creation","description":"Everything needed to create a profile. The most common flow is to first search for an entity and then use the results to create the profile."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token with **Create an access token** (`POST /oauth/token`), sending the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"parameters":{"entityType":{"name":"type","in":"path","description":"Entity type, for example `company` or `sole_trader`. Use **List entity types** (`GET /search/types`) to list the available types.","required":true,"schema":{"type":"string","enum":["company","sole_trader","partnership","charity","government_entity","incorporated_syndicate","company_syndicate","syndicate","association","trust","fund","club","individual","joint_individual"],"nullable":false}},"countryCode":{"name":"countryCode","in":"path","description":"Two-letter country code in ISO 3166-1 alpha-2 format, for example `GB`.","required":true,"schema":{"type":"string","nullable":false}}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"schemas":{"EntityTypeConfig":{"title":"Entity Type Config","properties":{"type":{"description":"Entity type.","type":"string"},"label":{"description":"Display name of the entity type.","type":"string"},"search_enabled":{"description":"Whether search is enabled for the entity type.","type":"boolean"},"search_fields":{"description":"Search fields available for the entity type, keyed by field name. An empty list (`[]`) when search is not enabled for the type.","properties":{"address.country_code":{"$ref":"#/components/schemas/SearchField"},"customer_reference":{"$ref":"#/components/schemas/SearchField"},"name":{"$ref":"#/components/schemas/SearchField"},"address.city":{"$ref":"#/components/schemas/SearchField"},"address.state":{"$ref":"#/components/schemas/SearchField"},"company_number":{"$ref":"#/components/schemas/SearchField"},"domain":{"$ref":"#/components/schemas/SearchField"}}}},"type":"object"},"SearchField":{"title":"Search Field","properties":{"is_required":{"description":"Whether the field is required to run the search.","type":"boolean"},"label":{"description":"Display name of the field.","type":"string"},"position":{"description":"Position of the field in the search form.","type":"integer"}},"type":"object"}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"404":{"description":"Not Found. The requested resource does not exist, or is not available to your account.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"},"error":{"description":"Machine-readable details of the error.","type":"object","properties":{"key":{"description":"Error code, for example `error.generic`.","type":"string"},"params":{"description":"Values used in the error message, if any.","type":"array","items":{}}}}},"type":"object"}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/search/types/{type}/{countryCode}":{"get":{"tags":["Profile Creation"],"summary":"Retrieve search type configuration","description":"Returns all of the required search inputs based on an entity type and country code. Useful if you are building your own dynamic profile creation form.","operationId":"search-type-country-config","parameters":[{"$ref":"#/components/parameters/entityType"},{"$ref":"#/components/parameters/countryCode"}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityTypeConfig"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Retrieve profile creation configuration

> Returns the fields for creating a profile of an entity type in a country, including whether each field is required. Useful if you are building your own dynamic profile creation form.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Profile Creation","description":"Everything needed to create a profile. The most common flow is to first search for an entity and then use the results to create the profile."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token with **Create an access token** (`POST /oauth/token`), sending the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"parameters":{"entityType":{"name":"type","in":"path","description":"Entity type, for example `company` or `sole_trader`. Use **List entity types** (`GET /search/types`) to list the available types.","required":true,"schema":{"type":"string","enum":["company","sole_trader","partnership","charity","government_entity","incorporated_syndicate","company_syndicate","syndicate","association","trust","fund","club","individual","joint_individual"],"nullable":false}},"countryCode":{"name":"countryCode","in":"path","description":"Two-letter country code in ISO 3166-1 alpha-2 format, for example `GB`.","required":true,"schema":{"type":"string","nullable":false}}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"schemas":{"ProfilesTypeConfigResponse":{"title":"Profile Entity Type Configuration Response","properties":{"id":{"description":"ID of the entity type.","type":"integer","nullable":false},"type":{"description":"Entity type.","type":"string","nullable":false},"label":{"description":"Display name of the entity type.","type":"string","nullable":false},"fields":{"description":"Fields that can be provided when creating a profile of this type.","type":"array","items":{"properties":{"code":{"description":"Code of the field. It is the property name to use in the request.","type":"string","nullable":false},"label":{"description":"Display name of the field.","type":"string","nullable":false},"is_required":{"description":"Whether the field is required.","type":"boolean","nullable":false},"position":{"description":"Position of the field in the form.","type":"integer","nullable":false}},"type":"object"}}},"type":"object"}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"404":{"description":"Not Found. The requested resource does not exist, or is not available to your account.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"},"error":{"description":"Machine-readable details of the error.","type":"object","properties":{"key":{"description":"Error code, for example `error.generic`.","type":"string"},"params":{"description":"Values used in the error message, if any.","type":"array","items":{}}}}},"type":"object"}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/profiles/types/{type}/{countryCode}":{"get":{"tags":["Profile Creation"],"summary":"Retrieve profile creation configuration","description":"Returns the fields for creating a profile of an entity type in a country, including whether each field is required. Useful if you are building your own dynamic profile creation form.","operationId":"configuration-entity-type","parameters":[{"$ref":"#/components/parameters/entityType"},{"$ref":"#/components/parameters/countryCode"}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfilesTypeConfigResponse"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://detected.gitbook.io/detected-api-docs/api-reference/profiles/profile-creation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
