Documents

Get Documents

Get documents content using their datamarts_document_id.

POST
https://api.textreveal.com/v3/documents

Request

Parameters

  • fields(string (enum))[]

    Fields to include in the response

    Values: "datamarts_document_id", "extract_date", "title", "text", "translated_title", "translated_text"
  • translatelanguage-code (enum)

    In which language to translate the results.

    Default translated fields are: title, text.

    If empty, translated_ fields won't be returned.

    Example: french

    Values: "af", "afr", "afrikaans", "albanian", "am", "amh", "amharic", "ar", "ara", "arabic", "armenian", "az", "aze", "azerbaijani", "ben", "bengali", "bg", "bn", "bos", "bosnian", "bs", "bul", "bulgarian", "ca", "cat", "catalan", "chinese"... 

Request Body

  • documents*object[]
    Array length: [1, 25]
Request
{
  "documents": [
    {
      "datamarts_document_id": "5e81c3cfab411d53ea4dcb045548d2a89ea9526f09b75b036f3f6c92e9edd9aa",
      "extract_date": "2025-10-06T04:55:21.713Z"
    }
  ]
}

Response

Response - 200

Requested documents.

  • data*object[]

    Array of documents. Order is not guaranteed, not found documents won't be included

    Array length: [0, 25]
Response
{
  "data": [
    {
      "datamarts_document_id": "5e81c3cfab411d53ea4dcb045548d2a89ea9526f09b75b036f3f6c92e9edd9aa",
      "extract_date": "2025-10-06T04:55:21.713Z",
      "title": "string",
      "text": "string",
      "error": {
        "message": "Your licence does not allow you to access the content of premium documents.",
        "code": 403,
        "reason": "forbidden"
      },
      "translated_title": "string",
      "translated_text": "string"
    }
  ]
}

Error

Error - 400

Bad request

  • message*string

    Error message.

    Example: "Check the errors field for more details"
  • code*number (enum)

    Error code.

    Values: 400
  • reason*string (enum)

    Error reason.

    Values: "invalid"
  • errorsobject[]

    Possible error causes.

Response
{
  "message": "Check the errors field for more details",
  "code": 400,
  "reason": "invalid",
  "errors": [
    {
      "message": "string",
      "field": "documents",
      "reason": "invalid_type"
    }
  ]
}

Error - 401

Unauthorized

  • message*string

    Error message.

    Example: "Authorization header is expected"
  • code*number (enum)

    Error code.

    Values: 401
  • reason*string (enum)

    Error reason.

    Values: "unauthorized"
  • errors*object[]
    Array length: [1, 1]
Response
{
  "message": "Authorization header is expected",
  "code": 401,
  "reason": "unauthorized",
  "errors": [
    {
      "message": "Required",
      "field": "headers.authorization",
      "reason": "invalid_type"
    }
  ]
}

Generic errors are not shown, see Errors for more details.