Skip to main content

POST /v1/file/hash

Attributes

Attributes are case-sensitive and should be inside JSON for POST request. for example: { "url": "https://example.com/file1.pdf" }
AttributeTypeRequiredDefaultDescription
urlstringYes-URL to the source file url attribute

Query parameters

No query parameters accepted.

Responses

ParameterTypeDescription
hashstringHash of the final PDF file stored in S3.
creditsintegerNumber of credits consumed by the request
remainingCreditsintegerNumber of credits remaining in the account
durationintegerTime taken for the operation in milliseconds

Example Payload

To see the request size limits, please refer to the Request Size Limits.
{
  "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/document-parser/sample-invoice.pdf"
}

Example Response

To see the main response codes, please refer to the Response Codes page.
{
  "hash": "d942e5becdcb0386598cce15e9e56deb1ca9d893b8578a88eca4a62f02c4000b",
  "remainingCredits": 98143
}
Inconsistent URL Encoding in cURL Output: When using cURL to make API requests, the output JSON may show URL characters encoded as Unicode escape sequences. For example, the ampersand character (&) may appear as \u0026 in the cURL output. This is normal JSON encoding behavior and does not affect the validity of the URL. The URL will function correctly when used, as JSON parsers automatically decode these escape sequences. If you’re parsing the response programmatically, your JSON parser will handle this conversion automatically.

Code Samples

  • CURL
curl --location --request POST 'https://api.pdf.co/v1/file/hash'
--header 'x-api-key: *******************'
--data-raw '{
    "url": "pdfco-test-files.s3.us-west-2.amazonaws.compdf-split/sample.pdf"
}'