Documents

Replace the text of a CSV, TXT or JSON file

POST
/documents/{document_id}/replace-text

Replace the whole text of an uploaded CSV, TSV, TXT, MD or JSON file in one call (at most 1 MB): a new version with the same id, name, folder and sharing, extracted again like documents.replace_confirm. if_hash (the hash data.read returned) refuses a document that changed since. Returns content_hash: data.read and data.grep see the new text at once. Larger or other files: documents.replace_initiate.

Authorization

bearerApiKey
AuthorizationBearer <token>

Create a scoped API key in the Adlass settings.

In: header

Path Parameters

document_id*string

Resource identifier: document_id.

Formatuuid

Header Parameters

X-Request-Id?string

Optional correlation identifier.

Lengthlength <= 128
Idempotency-Key?string

A unique key for this intended write; the body field idempotency_key is accepted instead. One of the two is required. Reuse it only for an identical retry.

Length1 <= length <= 200

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/documents/123e4567-e89b-42d3-a456-426614174000/replace-text" \  -H "Idempotency-Key: 123e4567-e89b-42d3-a456-426614174000" \  -H "Content-Type: application/json" \  -d '{    "content": "example"  }'
{  "document_id": "123e4567-e89b-42d3-a456-426614174000",  "document_status": "UPLOADED",  "processing_job_id": "123e4567-e89b-42d3-a456-426614174000",  "processing_status": "QUEUED",  "content_version": 0,  "content_hash": "3f786850e387550fdab836ed7e6dc881de23001b"}