Skip to main content
POST
/
documents
/
v2
/
edit
cURL
curl --request POST \
  --url https://api.tensorlake.ai/documents/v2/edit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "file_id": "<string>",
  "page_range": "<string>",
  "file_name": "<string>",
  "mime_type": "application/pdf",
  "form_filling": {
    "fill_prompt": "<string>",
    "ignore_source_values": false,
    "no_acroform": false,
    "no_gemini_detection": false
  },
  "labels": {
    "priority": "high",
    "source": "email"
  }
}
'
{
  "job_id": "<string>",
  "created_at": "<string>"
}
Submit an uploaded file, an internet-reachable URL, or any kind of raw text for document editing. If you have configured a webhook, we will notify you when the job is complete, be it a success or a failure. The API will edit the document based on the provided prompt and options. Once submitted, the API will return a job ID.

Authorizations

Authorization
string
header
required

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

Body

application/json

File source - must be exactly one of: file_id, file_url, or raw_text

file_id
string
required

ID of the file previously uploaded to Tensorlake. Has tensorlake- (V1) or file_ (V2) prefix.

Example:

"file_abc123xyz"

page_range
string

Comma-separated list of page numbers or ranges to parse (e.g., '1,2,3-5'). Default: all pages.

Example:

"1-5,8,10"

file_name
string

Name of the file. Only populated when using file_id.

Example:

"document.pdf"

mime_type
enum<string>
Available options:
application/pdf,
application/vnd.openxmlformats-officedocument.wordprocessingml.document,
application/msword,
application/vnd.openxmlformats-officedocument.presentationml.presentation,
application/vnd.ms-powerpoint,
application/vnd.apple.keynote,
image/jpeg,
image/tiff,
text/plain,
text/html,
text/markdown,
text/x-markdown,
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
application/vnd.ms-excel.sheet.macroenabled.12,
application/vnd.ms-excel,
text/xml,
text/csv,
image/png,
text/rtf,
application/rtf,
application/octet-stream,
application/pkcs7-mime,
application/x-pkcs7-mime,
application/pkcs7-signature
form_filling
object
labels
object

Additional metadata to identify the edit request. The labels are returned in the edit response.

Example:
{ "priority": "high", "source": "email" }

Response

Created edit job details

job_id
string
required

The unique identifier for the edit job

created_at
string
required

The creation date and time of the edit job.

The date is in RFC 3339 format.