Asynchronous Operations

Some APIs support performing their operations asynchronously. That is, to enqueue the operation to be done at a later time to receive a faster initial response.


Supported APIs

Currently the only APIs that support asynchronous operations are Delete Document and Patch Document Metadata.


Delete Document

To enable asynchronous deletes, set the async query param to true.

Request

const url = 'https://api.ragie.ai/documents/123?async=true';
const options = {method: 'DELETE', headers: {accept: 'application/json'}};

fetch(url, options)

Response

If the async query param is true, the endpoint will return a 202 Accepted response.

{
  "status": "ok"
}

Patch Document Metadata

To enable asynchronous metadata updates, set the asyncproperty to true in the request body.

Request

const url = 'https://api.ragie.ai/documents/123/metadata';
const options = {
  method: 'PATCH',
  headers: {accept: 'application/json', 'content-type': 'application/json'},
  body: JSON.stringify({metadata: {newFavoriteColor: 'Yellow'}, async: true})
};

fetch(url, options)

Response

If the async body param is true, the endpoint will return a 202 Accepted response.

{
  "status": "ok"
}