Skip to content

Upload document

POSThttps://api.gravv.xyz/v1/customers/kyc/upload-document

Upload a KYC document for individual and business customers. This is the first step of the server-to-server verification flow.

Documents are uploaded as base64-encoded strings along with metadata about the document type, customer information, and document details. The document is validated and stored in preparation for verification.

Supported document types

Individual customers must upload a SELFIE and one identification document: PASSPORT, ID_CARD, or DRIVERS.

Business customers upload a single REGISTRATION_CERTIFICATE, which may be a formation document or an ownership document. The idDocType value is always REGISTRATION_CERTIFICATE.

All idDocType values are uppercase.

Selfie documents must be an image (JPEG or PNG); PDF selfies are rejected.

Document subtypes

Identification documents use idDocSubType to indicate which side is uploaded (case-sensitive, uppercase):

  • FRONT_SIDE: Front side of document

  • BACK_SIDE: Back side of document (if applicable)

Omit idDocSubType for SELFIE uploads.

File format

The filename extension and the decoded content MIME type must agree and must be one of: image/jpeg, image/png, application/pdf.

Size limits

The maximum decoded document size is 10 MB.

Idempotency

The Idempotency-Key header is required on this endpoint. If you send the same key again with an identical request body, the API returns the original response instead of uploading the document a second time. If you send the same key with a different request body, then the API rejects the request with a 422.

After uploading all required documents, call the Initiate KYC S2S endpoint to start the verification process.

Body Params

  • customer_idstringrequired

    ID of the customer this document belongs to

  • metadataobjectrequired
  • contentstringrequired

    Base64-encoded document content. The decoded bytes must be a JPEG, PNG, or PDF; the service sniffs the leading bytes and rejects other MIME types. Maximum decoded size is 10 MB.

  • filenamestringrequired

    Original filename of the document. Extension must be one of .jpg, .jpeg, .png, .pdf (case-insensitive); the file extension is validated before the content MIME sniff.

Headers

  • Idempotency-Keystringrequired

    Unique key to dedupe retries. Required on this endpoint; 1–255 ASCII printable characters. Missing or malformed keys return 400.

Responses

Language
curl --request POST \
--url 'https://api.gravv.xyz/v1/customers/kyc/upload-document' \
--header 'Api-Key: <Api Key>' \
--header 'Idempotency-Key: kyc-upload-customer-b4e52d51-attempt-1' \
--header 'accept: application/json' \
--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.jpg"
}'
{
"data": {
"status": "success",
"customer_id": "b84d9a52-2978-43e5-9b86-eac9839e1146",
"document_type": "PASSPORT",
"country": "NGA",
"message": "Document saved. Use /start-s2s to submit for verification."
},
"error": null
}