Skip to main content
POST
/
api
/
v1
/
documents
/
generate
Generate Document
curl --request POST \
  --url https://api.artosai.com/api/v1/documents/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "document_type": "CSR",
  "file_paths": [
    "org-id/documents/protocol.pdf",
    "org-id/documents/study-report.pdf"
  ],
  "connector_data_id": "project-2024-001",
  "workspace_name": "Q1 CSR Documents",
  "template_id": "template-uuid-123",
  "output_name": "CSR_Final"
}
'
{
  "message": "Request to generate document has been accepted and is being processed in the background.",
  "task_id": "document-uuid-456"
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Token provides organization-scoped access.

Body

application/json

Field aliases: connector_data_id = document_set_key, template_id = generic_mrt_id, workspace_name = document_set_name. Both the alias and field name are accepted.

document_type
string
required

Type of document to generate (e.g., CSR, Protocol)

file_paths
string[]
required

S3 object keys for source documents (e.g., org-id/documents/protocol.pdf)

connector_data_id
string
required

Unique key for document set (field name: document_set_key)

workspace_name
string
required

Human-readable name for the document set (field name: document_set_name)

template_id
string
required

ID of the template to use (field name: generic_mrt_id)

output_name
string
required

Name for the generated output file (without .docx extension)

selected_section_ids

Specific section IDs to include (optional)

generic_mrt_outline_full
object

Full outline structure (optional)

document_instructions
string | null

Document-level instructions (optional)

style_guide_id
string | null

Style guide ID from the style_guides table (optional)

Response

Request accepted for processing

message
string
required

Status message

task_id
string
required

Document ID for polling status