Skip to main content
POST
/
projects
/
{project_name}
/
tables
/
{table_id}
/
extract
Synchronous extraction for a file end to end
curl --request POST \
  --url https://api.cloudsquid.io/api/projects/{project_name}/tables/{table_id}/extract \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "mimetype": "application/pdf",
  "filename": "<string>",
  "file_type": "uri",
  "file": "<string>"
}
'
{
  "data": {},
  "created_at": "2023-11-07T05:31:56Z",
  "row_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "reasoning": "<string>",
  "review": {
    "comment": "<string>",
    "reviewed_by": "<string>",
    "review_date": "2023-11-07T05:31:56Z",
    "approved": true
  },
  "status": "running",
  "input": {
    "data": {},
    "files": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.cloudsquid.io/llms.txt

Use this file to discover all available pages before exploring further.

This is a blocking call — the HTTP connection stays open until extraction completes, then returns the full result in one response. For large files or batch workflows, use the async run pattern instead.

When to use

Use synchronous extraction when you need the result immediately and your files typically complete within 60 seconds. This is the simplest integration path — one request, one response.

Example

import requests, base64

with open("invoice.pdf", "rb") as f:
    file_b64 = base64.b64encode(f.read()).decode()

response = requests.post(
    "https://api.cloudsquid.io/api/projects/my-project/tables/TABLE_ID/extract",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "file": file_b64,
        "filename": "invoice.pdf",
        "mimetype": "application/pdf",
        "file_type": "binary"
    }
)
print(response.json()["data"])

File type options

file_typefile fieldUse when
binaryBase64-encoded contentUploading directly from disk
uriSigned URL stringFile is hosted remotely — Cloudsquid fetches it
multipartArray of partsEmail (RFC 822) with attachments

Authorizations

X-API-Key
string
header
required

Path Parameters

project_name
string
required

The name of the project

table_id
string<uuid>
required

The ID of the table

Body

application/json
mimetype
enum<string>
required

the mimetype of the document being uploaded

Available options:
application/pdf,
application/json,
image/jpg,
image/jpeg,
image/png,
text/csv,
text/plain,
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
application/vnd.ms-excel,
video/mp4,
audio/mp3,
audio/wav,
audio/ogg,
multipart/related,
message/rfc822
filename
string
required

the name of the file being uploaded

file_type
enum<string>
required

Indicates whether the file is a binary upload or a signed link to the document.

Available options:
uri,
binary,
multipart
file
required

A signed URL to the file.

Response

Successfully extracted file

data
object
required

Object with direct values for each key, allowing single values or arrays of values.

created_at
string<date-time>
required
row_id
string<uuid>
required
reasoning
string
review
object
status
enum<string>

status of the AI run

Available options:
running,
done,
error,
pending
input
object