Hey, human!
HTTP/2 200 OK content-type: text/markdown; charset=utf-8 vary: accept, user-agent x-agent: [ai_agent]
Loading the agent response…
Convert a file into a new file (PDF to text, pictures, Word, Excel or split parts; pictures or an Office file to PDF; OCR, redact, compress, protect, unlock)
Makes a NEW file from this one; the source is never changed. `to` selects the conversion: text (a .txt), images (PNG or JPG per page, in a zip, up to 30 pages), split (a zip of PDFs; ranges 'each' or '1-3,4-6'), word (the text as a .docx), excel (the tables found by position as a .xlsx; none found is 422), pdf (the source is a picture, with more_file_ids for more pictures, or one Word, Excel or PowerPoint file converted by LibreOffice in an isolated sandbox, up to about half a minute), ocr (a searchable PDF; English, up to 8 scanned pages a run), redact (terms and/or emails: every page with a match becomes a picture, so the text is gone from the file; every term must exist), compress (level light, medium or strong), protect (password: AES-256) and unlock (password: the PDF's current one). The password is used for this call only and is never stored or logged. name and folder_id choose the new file. Needs files:write; 20 calls a minute per token.
What you provide
- To
- Pagesoptional: For text, images, word, excel, ocr and redact: only these pages, like 1-5
- Image formatoptional: For images (default png)
- Rangesoptional: For split: 'each' (default) or groups like 1-3,4-6
- More file idsoptional: For pdf from pictures: the other pictures' ids in order (the source is the first)
- Page sizeoptional: For pdf from pictures (default fit)
- Termsoptional: For redact: the exact texts to black out (2 to 100 characters each, up to 50; case does not matter)
- Emailsoptional: For redact: black out every email address
- Leveloptional: For compress (default medium)
- Passwordoptional: For protect (4 to 100 characters) and unlock (the PDF's current password). Used for this call only; never stored or logged
- Nameoptional: The new file's name (the right extension is added or corrected)
- Folder idoptional: The folder for the new file; null for the library root; omitted keeps the source's folder
Do this with AI
I want to convert a file into a new file (PDF to text, pictures, Word, Excel or split parts; pictures or an Office file to PDF; OCR, redact, compress, protect, unlock). Use the Tarkle API. Read the reference for this operation and follow it exactly: https://project-03b42162.restlessdocs.com/endpoint/convertfile.md Authenticate with your API key as a Bearer token in the Authorization header. Then make the request for me and tell me what came back.
Paste this into Claude, Cursor, or any AI assistant and it will do it for you.
https://tarkle.com/api/v1/files/{id}/convertcurl --request POST \
--url https://tarkle.com/api/v1/files/id/convert \
--header 'Authorization: Bearer $API_KEY' \
--header 'Content-Type: application/json' \
--header 'X-Workspace-Key: X-Workspace-Key' \
--data '
{
"to": "text",
"pages": "pages",
"image_format": "png",
"ranges": "ranges",
"more_file_ids": [
"string"
],
"page_size": "fit",
"terms": [
"string"
],
"emails": true,
"level": "light",
"password": "password",
"name": "name",
"folder_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
'Path parameters
idstringrequiredA file id (digits) or a folder id (uuid)
Query parameters
workspace_keystringThe same key as the X-Workspace-Key header, for clients that cannot set headers. Send one of the two, or both with the same value (different values are 400 conflicting_workspace)
Header parameters
X-Workspace-KeystringrequiredThe 8-character key of the workspace this call acts on; GET /workspaces lists the keys a token can use. A workspace id is refused (400 workspace_key_required)
Idempotency-KeystringMakes a write safe to repeat. Send a random value (a UUID is fine) of up to 255 visible characters. A repeat of the same request gets the first answer again, with the header `Idempotent-Replayed: true`, and does nothing twice. The same key for a different request is 422 `idempotency_key_reused`; the same request while the first one is still running is 409 `idempotency_in_progress`. A 5xx or 429 is not remembered, so retrying it runs the request again. Keys last 24 hours and belong to the account that created the token.
Body
application/jsonrequiredtostringrequiredpagesstringFor text, images, word, excel, ocr and redact: only these pages, like 1-5
image_formatstringFor images (default png)
rangesstringFor split: 'each' (default) or groups like 1-3,4-6
more_file_idsstring[]For pdf from pictures: the other pictures' ids in order (the source is the first)
page_sizestringFor pdf from pictures (default fit)
termsstring[]For redact: the exact texts to black out (2 to 100 characters each, up to 50; case does not matter)
emailsbooleanFor redact: black out every email address
levelstringFor compress (default medium)
passwordstringFor protect (4 to 100 characters) and unlock (the PDF's current password). Used for this call only; never stored or logged
namestringThe new file's name (the right extension is added or corrected)
folder_idstring · uuid | nullThe folder for the new file; null for the library root; omitted keeps the source's folder