Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
KYC Upload a KYC document

Upload a KYC document

Stores one document file for a customer. This is step 1 of server-to-server verification. Upload each document, and each side of a two-sided card, in a separate call. Nothing is sent for review until you call `POST /v1/customers/kyc/start-s2s`.

POSThttps://api.gravv.xyz/v1/customers/kyc/upload-documentTry it
Api-Key

Stores one document file for a customer. This is step 1 of server-to-server verification. Upload each document, and each side of a two-sided card, in a separate call. Nothing is sent for review until you call POST /v1/customers/kyc/start-s2s.

Individual and UBO customers need one identity document (PASSPORT, ID_CARD or DRIVERS) with FRONT_SIDE, plus a SELFIE. Identity documents also need country, number and validUntil. A selfie must be a JPEG or PNG.

Business customers use idDocType: COMPANY_DOC for every file and set idDocSubType to INCORPORATION_CERT, SHAREHOLDER_REGISTRY, PROOF_OF_ADDRESS and TAX_DOCUMENT (or OTHER).

Gravv checks idDocType and idDocSubType before the other metadata. An unknown type, REGISTRATION_CERTIFICATE, or a subtype that doesn't fit the type returns 400 INVALID_DOCUMENT_TYPE with the accepted values. A type that belongs on another customer returns 400 DOCUMENT_TYPE_NOT_ALLOWED, which says where it goes. A person's documents go on their associated person, and company documents go on the business.

The response message lists the documents still required before POST /v1/customers/kyc/start-s2s, or says that all are uploaded and which call to make next.

Uploading the same type and subtype again replaces the earlier file. Once the customer's KYC is completed, uploads return 409 KYC_ALREADY_COMPLETED. A KYC that is not started, pending or failed still accepts uploads. On tenants with automatic document verification, the upload that completes the required set also completes KYC.

Headers

NameDescription
Idempotency-Key:stringRequired
Required for POST requests. 1 to 255 printable ASCII characters. A retry with the same key and body within 24 hours returns the first response.

Body parameters

NameDescription
customer_id:stringRequired
ID of the customer this document belongs to
metadata:objectRequired
Show 11 child attributesobject
content:stringRequired
The file as plain standard base64, with no data: prefix. The decoded file must be a JPEG, PNG or PDF. The service checks the file bytes, not the name. The maximum decoded size is 5 MB. In sandbox, keep files under about 500 KB.
filename:stringRequired
Name of the file. The extension is not checked. The content decides the file type.

Response

Returns 200 OK. Document stored

NameDescription
data:objectRequired
Show 8 child attributesobject
error:nullRequired

Errors

StatusMeaning
200Document stored
400Invalid request, or a document type that is unknown or belongs on another customer
404Customer not found
409The customer's KYC is already completed, so its documents can't be replaced, or a request with the same Idempotency-Key is still running.
413The file or the request body is too large.
422The Idempotency-Key was used before with a different body.
500The document could not be stored
503The service is not configured or not reachable. Retry later.
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request POST \
--url 'https://api.gravv.xyz/v1/customers/kyc/upload-document' \
--header 'Api-Key: <api-key>' \
--header 'Idempotency-Key: kyc-start-b84d9a52-attempt-1' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "b84d9a52-2978-43e5-9b86-eac9839e1146",
"metadata": {
"idDocType": "PASSPORT",
"idDocSubType": "FRONT_SIDE",
"country": "USA",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"issuedDate": "2020-01-15",
"validUntil": "2030-01-15",
"number": "A12345678",
"dob": "1990-05-20",
"placeOfBirth": "New York, NY"
},
"content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"filename": "passport_front.png"
}'
Responseapplication/json
200400404409413422500503OK
{
"data": {
"status": "success",
"customer_id": "b84d9a52-2978-43e5-9b86-eac9839e1146",
"document_type": "PASSPORT",
"document_sub_type": "FRONT_SIDE",
"document_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
"country": "USA",
"message": "Document saved. Still required before POST /v1/customers/kyc/start-s2s: Selfie (idDocType SELFIE)."
},
"error": null
}