Download certificate source document

Prev Next
Get
/v1/sessions/{id}/certificates/{certificateId}/files/{fileId}

Returns the source document file that a certificate attests to

When to use this endpoint

  • Use this endpoint to download a source document referenced by a certificate's sourceDocuments array
  • The document is the artefact whose integrity the certificate preserves (for example the generated session data PDF)
  • The certificateId and fileId values must be obtained first from GET /v1/sessions//certificates
  • This endpoint is currently available as part of the Mexico - NOM-151 Certification solution

Getting the identifiers

  1. Call GET /v1/sessions//certificates to retrieve the session certificates
  2. Find the certificate id (the certificateId) and the sourceDocuments[].id (the fileId) of the document you want to download
  3. Use both identifiers to download the file with this endpoint

Response data

  • The endpoint returns a binary file with the application/pdf Content-Type
  • The file is returned as binary data in the response body

Implementation notes

  • This endpoint requires session-level HMAC signature authentication
  • Set appropriate Content-Type handling in your HTTP client to receive binary data
  • Always ensure that you use the correct API URL to send requests. See the API URL section for more info
  • The order of parameters in the real API response can differ from the order you see in this documentation. This is expected and part of the Backwards compatible changes requirements

How to store response data to file?

import requests

file_url = 'https://example-base-url/v1/sessions/d69a07cf-4434-4d36-be6c-d22af7dc01fb/certificates/27d303bb-6a1f-4c2e-9b1d-2f3a4b5c6d7e/files/a6a27f7a-3c4d-4e5f-8a9b-0c1d2e3f4a5b'

headers = {
    'X-AUTH-CLIENT': 'your-api-key',
    'X-HMAC-SIGNATURE': '452bfca0e02f8ee0f56d97373cc6971067e43149f1b7e58b681d4e57353a2f6b',
    'Content-Type': 'application/json',
}

response = requests.get(file_url, headers=headers)
with open('certificate_source_document.pdf', 'wb') as write_file:
    write_file.write(response.content)
Header parameters
X-AUTH-CLIENT
stringRequired

Your integration's API key (occasionally referred to as the "Token", "API public key" or "Publishable key"). Required for all API requests.

You can find your API key in the Veriff Customer Portal > Settings > API keys.

Exampleyour-api-key
X-HMAC-SIGNATURE
stringRequired

Session ID signed with the shared secret key. Required to authenticate the request sender.

Examplea1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
Path parameters
id
string (uuid) Required

Verification session ID.

Exampled69a07cf-4434-4d36-be6c-d22af7dc01fb
certificateId
string (uuid) Required

Certificate ID, obtained from the session certificates list.

Example27d303bb-6a1f-4c2e-9b1d-2f3a4b5c6d7e
fileId
string (uuid) Required

Source document ID, obtained from a certificate's sourceDocuments array.

Examplea6a27f7a-3c4d-4e5f-8a9b-0c1d2e3f4a5b
Responses
200

Certificate source document file

Headers
Content-Type
string
MIME type of the file being returned.
Valid values[ "application/pdf" ]
Exampleapplication/pdf
X-AUTH-CLIENT
string
API key echoed back in response.
Exampleyour-api-key
X-HMAC-SIGNATURE
string
Response body signed with the shared secret key. Required to authenticate the response sender.
Examplea1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
string (binary)
401

Unauthorized

Headers
Content-Type
string
Response content type.
Exampleapplication/json
X-AUTH-CLIENT
string
API key echoed back in response.
X-HMAC-SIGNATURE
string
Response body signed with the shared secret key.
{
  "status": "fail",
  "code": "1101",
  "message": "Mandatory X-AUTH-CLIENT header containing the API key is missing from the request."
}
object
status
string
Valid values[ "fail" ]
Examplefail
code
string
Example1101
message
string
ExampleMandatory X-AUTH-CLIENT header containing the API key is missing from the request.
404

Certificate file not found

Headers
Content-Type
string
Response content type.
Exampleapplication/json
X-AUTH-CLIENT
string
API key echoed back in response.
X-HMAC-SIGNATURE
string
Response body signed with the shared secret key.
{
  "status": "fail",
  "code": "1101",
  "message": "Certificate file not found"
}
object
status
string
Valid values[ "fail" ]
Examplefail
code
string
Example1101
message
string
ExampleResource not found
500

Internal server error

Headers
Content-Type
string
Response content type.
Exampleapplication/json
X-AUTH-CLIENT
string
API key echoed back in response.
X-HMAC-SIGNATURE
string
Response body signed with the shared secret key.
{
  "status": "fail",
  "code": "1101",
  "message": "Something went wrong"
}
object
status
string
Valid values[ "fail" ]
Examplefail
code
string
Example1101
message
string
ExampleSomething went wrong

Changelog

Date

Description

Sep 4, 2026

Documentation created