Skip to main content
POST
/
extractions
/
sessions
Create Session
curl --request POST \
  --url https://api.raydocs.com/extractions/sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "extraction_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "Q1 2024 Invoices"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "extraction_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "settings": {},
  "status": "pending",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "documents": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "filename": "<string>",
      "mime_type": "<string>",
      "size": 123,
      "status": "pending",
      "extraction_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "created_at": "2023-11-07T05:31:56Z"
    }
  ],
  "results": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "extraction_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": "pending",
      "data": {},
      "reasoning": {},
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ]
}

Authentication & Scope

Requires the sessions-write ability.

Request

POST /extractions/sessions HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Q1 2024 Invoices",
  "extraction_template_id": "550e8400-e29b-41d4-a716-446655440000"
}

Body Parameters

ParameterTypeRequiredDescription
namestringNoSession name
extraction_template_iduuidYesTemplate to use for extraction

Response

201 Created – The newly created session.
{
  "id": "770e8400-e29b-41d4-a716-446655440000",
  "name": "Q1 2024 Invoices",
  "extraction_template_id": "550e8400-e29b-41d4-a716-446655440000",
  "settings": {},
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "documents": [],
  "results": []
}
After creating a session, upload documents using the Upload Document endpoint.

Authorizations

Authorization
string
header
required

Personal Access Token

Body

application/json
extraction_template_id
string<uuid>
required
name
string
Example:

"Q1 2024 Invoices"

Response

Created

id
string<uuid>
name
string
extraction_template_id
string<uuid>
settings
object
status
enum<string>
Available options:
pending,
processing,
completed,
failed
created_at
string<date-time>
updated_at
string<date-time>
documents
object[]
results
object[]