OpenAPI SpecificationJSON
API Reference

Upload

Object representing an upload. An upload contains information about documents uploaded to a queue, including the creator, creation time, and associated documents and annotations.

Create upload endpoints also support basic authentication to enable easy integration with third-party systems.

Upload

Attribute
Type
Description
id*
read-only
integer (int64)

ID of the upload.

url*
read-only
string (url)

Upload object URL.

queue*
URL

Queue URL.

creator*
read-only
string,null (url)

URL of the user who created the upload.

created_at*
read-only
datetime

Time of the creation of the upload.

email*
read-only
string,null (url)

URL of the email that created the upload object (if applicable).

organization*
URL

Organization URL.

documents*
read-only
list[string (url)]

URLs of the uploaded documents.

additional_documents*
read-only
array | null

URLs of additional documents created in upload.created event hooks.

annotations*
read-only
array | null

URLs of all created annotations.

Create upload

Uploads a document to the queue specified as query parameter (starting in the importing state).

Multiple files upload is supported, the total size of the data uploaded may not exceed 40 MB. UTF-8 filenames are supported, see examples.

The file can be sent as a part of multipart/form-data or, alternatively, in the request body.

The {filename} parameter in the URL path only works when sending the file in the request body using --data-binary. When uploading via multipart/form-data, the filename is automatically extracted from the form field and the {filename} parameter in the URL is ignored. Use the Content-Disposition header or specify the filename in the form field instead.

You can also specify additional properties using form field:

  • Metadata could be passed using metadata form field. Metadata will be set to newly created annotation object.
  • Values could be passed using values form field. It may be used to initialize datapoint values by setting the value of rir_field_names in the schema.

For example upload:organization_unit field may be referenced in a schema like this:

{
  "category": "datapoint",
  "id": "organization_unit", 
  "label": "Org unit",
  "type": "string",
  "rir_field_names": ["upload:organization_unit"]
}

The endpoint is asynchronous and response contains created task url. Further information about the import status may be acquired by retrieving the upload object or the task (for more information, please refer to task).

POST
/api/v1/uploads
curl -X POST "https://example.rossum.app/api/v1/uploads?queue=8236" \  -F content="string"
{
  "url": "https://example.rossum.app/api/v1/tasks/315509"
}
{
  "detail": "Bad Request.",
  "code": "bad_request"
}
{
  "detail": "Invalid token.",
  "code": "authentication_failed"
}
{
  "detail": "Access to the requested resource is forbidden.",
  "code": "access_forbidden"
}
{
  "detail": "Not found.",
  "code": "not_found"
}
{
  "detail": "Conflict.",
  "code": "conflict_status"
}
{
  "detail": "Payload Too Large.",
  "code": "payload_too_large"
}
{
  "detail": "Request was rate limited.",
  "code": "rate_limited",
  "url": "https://rossum.app/api/docs/openapi/guides/overview/#rate-limiting"
}
{
  "detail": "Server error.",
  "code": "error"
}
{
  "detail": "Bad Gateway.",
  "code": "bad_gateway"
}
{
  "detail": "Service Unavailable.",
  "code": "service_unavailable"
}
{
  "detail": "Gateway timeout.",
  "code": "gateway_timeout"
}
Attribute
Type
Description
content*
string (binary)

The file(s) to upload. Multiple files are supported.

metadata
string

JSON string containing metadata to be set on the newly created annotation object.

values
string

JSON string containing values to initialize datapoint values.

Response

202

Accepted

Attribute
Type
Description
url
string (url)

URL of the created task for tracking upload progress.

400Bad Request

Invalid input data.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

401Unauthorized

The username/password is invalid or token is invalid (e.g. expired).

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

403Forbidden

Insufficient permission, missing authentication, invalid CSRF token and similar issue.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

404Not Found

The specified resource was not found.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

409Conflict

Conflict

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

413

Payload too large (especially for files uploaded).

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

429Too Many Requests

Request rate is too high, wait before sending more requests. See Rate Limiting for more details.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

url
read-only
string

Link to the rate limiting documentation

500Internal Server Error

Server failure while processing the request.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

502Bad Gateway

Invalid response from the upstream server.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

503Service Unavailable

We're temporarily offline for maintenance. Please try again later.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

504

Upstream server could not complete the request in time.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

Retrieve upload

Returns upload object.

GET
/api/v1/uploads/{uploadID}
curl -X GET "https://example.rossum.app/api/v1/uploads/0"
{
  "id": 314528,
  "url": "https://example.rossum.app/api/v1/uploads/314528",
  "queue": "https://example.rossum.app/api/v1/queues/8198",
  "creator": "https://example.rossum.app/api/v1/users/1",
  "created_at": "2021-04-26T10:08:03.856648Z",
  "email": "https://example.rossum.app/api/v1/emails/96743",
  "organization": "string",
  "documents": [
    "https://example.rossum.app/api/v1/documents/254322",
    "https://example.rossum.app/api/v1/documents/254323"
  ],
  "additional_documents": [
    "https://example.rossum.app/api/v1/documents/254324"
  ],
  "annotations": [
    "https://example.rossum.app/api/v1/annotations/104322",
    "https://example.rossum.app/api/v1/annotations/104323",
    "https://example.rossum.app/api/v1/annotations/104324"
  ]
}
{
  "detail": "Bad Request.",
  "code": "bad_request"
}
{
  "detail": "Invalid token.",
  "code": "authentication_failed"
}
{
  "detail": "Access to the requested resource is forbidden.",
  "code": "access_forbidden"
}
{
  "detail": "Not found.",
  "code": "not_found"
}
{
  "detail": "Conflict.",
  "code": "conflict_status"
}
{
  "detail": "Request was rate limited.",
  "code": "rate_limited",
  "url": "https://rossum.app/api/docs/openapi/guides/overview/#rate-limiting"
}
{
  "detail": "Server error.",
  "code": "error"
}
{
  "detail": "Bad Gateway.",
  "code": "bad_gateway"
}
{
  "detail": "Service Unavailable.",
  "code": "service_unavailable"
}
{
  "detail": "Gateway timeout.",
  "code": "gateway_timeout"
}

Response

200OK

OK

Attribute
Type
Description
id*
read-only
integer (int64)

ID of the upload.

url*
read-only
string (url)

Upload object URL.

queue*
URL

Queue URL.

creator*
read-only
string,null (url)

URL of the user who created the upload.

created_at*
read-only
datetime

Time of the creation of the upload.

email*
read-only
string,null (url)

URL of the email that created the upload object (if applicable).

organization*
URL

Organization URL.

documents*
read-only
list[string (url)]

URLs of the uploaded documents.

additional_documents*
read-only
array | null

URLs of additional documents created in upload.created event hooks.

annotations*
read-only
array | null

URLs of all created annotations.

400Bad Request

Invalid input data.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

401Unauthorized

The username/password is invalid or token is invalid (e.g. expired).

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

403Forbidden

Insufficient permission, missing authentication, invalid CSRF token and similar issue.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

404Not Found

The specified resource was not found.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

409Conflict

Conflict

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

429Too Many Requests

Request rate is too high, wait before sending more requests. See Rate Limiting for more details.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

url
read-only
string

Link to the rate limiting documentation

500Internal Server Error

Server failure while processing the request.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

502Bad Gateway

Invalid response from the upstream server.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

503Service Unavailable

We're temporarily offline for maintenance. Please try again later.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

504

Upstream server could not complete the request in time.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

Create upload with filename

Uploads a document to the queue specified as query parameter with filename specified in the URL path. UTF-8 filenames are supported and must be URL encoded.

The file should be sent in the request body. The total size of the data uploaded may not exceed 40 MB.

The endpoint is asynchronous and response contains created task url. Further information about the import status may be acquired by retrieving the upload object or the task (for more information, please refer to task).

POST
/api/v1/uploads/{filename}
curl -X POST "https://example.rossum.app/api/v1/uploads/document%20%F0%9F%8E%81.pdf?queue=8236" \  -H "Content-Type: application/octet-stream" \  -d 'string'
{
  "url": "https://example.rossum.app/api/v1/tasks/315509"
}
{
  "detail": "Bad Request.",
  "code": "bad_request"
}
{
  "detail": "Invalid token.",
  "code": "authentication_failed"
}
{
  "detail": "Access to the requested resource is forbidden.",
  "code": "access_forbidden"
}
{
  "detail": "Not found.",
  "code": "not_found"
}
{
  "detail": "Conflict.",
  "code": "conflict_status"
}
{
  "detail": "Payload Too Large.",
  "code": "payload_too_large"
}
{
  "detail": "Request was rate limited.",
  "code": "rate_limited",
  "url": "https://rossum.app/api/docs/openapi/guides/overview/#rate-limiting"
}
{
  "detail": "Server error.",
  "code": "error"
}
{
  "detail": "Bad Gateway.",
  "code": "bad_gateway"
}
{
  "detail": "Service Unavailable.",
  "code": "service_unavailable"
}
{
  "detail": "Gateway timeout.",
  "code": "gateway_timeout"
}
bodystring (binary)

Response

202

Accepted

Attribute
Type
Description
url
string (url)

URL of the created task for tracking upload progress.

400Bad Request

Invalid input data.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

401Unauthorized

The username/password is invalid or token is invalid (e.g. expired).

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

403Forbidden

Insufficient permission, missing authentication, invalid CSRF token and similar issue.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

404Not Found

The specified resource was not found.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

409Conflict

Conflict

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

413

Payload too large (especially for files uploaded).

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

429Too Many Requests

Request rate is too high, wait before sending more requests. See Rate Limiting for more details.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

url
read-only
string

Link to the rate limiting documentation

500Internal Server Error

Server failure while processing the request.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

502Bad Gateway

Invalid response from the upstream server.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

503Service Unavailable

We're temporarily offline for maintenance. Please try again later.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error

504

Upstream server could not complete the request in time.

Attribute
Type
Description
detail
read-only
string

Detail of the error

code
read-only
string

Code of the error