Skip to main content
POST
/
extractions
/
sessions
/
{sessionId}
/
documents
/
attach
Attach Existing Session Documents
curl --request POST \
  --url https://api.raydocs.com/extractions/sessions/{sessionId}/documents/attach \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "document_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ]
}
'
{
  "data": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "workspace_id": 123,
      "filename": "<string>",
      "mime": "<string>",
      "size": 123,
      "sha256": "<string>",
      "status": "uploaded",
      "source_type": "upload",
      "source_url": "<string>",
      "parsings": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "config_hash": "<string>",
          "status": "queued",
          "parser_version": "<string>",
          "updated_at": "2023-11-07T05:31:56Z"
        }
      ],
      "created_at": "2023-11-07T05:31:56Z"
    }
  ]
}
Use this endpoint when documents already exist at workspace scope and you only want to link them to a session.

Request

POST /extractions/sessions/770e8400-e29b-41d4-a716-446655440000/documents/attach HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "document_ids": [
    "880e8400-e29b-41d4-a716-446655440000"
  ]
}

Body Parameters

ParameterTypeRequiredDescription
document_idsarray[uuid]YesWorkspace document IDs to attach

Response

200 OK when attachment succeeds.
{
  "data": [
    {
      "id": "880e8400-e29b-41d4-a716-446655440000",
      "workspace_id": "660e8400-e29b-41d4-a716-446655440000",
      "filename": "invoice.pdf",
      "status": "processed"
    }
  ]
}
422 Unprocessable Entity if one or more documents do not belong to the session workspace.

Authorizations

Authorization
string
header
required

Personal Access Token created from the Raydocs dashboard. Include in the Authorization header: Bearer <your_token> See API Keys for token creation and management.

Path Parameters

sessionId
string<uuid>
required

Body

application/json
document_ids
string<uuid>[]
required

Existing workspace document ids to attach

Response

Documents attached

data
object[]