GET
/
datastores
/
{datastore_id}
/
documents
curl --request GET \
  --url https://api.contextual.ai/v1/datastores/{datastore_id}/documents \
  --header 'Authorization: Bearer <token>'
{
  "total_count": 123,
  "next_cursor": "<string>",
  "documents": [
    {
      "custom_metadata": {},
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "status": "pending",
      "created_at": "<string>",
      "updated_at": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

datastore_id
string
required

Datastore ID of the datastore to retrieve documents for

Query Parameters

limit
integer
default:1000

Maximum number of documents to return

Required range: 1 <= x <= 1000
cursor
string

Cursor from the previous call to list documents, used to retrieve the next set of results

ingestion_job_status
enum<string>[]

Filters documents whose ingestion job status matches (one of) the provided status(es).

Available options:
pending,
processing,
retrying,
completed,
failed,
cancelled,
failed_to_provision,
generating_data,
training_in_progress,
failed_to_generate_data,
provisioning
uploaded_after
string

Filters documents uploaded at or after specified timestamp.

uploaded_before
string

Filters documents uploaded at or before specified timestamp.

Response

200
application/json
Successful Response

Response body from GET /data/documents

documents
object[]
required

List of documents retrieved based on the user's GET request

Document description

total_count
integer

Total number of available documents which would be returned by the request if no limit were specified. Ommitted if job_id was set in the request.

next_cursor
string

Next cursor to continue pagination. Ommitted if there are no more documents after these ones, or if job_id was set in the request.