Skip to main content
POST
/
document_intelligence
Create Document Intelligence
curl --request POST \
  --url https://connect.penbox.io/v1/document_intelligence \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "attachments": [
    {
      "data": "aSDinaTvuI8gbWludGxpZnk=",
      "name": "<string>",
      "type": "<string>"
    }
  ],
  "fields": [
    {
      "name": "<string>",
      "type": "text"
    }
  ],
  "workspace": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "language": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "attachments": [
    {
      "name": "<string>",
      "type": "<string>",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ],
  "results": {},
  "updated_at": "2023-11-07T05:31:56Z",
  "language": "<string>",
  "creator": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "email": "[email protected]"
  },
  "usage": {
    "input": 123,
    "output": 123,
    "total": 123,
    "pages": 123
  }
}
Extract structured data from documents using AI-powered document intelligence.

Request Body

company
object
Company reference (will use first workspace from token if ommited)
attachments
array
required
Array of attachments to process (minimum 1 attachment). Each attachment must use either the id field (reference existing) OR the data field (upload new).
fields
array
required
Array of fields to extract from the documents
language
string
Optional language hint for document processing
The document intelligence processing may take a few seconds. The response includes the extracted results in the results field once processing is complete.
You can reference existing attachments by their UUID instead of uploading new ones, which is more efficient if the documents are already in the system.

Authorizations

Authorization
string
header
required

API token (starts with pnbx_). Create at https://app.penbox.io/workspace/settings/api. Include as: Authorization: Bearer {token}

Body

application/json
attachments
object[]
required

Array of attachments to process (minimum 1). Each attachment must have either 'id' (reference to existing attachment) OR 'data' (new file upload with base64). When using 'data', 'name' and 'type' are required.

Minimum array length: 1

New file upload with base64-encoded data

fields
object[]
required
workspace
object
language
string

Optional language hint for document processing

Response

201 - application/json

Document intelligence job created

id
string<uuid>
required

Document intelligence job UUID

created_at
string<date-time>
required

Job creation timestamp

attachments
object[]
required

Array of processed documents

results
object
required

Extracted field values as key-value pairs

updated_at
string<date-time>

Last update timestamp

language
string

Document language detected or specified

creator
object

User who created the job

usage
object

Token usage statistics for the AI processing