> For the complete documentation index, see [llms.txt](https://detected.gitbook.io/detected-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-docs/forms.md).

# Forms

Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms.

## List forms

> Returns the forms available in your account.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Forms","description":"Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms."}],"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 from `POST /oauth/token` with 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":{"ShortFormResource":{"title":"Short Form Resource","required":["id","label","version","provider","archived","updated_at","created_at"],"properties":{"id":{"description":"Form ID.","type":"number","nullable":false},"label":{"description":"Label of the form.","type":"string","nullable":false},"reference":{"description":"Reference of the form.","type":"string","nullable":true},"version":{"description":"Latest version of the form.","type":"number","nullable":false},"provider":{"description":"Form provider.","type":"string","enum":["vueform"],"nullable":false},"archived":{"description":"Whether the form is archived.","type":"boolean","enum":[false,true],"nullable":false},"updated_at":{"description":"Date and time the form was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the form was created.","type":"string","nullable":false}},"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":{"/forms":{"get":{"tags":["Forms"],"summary":"List forms","description":"Returns the forms available in your account.","operationId":"8ba10e9d30e909093f72d15d1a310dc8","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":{"properties":{"data":{"description":"List of forms","type":"array","items":{"$ref":"#/components/schemas/ShortFormResource"}}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Retrieve a form

> Returns a single form, including its schema and sections.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Forms","description":"Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms."}],"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 from `POST /oauth/token` with 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":{"id":{"name":"id","in":"path","description":"ID of the item named in the path, for example the form in `/forms/{id}` or the document in `/documents/{id}`.","required":true,"schema":{"type":"integer","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":{"FormResource":{"title":"Form Resource","required":["id","label","version","provider","archived","updated_at","created_at"],"properties":{"id":{"description":"Form ID.","type":"number","nullable":false},"label":{"description":"Label of the form.","type":"string","nullable":false},"reference":{"description":"Reference of the form.","type":"string","nullable":true},"version":{"description":"Latest version of the form.","type":"number","nullable":false},"provider":{"description":"Form provider.","type":"string","enum":["vueform"],"nullable":false},"schema":{"description":"Schema of the form. Its structure is specific to the provider and is not normalised.","type":"array","items":{"type":"object","additionalProperties":true},"default":[],"nullable":false},"sections":{"description":"Sections of the form. Their structure is specific to the provider and is not normalised.","type":"array","items":{"type":"object","additionalProperties":true},"default":[],"nullable":false},"archived":{"description":"Whether the form is archived.","type":"boolean","enum":[false,true],"nullable":false},"updated_at":{"description":"Date and time the form was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the form was created.","type":"string","nullable":false}},"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"}},"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":{"/forms/{id}":{"get":{"tags":["Forms"],"summary":"Retrieve a form","description":"Returns a single form, including its schema and sections.","operationId":"bd696dace533bdf31386a45ed00c6b4e","parameters":[{"$ref":"#/components/parameters/id"}],"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":{"properties":{"data":{"$ref":"#/components/schemas/FormResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## List representative forms

> Returns the forms assigned to a representative, with the answers given. Use the query parameters to filter the results.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Forms","description":"Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms."}],"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 from `POST /oauth/token` with 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":{"uuid":{"name":"uuid","in":"path","description":"UUID of the item named in the path, for example the profile in `/profiles/{uuid}` or the representative in `/representatives/{uuid}`.","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":{"EntityFormResource":{"title":"Assigned Form Resource","required":["id","label","answers","updated_at","created_at"],"properties":{"id":{"description":"Form ID.","type":"number","nullable":false},"label":{"description":"Label of the form.","type":"string","nullable":false},"reference":{"description":"Reference of the form.","type":"string","nullable":false},"answers":{"description":"Answers given to the form.","type":"array","items":{"properties":{"label":{"description":"Label of the question.","type":"string","nullable":false},"answer":{"description":"Answer given.","type":"string","nullable":false}},"type":"object"}},"updated_at":{"description":"Date and time the form was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the form was created.","type":"string","nullable":false}},"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"}},"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":{"/representatives/{uuid}/forms":{"get":{"tags":["Forms"],"summary":"List representative forms","description":"Returns the forms assigned to a representative, with the answers given. Use the query parameters to filter the results.","operationId":"03e7161dfb6316da2192724f695dc1a6","parameters":[{"$ref":"#/components/parameters/uuid"},{"name":"id","in":"query","description":"Filter by form ID. If a match is found, only that form is returned.","schema":{"type":"integer"}},{"name":"label","in":"query","description":"Filter by form label.","schema":{"type":"string"}},{"name":"reference","in":"query","description":"Filter by form reference.","schema":{"type":"string"}},{"name":"applies_to","in":"query","description":"Filter by form type.","schema":{"type":"string"}}],"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":{"properties":{"data":{"description":"List of forms","type":"array","items":{"$ref":"#/components/schemas/EntityFormResource"}}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Retrieve a representative form

> Returns a single form assigned to a representative, with the answers given.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Forms","description":"Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms."}],"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 from `POST /oauth/token` with 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":{"uuid":{"name":"uuid","in":"path","description":"UUID of the item named in the path, for example the profile in `/profiles/{uuid}` or the representative in `/representatives/{uuid}`.","required":true,"schema":{"type":"string","nullable":false}},"id":{"name":"id","in":"path","description":"ID of the item named in the path, for example the form in `/forms/{id}` or the document in `/documents/{id}`.","required":true,"schema":{"type":"integer","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":{"EntityFormResource":{"title":"Assigned Form Resource","required":["id","label","answers","updated_at","created_at"],"properties":{"id":{"description":"Form ID.","type":"number","nullable":false},"label":{"description":"Label of the form.","type":"string","nullable":false},"reference":{"description":"Reference of the form.","type":"string","nullable":false},"answers":{"description":"Answers given to the form.","type":"array","items":{"properties":{"label":{"description":"Label of the question.","type":"string","nullable":false},"answer":{"description":"Answer given.","type":"string","nullable":false}},"type":"object"}},"updated_at":{"description":"Date and time the form was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the form was created.","type":"string","nullable":false}},"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"}},"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":{"/representatives/{uuid}/forms/{id}":{"get":{"tags":["Forms"],"summary":"Retrieve a representative form","description":"Returns a single form assigned to a representative, with the answers given.","operationId":"3ff99969785ae54d51015745b8057715","parameters":[{"$ref":"#/components/parameters/uuid"},{"$ref":"#/components/parameters/id"}],"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":{"properties":{"data":{"$ref":"#/components/schemas/EntityFormResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Submit answers to a profile form

> Submits answers to a form that has been assigned to a profile.\
> \
> The request body is a JSON object that matches the form's schema, so its structure is different for each form. Retrieve a form's schema with \`GET /forms/{id}\` to find the exact field names and data types. Answers are validated against the schema.\
> \
> Submitting answers again replaces the previous answers. Previously uploaded file answers are kept unless you send a new file for that field.\
> \
> The form must be assigned to the profile before you submit answers.\
> \
> \### Example payload\
> \
> \`\`\`json\
> {\
> &#x20; "field\_name\_1": "answer value",\
> &#x20; "field\_name\_2": true,\
> &#x20; "field\_name\_3": \["option1", "option2"]\
> }\
> \`\`\`

````json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Forms","description":"Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms."}],"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 from `POST /oauth/token` with 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":{"uuid":{"name":"uuid","in":"path","description":"UUID of the item named in the path, for example the profile in `/profiles/{uuid}` or the representative in `/representatives/{uuid}`.","required":true,"schema":{"type":"string","nullable":false}},"id":{"name":"id","in":"path","description":"ID of the item named in the path, for example the form in `/forms/{id}` or the document in `/documents/{id}`.","required":true,"schema":{"type":"integer","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":{"EntityFormResource":{"title":"Assigned Form Resource","required":["id","label","answers","updated_at","created_at"],"properties":{"id":{"description":"Form ID.","type":"number","nullable":false},"label":{"description":"Label of the form.","type":"string","nullable":false},"reference":{"description":"Reference of the form.","type":"string","nullable":false},"answers":{"description":"Answers given to the form.","type":"array","items":{"properties":{"label":{"description":"Label of the question.","type":"string","nullable":false},"answer":{"description":"Answer given.","type":"string","nullable":false}},"type":"object"}},"updated_at":{"description":"Date and time the form was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the form was created.","type":"string","nullable":false}},"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"}},"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/{uuid}/forms/{id}/answers":{"post":{"tags":["Forms"],"summary":"Submit answers to a profile form","description":"Submits answers to a form that has been assigned to a profile.\n\nThe request body is a JSON object that matches the form's schema, so its structure is different for each form. Retrieve a form's schema with `GET /forms/{id}` to find the exact field names and data types. Answers are validated against the schema.\n\nSubmitting answers again replaces the previous answers. Previously uploaded file answers are kept unless you send a new file for that field.\n\nThe form must be assigned to the profile before you submit answers.\n\n### Example payload\n\n```json\n{\n  \"field_name_1\": \"answer value\",\n  \"field_name_2\": true,\n  \"field_name_3\": [\"option1\", \"option2\"]\n}\n```","operationId":"f16a61710abcee7883cfa4d32f2e0ba7","parameters":[{"$ref":"#/components/parameters/uuid"},{"$ref":"#/components/parameters/id"}],"responses":{"201":{"description":"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/EntityFormResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
````

## List profile forms

> Returns the forms assigned to a profile, with the answers given. Use the query parameters to filter the results.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Forms","description":"Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms."}],"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 from `POST /oauth/token` with 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":{"uuid":{"name":"uuid","in":"path","description":"UUID of the item named in the path, for example the profile in `/profiles/{uuid}` or the representative in `/representatives/{uuid}`.","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":{"EntityFormResource":{"title":"Assigned Form Resource","required":["id","label","answers","updated_at","created_at"],"properties":{"id":{"description":"Form ID.","type":"number","nullable":false},"label":{"description":"Label of the form.","type":"string","nullable":false},"reference":{"description":"Reference of the form.","type":"string","nullable":false},"answers":{"description":"Answers given to the form.","type":"array","items":{"properties":{"label":{"description":"Label of the question.","type":"string","nullable":false},"answer":{"description":"Answer given.","type":"string","nullable":false}},"type":"object"}},"updated_at":{"description":"Date and time the form was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the form was created.","type":"string","nullable":false}},"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"}},"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/{uuid}/forms":{"get":{"tags":["Forms"],"summary":"List profile forms","description":"Returns the forms assigned to a profile, with the answers given. Use the query parameters to filter the results.","operationId":"1888b40dd34ca5d3d6c50c8c6519d79f","parameters":[{"$ref":"#/components/parameters/uuid"},{"name":"id","in":"query","description":"Filter by form ID. If a match is found, only that form is returned.","schema":{"type":"integer"}},{"name":"label","in":"query","description":"Filter by form label.","schema":{"type":"string"}},{"name":"reference","in":"query","description":"Filter by form reference.","schema":{"type":"string"}},{"name":"applies_to","in":"query","description":"Filter by form type.","schema":{"type":"string"}}],"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":{"properties":{"data":{"description":"List of forms","type":"array","items":{"$ref":"#/components/schemas/EntityFormResource"}}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Assign a form to a profile

> Assigns a form to a profile. Send a single form ID in the request body. The latest version of the form is assigned. If that version is already assigned to the profile, it is skipped, so there are no duplicates.\
> \
> The response lists all the forms currently assigned to the profile, including the one you just assigned.\
> \
> \### Restrictions\
> \
> \- Only forms of type \`internal\_forms\` can be assigned.\
> \- The form must belong to the same list as the profile.\
> \- If the form does not exist or is not an allowed type, a validation error is returned.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Forms","description":"Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms."}],"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 from `POST /oauth/token` with 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":{"uuid":{"name":"uuid","in":"path","description":"UUID of the item named in the path, for example the profile in `/profiles/{uuid}` or the representative in `/representatives/{uuid}`.","required":true,"schema":{"type":"string","nullable":false}}},"schemas":{"AssignFormToProfileRequest":{"title":"Assign Form To Profile Request","required":["id"],"properties":{"id":{"description":"ID of the form to assign.","type":"number","nullable":false}},"type":"object"},"ShortFormResource":{"title":"Short Form Resource","required":["id","label","version","provider","archived","updated_at","created_at"],"properties":{"id":{"description":"Form ID.","type":"number","nullable":false},"label":{"description":"Label of the form.","type":"string","nullable":false},"reference":{"description":"Reference of the form.","type":"string","nullable":true},"version":{"description":"Latest version of the form.","type":"number","nullable":false},"provider":{"description":"Form provider.","type":"string","enum":["vueform"],"nullable":false},"archived":{"description":"Whether the form is archived.","type":"boolean","enum":[false,true],"nullable":false},"updated_at":{"description":"Date and time the form was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the form 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"}}}},"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"}},"type":"object"}}}},"422":{"description":"Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"},"example_field":{"description":"Validation errors for one field of the request body. The property name is the name of the field that failed validation (`example_field` is a placeholder).","type":"array","items":{"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":{"/profiles/{uuid}/forms":{"put":{"tags":["Forms"],"summary":"Assign a form to a profile","description":"Assigns a form to a profile. Send a single form ID in the request body. The latest version of the form is assigned. If that version is already assigned to the profile, it is skipped, so there are no duplicates.\n\nThe response lists all the forms currently assigned to the profile, including the one you just assigned.\n\n### Restrictions\n\n- Only forms of type `internal_forms` can be assigned.\n- The form must belong to the same list as the profile.\n- If the form does not exist or is not an allowed type, a validation error is returned.","operationId":"47f67c8a1dea05a2327e88cdfe638954","parameters":[{"$ref":"#/components/parameters/uuid"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignFormToProfileRequest"}}}},"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":{"properties":{"data":{"description":"List of forms assigned to profile","type":"array","items":{"$ref":"#/components/schemas/ShortFormResource"}}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Retrieve a profile form

> Returns a single form assigned to a profile, with the answers given.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Forms","description":"Forms available in your account, forms assigned to profiles and representatives, and submitting answers to profile forms."}],"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 from `POST /oauth/token` with 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":{"uuid":{"name":"uuid","in":"path","description":"UUID of the item named in the path, for example the profile in `/profiles/{uuid}` or the representative in `/representatives/{uuid}`.","required":true,"schema":{"type":"string","nullable":false}},"id":{"name":"id","in":"path","description":"ID of the item named in the path, for example the form in `/forms/{id}` or the document in `/documents/{id}`.","required":true,"schema":{"type":"integer","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":{"EntityFormResource":{"title":"Assigned Form Resource","required":["id","label","answers","updated_at","created_at"],"properties":{"id":{"description":"Form ID.","type":"number","nullable":false},"label":{"description":"Label of the form.","type":"string","nullable":false},"reference":{"description":"Reference of the form.","type":"string","nullable":false},"answers":{"description":"Answers given to the form.","type":"array","items":{"properties":{"label":{"description":"Label of the question.","type":"string","nullable":false},"answer":{"description":"Answer given.","type":"string","nullable":false}},"type":"object"}},"updated_at":{"description":"Date and time the form was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the form was created.","type":"string","nullable":false}},"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"}},"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/{uuid}/forms/{id}":{"get":{"tags":["Forms"],"summary":"Retrieve a profile form","description":"Returns a single form assigned to a profile, with the answers given.","operationId":"68668fa647701a21f44bf04a9fdc51a1","parameters":[{"$ref":"#/components/parameters/uuid"},{"$ref":"#/components/parameters/id"}],"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":{"properties":{"data":{"$ref":"#/components/schemas/EntityFormResource"}},"type":"object"}}}},"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-docs/forms.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.
