Skip to main content
POST
/
cURL
curl -s -X POST https://file-external.api.pangram.com \
  -H "x-api-key: $PANGRAM_API_KEY" \
  -F "files=@modeling/deployments/test/test_document.docx" \
  -F "public_dashboard_link=true"
[
  {
    "public_dashboard_link": "https://www.pangram.com/history/123e4567-e89b-12d3-a456-426614174000"
  }
]
Current
File Upload
Current version
File uploads accept documents as multipart form data and return per-file results. Use them when you want Pangram to extract text from files and create dashboard-backed AI detection results.

POST /

Upload one or more files for AI detection.
POST https://file-external.api.pangram.com
This endpoint must receive multipart/form-data with a form field named files. Requests without that field return 422 Unprocessable Entity with Field required for body.files.

Request

Send the request as multipart/form-data. When using cURL, do not set the Content-Type header yourself. The -F flags add the multipart boundary automatically.
FieldTypeRequiredDescription
filesfile[]YesFiles to analyze. Include the files form field once per uploaded file.
public_dashboard_linkbooleanNoWhether to create and return a public dashboard link for each uploaded file. Defaults to false.

Response

Returns a JSON array with one result object per uploaded file.
FieldTypeDescription
public_dashboard_linkstringPublic dashboard URL for the uploaded file. Present when public_dashboard_link is true.

Example

cURL
curl -s -X POST https://file-external.api.pangram.com \
  -H "x-api-key: $PANGRAM_API_KEY" \
  -F "files=@modeling/deployments/test/test_document.docx" \
  -F "public_dashboard_link=true"
To upload multiple files, repeat the files form field:
cURL
curl -s -X POST https://file-external.api.pangram.com \
  -H "x-api-key: $PANGRAM_API_KEY" \
  -F "files=@path/to/first.docx" \
  -F "files=@path/to/second.pdf" \
  -F "public_dashboard_link=true"
Example Response
[
  {
    "public_dashboard_link": "https://www.pangram.com/history/123e4567-e89b-12d3-a456-426614174000"
  }
]
To print only the dashboard link:
curl -s -X POST https://file-external.api.pangram.com \
  -H "x-api-key: $PANGRAM_API_KEY" \
  -F "files=@modeling/deployments/test/test_document.docx" \
  -F "public_dashboard_link=true" \
  | jq -r '.[0].public_dashboard_link'

Errors

Status CodeDescription
400 Bad RequestThe multipart request is missing a file or includes invalid form data.
401 UnauthorizedThe x-api-key is missing or invalid.
402 Payment RequiredThe account has insufficient credits.
413 Payload Too LargeThe upload exceeds the maximum supported file size.
415 Unsupported Media TypeThe uploaded file type is not supported.
422 Unprocessable EntityThe files field is missing, the form data is invalid, or Pangram could not extract valid text from the uploaded file.
500 Internal Server ErrorThere was an error processing the upload.

Authorizations

x-api-key
string
header
required

Body

multipart/form-data
files
file[]
required

Files to analyze. Send this form field once per uploaded file.

Whether to create and return a public dashboard link for each uploaded file.

Response

Per-file upload results.

Public dashboard URL for the uploaded file.