Introduction
The Fundamentals
Base URL
The base URL for all API endpoints is:
Authentication
To access the Document AI API, you’ll need an API key. You can manage your API keys in our developer dashboard.
Include your API key in the Authorization header using Bearer token authentication:
Response Codes
The API returns standard HTTP status codes to indicate the success or failure of your request.
Code | Description |
---|---|
200 | A successful request. |
201 | Resource creation successful. A Link header will be returned with the URL to the newly created resource. |
400 | There is something wrong with your request. The error will include details about the issues. |
401 | The Authentication header is either missing or invalid. |
404 | The resource or endpoint wasn’t found. |
413 | The content of the request is too large for the API to handle. |
429 | Too many requests in too short a time period. |
500 | We encountered an unexpected error handling the request. |
Link
Headers
Several API operations will include a Link
header in a successful response. These are RFC 8288-compliant web links that can be used to make requests to the API that are related to the content in the body of the response.
For example, the response to a successful request to a Begin*
operation might include a link that can be used to obtain the results of processing:
Pagination
Some API operations return list data in a paginated fashion. These operations will also include web links where the rel
parameter is prev
or next
, indicating that the link corresponds to the previous or next page of data, respectively:
The presence of these links can be used to determine if there is more data in the list that can be retrieved from the API. In the above example, the user can move “forward” in the list using the link where rel=next
, but the lack of a link where rel=prev
indicates that this response contains the first page of the list. Note that the above example also contains web links to obtain the results corresponding to documents in the list.
Error Responses
Error responses follow the RFC 9457 format and include the following properties:
Property Name | Description |
---|---|
type | A URI reference that identifies the error type. This value is stable and can be used for programmatic error handling |
title | A short, human-readable summary of the problem |
status | The HTTP status code of the response |
detail | A human-readable explanation specific to this occurrence of the problem |
Requests that result in a 400
Bad Request status code include additional validation
and validationContext
properties with details about the validation issues.
Was this page helpful?