Upload a document
const url = 'https://api.sonicdocs.ai/v1/documents?chunk_pages=400';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/pdf' }, body: 'binary'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.sonicdocs.ai/v1/documents?chunk_pages=400' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/pdf' \ --header 'Idempotency-Key: example' \ --data binaryStatus: planned. Contract v1.0.0; this endpoint is not deployed. Required scope: documents:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Tenant-scoped admission identity, retained at least 24 hours. Reuse only for identical bytes and canonical options.
Query Parameters
Section titled “Query Parameters”Maximum pages per chunk. Values above the configured admission limit receive 422.
Authorized, named engine and hook configuration. Omission selects the client’s default.
Start with the requested formats. Add PDF for Bates, and PDF and txt for redaction. Select txt if the resulting set is empty.
Request Bodyrequired
Section titled “Request Bodyrequired”Raw PDF, PNG or JPEG bytes; validate content independently of the header.
Responses
Section titled “Responses”Source and initial work item durably recorded.
object
object
Output-affecting transformations in application order. Redaction applies to every published file.
object
Example
{ "state": "accepted", "output_plan": { "formats": [ "txt" ], "transformations": [] }}Headers
Section titled “Headers”See service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}The caller must supply a valid bearer API key.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}Headers
Section titled “Headers”Example
BearerSee service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}See service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}See service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}See service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}See service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}See service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}See service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}default
Section titled “default”See service-interfaces.md for the per-operation status and code mapping.
object
Included in service-generated upload errors to locate intake diagnostics.
Example generated
{ "title": "example", "status": 1, "code": "example", "detail": "example", "trace_id": "example"}