Gravv docs
Docs Agent Sign in Get API keys

Download a KYC document

Returns one side of a stored document as a data URI. Get the document_id from the documents list. A two-sided card is two documents. Read the back image of the BACK_SIDE document with side=back.

Responses can be large, up to about 13 MB. A scoped API key needs the customer:update permission.

GEThttps://api.gravv.xyz/v1/customers/{customer_id}/kyc/documents/{document_id}/download

Path Parameters

UUID of the customer

UUID of the KYC document, from the documents list

Query Parameters

Which image to return

Possible values: front, back

Responses

Status Description
200 The document image
400 Invalid parameters
404 Customer, document or image not found
500 The image could not be read
503 Storage is not configured. Retry later.

200 response

The image as a data URI, data:<content_type>;base64,.... Upload takes plain base64, and download returns a data URI.

File type of the stored image

Possible values: image/jpeg, image/png, application/pdf

Stored object name. This is not the file name you uploaded.

Which side was returned

Possible values: front, back

ID of the document

Size of the decoded file in bytes

{
"data": {
"content": "data:image/png;base64,iVBORw0KGgo...",
"content_type": "image/png",
"filename": "3f9a6b2c1d.png",
"side": "front",
"document_id": "550e8400-e29b-41d4-a716-446655440000",
"size_bytes": 45230
},
"error": null
}

400 response

Always null for error responses

Error message. Most messages start with an upper-case code and a colon, such as INVALID_REQUEST: ....

{
"data": null,
"error": "side is required (front or back)"
}
{
"data": null,
"error": "side must be \"front\" or \"back\""
}
{
"data": null,
"error": "invalid document_id format"
}

404 response

Always null for error responses

Error message. Most messages start with an upper-case code and a colon, such as INVALID_REQUEST: ....

{
"data": null,
"error": "document not found"
}
{
"data": null,
"error": "no back image available for this document"
}

500 response

Always null for error responses

Error message. Most messages start with an upper-case code and a colon, such as INVALID_REQUEST: ....

{
"data": null,
"error": "failed to download document image"
}

503 response

Always null for error responses

Error message. Most messages start with an upper-case code and a colon, such as INVALID_REQUEST: ....

{
"data": null,
"error": "storage service not configured"
}

Authorization

  • ApiKeyAuth
Was this page helpful?
ESC