> 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/documents.md).

# Documents

Documents uploaded to profiles, the document library types they belong to, and their processing results.

## List document library types

> Returns the document library types available in your account. Use a library's ID as the \`libraryId\` when you upload documents to a profile.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Documents","description":"Documents uploaded to profiles, the document library types they belong to, and their processing results."}],"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":{"DocumentLibraryListResponse":{"title":"Document Library List Response","required":["id","name","type","label"],"properties":{"id":{"description":"Library ID.","type":"number","nullable":false},"name":{"description":"Name of the document library.","type":"string","nullable":false},"type":{"description":"Type of the document library.","type":"string","nullable":false},"label":{"description":"Display label of the document library.","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":{"/documents/libraries":{"get":{"tags":["Documents"],"summary":"List document library types","description":"Returns the document library types available in your account. Use a library's ID as the `libraryId` when you upload documents to a profile.","operationId":"c4c0748e10b7443b29265a34979f35bd","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 document libraries","type":"array","items":{"$ref":"#/components/schemas/DocumentLibraryListResponse"}}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Upload documents to a profile

> Uploads one or more documents to a profile, into the document library given by \`libraryId\`. Send the files as \`multipart/form-data\`, with each file under a key of the form \`document\_1\`, \`document\_2\` and so on. The response lists the uploaded documents.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Documents","description":"Documents uploaded to profiles, the document library types they belong to, and their processing results."}],"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":{"BinaryFile":{"title":"Binary File","type":"string","format":"binary"},"DocumentViewResponse":{"title":"Document View Response","required":["id","profile_id","document_id","category","name","link","file_type","link_expires_at","created_at","updated_at"],"properties":{"id":{"description":"Document ID.","type":"number","nullable":false},"profile_id":{"description":"UUID of the profile the document belongs to.","type":"string","nullable":false},"document_id":{"description":"ID of the document type.","type":"string","nullable":false},"category":{"description":"Category of the document.","type":"string","nullable":false},"name":{"description":"Name of the document.","type":"string","nullable":false},"link":{"description":"Temporary URL to download the document. It stops working at the time given in `link_expires_at`.","type":"string","nullable":false},"file_type":{"description":"File type of the document.","type":"string","nullable":false},"link_expires_at":{"description":"Date and time at which `link` expires.","type":"string","nullable":false},"fraud_check":{"description":"Results of the AI fraud analysis of the document.","properties":{"processed_at":{"description":"Date and time the fraud analysis was processed.","type":"string","nullable":true},"analysis":{"description":"Details of the fraud analysis.","properties":{"score":{"description":"Fraud risk category of the document, for example `low`.","type":"string"},"document_type":{"description":"Type of document identified, in plain language.","type":"string"},"meta_data":{"description":"Metadata embedded in the document.","properties":{"producer":{"description":"Software that produced the file, from its metadata.","type":"string","nullable":true},"creator":{"description":"Software that created the original document, from its metadata.","type":"string","nullable":true},"creation_date":{"description":"Date the document was created, from its metadata.","type":"string","nullable":true},"mod_date":{"description":"Date the document was last modified, from its metadata.","type":"string","nullable":true},"author":{"description":"Author of the document, from its metadata.","type":"string","nullable":true},"keywords":{"description":"Keywords in the document metadata, separated by commas.","type":"string","nullable":true},"subject":{"description":"Subject of the document, from its metadata.","type":"string","nullable":true},"title":{"description":"Title of the document, from its metadata.","type":"string","nullable":true}},"type":"object"},"indicators":{"description":"Fraud indicators detected in the document.","type":"array","items":{"properties":{"type":{"description":"Type of fraud indicator, for example `anomaly`.","type":"string"},"category":{"description":"Category of the fraud indicator, for example `image_manipulation`.","type":"string"},"title":{"description":"Short title of the fraud indicator.","type":"string"},"description":{"description":"Explanation of what was detected.","type":"string"}},"type":"object"}}},"type":"object","nullable":true}},"type":"object","nullable":true},"translation":{"description":"Translation of the document.","properties":{"status":{"description":"Status of the translation.","type":"string","nullable":true},"link":{"description":"Temporary URL to download the translated document. It stops working at the time given in `link_expires_at`.","type":"string","nullable":true},"file_type":{"description":"File type of the translated document.","type":"string","nullable":true},"link_expires_at":{"description":"Date and time at which `link` expires.","type":"string","nullable":true},"extracted":{"description":"Translated text of the document.","type":"string","nullable":true}},"type":"object","nullable":true},"ocr":{"description":"Text extracted from the original document using OCR.","properties":{"extracted":{"description":"Text extracted from the document.","type":"string","nullable":true}},"type":"object","nullable":true},"updated_at":{"description":"Date and time the document was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the document was created.","type":"string","nullable":false}},"type":"object"}},"responses":{"400":{"description":"Bad Request. The request could not be processed because it is invalid. The `message` field explains why.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"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"}}}}},"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}}}},"paths":{"/profiles/{uuid}/documents/{libraryId}":{"post":{"tags":["Documents"],"summary":"Upload documents to a profile","description":"Uploads one or more documents to a profile, into the document library given by `libraryId`. Send the files as `multipart/form-data`, with each file under a key of the form `document_1`, `document_2` and so on. The response lists the uploaded documents.","operationId":"da347f61e5bb8bee4bf94c0aa297b981","parameters":[{"$ref":"#/components/parameters/uuid"},{"name":"libraryId","in":"path","description":"ID of the document library to upload the documents to. Use `GET /documents/libraries` to list the libraries.","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"required":["documents"],"properties":{"documents":{"description":"Keyed files: document_1, document_2, ...","type":"object","additionalProperties":{"$ref":"#/components/schemas/BinaryFile"}}},"type":"object"}}}},"responses":{"200":{"description":"OK. The documents were uploaded, and the response lists them.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentViewResponse"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## List documents

> Returns a list of documents uploaded to profiles in your account. Use the query parameters to filter the results.\
> \
> This endpoint is paginated. Use the \`page\` parameter to request further pages. The \`meta\` and \`links\` objects in the response describe the current page and link to the others.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Documents","description":"Documents uploaded to profiles, the document library types they belong to, and their processing results."}],"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":{"order_by":{"name":"order_by","in":"query","description":"Direction to sort the results in: `asc` for ascending or `desc` for descending. Use it together with `sort_by`; it has no effect if `sort_by` is omitted. The default is `asc`.","schema":{"type":"string","enum":["desc","asc"]}},"page":{"name":"page","in":"query","description":"Page number of the results to return, starting from 1. The number of items per page is returned in `meta.per_page`.","schema":{"type":"integer","minimum":1}}},"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":{"DocumentListResponse":{"title":"Document List Response","required":["id","profile_id","library_id","category","name","created_at","updated_at"],"properties":{"id":{"description":"Document ID.","type":"number","nullable":false},"profile_id":{"description":"UUID of the profile the document belongs to.","type":"string","nullable":false},"library_id":{"description":"ID of the document library the document belongs to.","type":"string","nullable":false},"category":{"description":"Category of the document.","type":"string","nullable":false},"name":{"description":"Name of the document.","type":"string","nullable":false},"updated_at":{"description":"Date and time the document was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the document was created.","type":"string","nullable":false}},"type":"object"},"LinksResource":{"title":"Links Resource","properties":{"first":{"description":"URL of the first page of results.","type":"string","nullable":false},"last":{"description":"URL of the last page of results.","type":"string","nullable":false},"prev":{"description":"URL of the previous page of results, or null if there is none.","type":"string","nullable":false},"next":{"description":"URL of the next page of results, or null if there is none.","type":"string","nullable":false}},"type":"object"},"MetaResource":{"title":"Meta Resource","properties":{"current_page":{"description":"Number of the current page.","type":"number","nullable":false},"from":{"description":"Position of the first item on this page, counted across all pages.","type":"number","nullable":false},"last_page":{"description":"Number of the last page.","type":"number","nullable":false},"links":{"description":"Pagination links, including links to the previous and next pages.","type":"array","items":{"properties":{"url":{"description":"URL of the page, or `null` if there is no such page.","type":"string","nullable":false},"label":{"description":"Text to display for the link, for example a page number or \"Previous\".","type":"string","nullable":false},"active":{"description":"Whether this link is for the current page.","type":"boolean","nullable":false}},"type":"object"},"nullable":false},"path":{"description":"Base URL of the endpoint, without query parameters.","type":"string","nullable":false},"per_page":{"description":"Number of items per page.","type":"number","nullable":false},"to":{"description":"Position of the last item on this page, counted across all pages.","type":"number","nullable":false},"total":{"description":"Total number of items across all pages.","type":"number","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":{"/documents":{"get":{"tags":["Documents"],"summary":"List documents","description":"Returns a list of documents uploaded to profiles in your account. Use the query parameters to filter the results.\n\nThis endpoint is paginated. Use the `page` parameter to request further pages. The `meta` and `links` objects in the response describe the current page and link to the others.","operationId":"f90fe4444f34d192763febd41979d140","parameters":[{"name":"id","in":"query","description":"Filter by document ID. If a match is found, only that document is returned.","schema":{"type":"integer"}},{"$ref":"#/components/parameters/order_by"},{"name":"sort_by","in":"query","description":"The field to sort the results by. Use it together with `order_by` to choose the direction; if `order_by` is omitted, results are sorted in ascending order (`asc`). If `sort_by` is omitted, results are returned in no guaranteed order.\n\nSupported fields:\n- `created_at`\n- `updated_at`\n- `id`\n- `profile_id`\n- `document_id`\n- `category`\n- `name`\n","schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"name":"profile_id","in":"query","description":"Filter by the UUID of the profile the document belongs to.","schema":{"type":"string","format":"uuid"}},{"name":"document_id","in":"query","description":"Filter by the ID of the document type.","schema":{"type":"string"}},{"name":"category","in":"query","description":"Filter by document category.","schema":{"type":"string"}},{"name":"name","in":"query","description":"Filter by document name.","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 documents","type":"array","items":{"$ref":"#/components/schemas/DocumentListResponse"}},"links":{"$ref":"#/components/schemas/LinksResource"},"meta":{"$ref":"#/components/schemas/MetaResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Retrieve a document

> Returns a single document, including a temporary link to download it and the results of processing, such as OCR, translation and fraud analysis.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Documents","description":"Documents uploaded to profiles, the document library types they belong to, and their processing results."}],"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":{"DocumentViewResponse":{"title":"Document View Response","required":["id","profile_id","document_id","category","name","link","file_type","link_expires_at","created_at","updated_at"],"properties":{"id":{"description":"Document ID.","type":"number","nullable":false},"profile_id":{"description":"UUID of the profile the document belongs to.","type":"string","nullable":false},"document_id":{"description":"ID of the document type.","type":"string","nullable":false},"category":{"description":"Category of the document.","type":"string","nullable":false},"name":{"description":"Name of the document.","type":"string","nullable":false},"link":{"description":"Temporary URL to download the document. It stops working at the time given in `link_expires_at`.","type":"string","nullable":false},"file_type":{"description":"File type of the document.","type":"string","nullable":false},"link_expires_at":{"description":"Date and time at which `link` expires.","type":"string","nullable":false},"fraud_check":{"description":"Results of the AI fraud analysis of the document.","properties":{"processed_at":{"description":"Date and time the fraud analysis was processed.","type":"string","nullable":true},"analysis":{"description":"Details of the fraud analysis.","properties":{"score":{"description":"Fraud risk category of the document, for example `low`.","type":"string"},"document_type":{"description":"Type of document identified, in plain language.","type":"string"},"meta_data":{"description":"Metadata embedded in the document.","properties":{"producer":{"description":"Software that produced the file, from its metadata.","type":"string","nullable":true},"creator":{"description":"Software that created the original document, from its metadata.","type":"string","nullable":true},"creation_date":{"description":"Date the document was created, from its metadata.","type":"string","nullable":true},"mod_date":{"description":"Date the document was last modified, from its metadata.","type":"string","nullable":true},"author":{"description":"Author of the document, from its metadata.","type":"string","nullable":true},"keywords":{"description":"Keywords in the document metadata, separated by commas.","type":"string","nullable":true},"subject":{"description":"Subject of the document, from its metadata.","type":"string","nullable":true},"title":{"description":"Title of the document, from its metadata.","type":"string","nullable":true}},"type":"object"},"indicators":{"description":"Fraud indicators detected in the document.","type":"array","items":{"properties":{"type":{"description":"Type of fraud indicator, for example `anomaly`.","type":"string"},"category":{"description":"Category of the fraud indicator, for example `image_manipulation`.","type":"string"},"title":{"description":"Short title of the fraud indicator.","type":"string"},"description":{"description":"Explanation of what was detected.","type":"string"}},"type":"object"}}},"type":"object","nullable":true}},"type":"object","nullable":true},"translation":{"description":"Translation of the document.","properties":{"status":{"description":"Status of the translation.","type":"string","nullable":true},"link":{"description":"Temporary URL to download the translated document. It stops working at the time given in `link_expires_at`.","type":"string","nullable":true},"file_type":{"description":"File type of the translated document.","type":"string","nullable":true},"link_expires_at":{"description":"Date and time at which `link` expires.","type":"string","nullable":true},"extracted":{"description":"Translated text of the document.","type":"string","nullable":true}},"type":"object","nullable":true},"ocr":{"description":"Text extracted from the original document using OCR.","properties":{"extracted":{"description":"Text extracted from the document.","type":"string","nullable":true}},"type":"object","nullable":true},"updated_at":{"description":"Date and time the document was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the document 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":{"/documents/{id}":{"get":{"tags":["Documents"],"summary":"Retrieve a document","description":"Returns a single document, including a temporary link to download it and the results of processing, such as OCR, translation and fraud analysis.","operationId":"e58e42696daf0c0d06c54728f3da6615","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/DocumentViewResponse"}},"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/documents.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.
