Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Guides Compliance KYC

KYC

How to verify a customer's identity, through a hosted page or the API, and how to read the result.

11 min read

Know your customer (KYC) verification confirms a customer's identity before you create an account or activate some features. This page shows how to submit documents, start verification and read the result.

You can submit documents for verification in two ways, through a hosted page or through the API. Whichever way you use, Gravv sends the outcome as a customer.kyc.status.completed or customer.kyc.status.failed webhook and records it on the customer. Get a customer returns kyc, and the status of its basic entry becomes completed or failed.

Note

Gravv bills verification to your business, at your pricing. Gravv bills a hosted start once. Starting again after a failure or an expired link gives a new link at no extra fee. Gravv bills every server-to-server start again, so do not call it in a loop. A start that Gravv refuses before submission, because a document or an associated person's KYC is missing or because the review is still running (KYC_IN_PROGRESS), is not billed.

In sandbox, every finished review completes, whatever you upload, about 3 minutes after submission. See Verify a customer in sandbox.

Required documents

Individual customers must provide a selfie and one government-issued identity document, with at least its front side:

•
Passport
•
National ID card
•
Driver's license

Business customers must provide four company documents: a certificate of incorporation, a shareholder registry, a proof of address, and a tax document. Verify the people first. Before you start verification for a business, every associated person linked to it must have basic KYC completed. Verify each person with their own customer id. Otherwise the start returns 400 ASSOCIATED_PERSONS_INCOMPLETE. The message names every person whose KYC is not completed, with their customer_id, the step they need and the call that finishes it, for example Associated person "Tunde Bakare" (customer_id 5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b) is waiting for review: ….

A money example. Adire Logistics wants to pay a 12,000.00 USD freight invoice. You verify its director Tunde first, upload the four company documents, then verify the business. With basic KYC completed, the business can open an account and, on the standard limits, move up to 50,000.00 USD a day.

Businesses with automatic verification

Gravv can set up your business so that KYC completes from the uploaded documents alone. For such a business, the hosted start returns 400 INVALID_REQUEST: this tenant uses document-based auto verification; upload required documents instead. Instead, upload the documents and call the server-to-server start, which returns {"status": "completed", "message": "KYC auto-approved for this tenant."}.

Submit through the hosted page

Use the Start KYC verification endpoint to let a customer upload their identity documents on a hosted page. The endpoint needs only the customer's id:

Basic request
curl --request POST \
--url https://api.gravv.xyz/v1/customers/kyc/start \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: 2b7c9e10-4d5f-4a6b-8c7d-0e1f2a3b4c01' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"customer_id": "c239895a-0436-4287-a37a-c2664f68d187"
}
'

The response includes the verification status and a web_url link. Share this link with the customer so they can upload their ID documents and complete a liveness check. The link is valid for one hour. If it expires, or the review fails, call the endpoint again with a new Idempotency-Key. You get a fresh link at no extra fee. The same key replays the old link. For a customer whose KYC is already completed, the response has review_status completed and no link.

A pending response looks like this:

Basic response
{
"data": {
"review_status": "pending",
"status": "success",
"web_url": "https://<verification-host>/websdk/p/…"
},
"error": null
}

Submit through the API

To submit documents through the API, Base64-encode each document, upload it with the Upload document endpoint, then call the Initiate server-to-server verification endpoint.

Upload documents

Upload each required document with the Upload document endpoint. Encode the document in Base64 and send the raw Base64 string, not a data: URI, as the content value. Upload each side of a two-sided document as its own request. The Idempotency-Key header is required.

Upload passport request
curl --request POST \
--url https://api.gravv.xyz/v1/customers/kyc/upload-document \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: 2b7c9e10-4d5f-4a6b-8c7d-0e1f2a3b4c02' \
--header 'content-type: application/json' \
--data '
{
"customer_id": "aabe0a33-6716-42e2-bbca-7abf1a8bd91c",
"metadata": {
"idDocType": "PASSPORT",
"idDocSubType": "FRONT_SIDE",
"country": "NGA",
"firstName": "John",
"lastName": "Doe",
"number": "A12345678",
"issuedDate": "2020-01-15",
"validUntil": "2030-01-15"
},
"content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAY...",
"filename": "passport_front.jpg"
}
'

A successful upload returns a confirmation:

Upload passport response
{
"data": {
"status": "success",
"customer_id": "aabe0a33-6716-42e2-bbca-7abf1a8bd91c",
"document_type": "PASSPORT",
"document_sub_type": "FRONT_SIDE",
"document_id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
"country": "NGA",
"message": "Document saved. Still required before POST /v1/customers/kyc/start-s2s: Selfie (idDocType SELFIE)."
},
"error": null
}

The message lists what is still required before you initiate verification. Once every required document is in, it reads Document saved. All required documents are uploaded; call POST /v1/customers/kyc/start-s2s with customer_id aabe0a33-6716-42e2-bbca-7abf1a8bd91c to submit them for verification. For a business whose associated persons are not all verified, it ends once every associated person's KYC is completed instead. Uploading the same type and sub-type again replaces the earlier document.

The metadata object describes the document. idDocType and idDocSubType values are uppercase, and country is a 2-letter or 3-letter uppercase ISO code.

FieldRequired forDescription
idDocTypeAll documentsDocument type. Individual customers: PASSPORT, ID_CARD, DRIVERS, SELFIE, PROOF_OF_ADDRESS, or TAX_DECLARATION. Business customers: COMPANY_DOC.
idDocSubTypeIdentity and company documentsIdentity documents: FRONT_SIDE or BACK_SIDE. COMPANY_DOC: INCORPORATION_CERT, SHAREHOLDER_REGISTRY, PROOF_OF_ADDRESS, TAX_DOCUMENT, or OTHER. Omit for SELFIE, PROOF_OF_ADDRESS and TAX_DECLARATION.
countryAll documents except SELFIEIssuing country as a 2-letter or 3-letter uppercase ISO code, such as NG or NGA.
numberPASSPORT, ID_CARD, DRIVERSDocument identification number.
validUntilPASSPORT, ID_CARD, DRIVERSExpiration date in YYYY-MM-DD format.
issuedDateOptionalIssue date in YYYY-MM-DD format.
firstNameOptionalFirst name as shown on the document.
lastNameOptionalLast name as shown on the document.
middleNameOptionalMiddle name as shown on the document.
dobOptionalDate of birth in YYYY-MM-DD format.
placeOfBirthOptionalPlace of birth as shown on the document.

Uploads follow these rules:

•
The file must be a JPEG, PNG or PDF. Gravv reads the type from the decoded content and does not check the filename extension.
•
The maximum document size is 5 MB. In sandbox, keep each file under 500 KB. Sandbox rejects requests of about 600 KB or more with a 413.
•
Gravv does not deduplicate a request body over 1 MiB under its Idempotency-Key. A file over about 770 KB makes a body that large, so a retried upload of it runs again instead of returning the first response. After a timeout, read the documents list before you upload again.
•
Gravv does not check dates on upload. The review can reject a document with a wrong date, so send dates as YYYY-MM-DD.
•
Gravv checks idDocType and idDocSubType before the other fields. An unknown type, or a sub-type that doesn't fit the type, returns 400 INVALID_DOCUMENT_TYPE with the accepted values.
•
A document that belongs on another customer returns 400 DOCUMENT_TYPE_NOT_ALLOWED, which says where it goes. Upload a person's identity documents with the associated person's id, and company documents with the business's id.
•
Once the customer's KYC is completed, an upload returns 409 KYC_ALREADY_COMPLETED, and the stored documents stay as they are. A pending or failed KYC still accepts uploads.

A business customer uploads four company documents. Each uses idDocType COMPANY_DOC, with one of the sub-types INCORPORATION_CERT, SHAREHOLDER_REGISTRY, PROOF_OF_ADDRESS, and TAX_DOCUMENT (or OTHER). Gravv refuses REGISTRATION_CERTIFICATE with 400 INVALID_DOCUMENT_TYPE. This request uploads the certificate of incorporation:

Upload certificate of incorporation request
curl --request POST \
--url https://api.gravv.xyz/v1/customers/kyc/upload-document \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: 2b7c9e10-4d5f-4a6b-8c7d-0e1f2a3b4c03' \
--header 'content-type: application/json' \
--data '
{
"customer_id": "c84d9a52-2978-43e5-9b86-eac9839e1147",
"metadata": {
"idDocType": "COMPANY_DOC",
"idDocSubType": "INCORPORATION_CERT",
"country": "NGA"
},
"content": "JVBERi0xLjcKJ...",
"filename": "certificate_of_incorporation.pdf"
}
'

Repeat the request with a new Idempotency-Key for SHAREHOLDER_REGISTRY, PROOF_OF_ADDRESS and TAX_DOCUMENT.

Initiate verification

After you upload all required documents, call the Initiate server-to-server verification endpoint with the customer's id:

Initiate verification request
curl --request POST \
--url https://api.gravv.xyz/v1/customers/kyc/start-s2s \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: 2b7c9e10-4d5f-4a6b-8c7d-0e1f2a3b4c04' \
--header 'content-type: application/json' \
--data '
{
"customer_id": "aabe0a33-6716-42e2-bbca-7abf1a8bd91c"
}
'

Gravv starts the review and sends the outcome as a webhook. Gravv bills each call, except one it refuses before submission. Call it once, and again only after you replace what a rejection named.

For a pending verification, the API returns:

Initiate verification response
{
"data": {
"status": "pending",
"message": "KYC verification initiated. Status will be updated via webhook."
},
"error": null
}

Errors on the KYC endpoints are strings that start with a code. If a step is missing, the code names it, and the message names the customer and the call that fixes it. If a required document is missing, the request fails with HTTP 400 DOCUMENTS_MISSING, and the message lists only what is missing:

Missing documents response
{
"data": null,
"error": "DOCUMENTS_MISSING: customer aabe0a33-6716-42e2-bbca-7abf1a8bd91c is missing required documents: Identity document (idDocType PASSPORT, ID_CARD or DRIVERS with idDocSubType FRONT_SIDE), Selfie (idDocType SELFIE). Upload them with POST /v1/customers/kyc/upload-document using customer_id aabe0a33-6716-42e2-bbca-7abf1a8bd91c, then call POST /v1/customers/kyc/start-s2s."
}

The other answers that stop a start:

ResponseWhenWhat to do
400 DOCUMENTS_MISSING on a businessCompany documents are missing. The message lists them, for example Certificate of Incorporation (idDocType COMPANY_DOC, idDocSubType INCORPORATION_CERT)Upload them with the business's id
400 ASSOCIATED_PERSONS_INCOMPLETEA business has associated persons whose KYC is not completed. The message names each person, with their customer_id and next step, and lists any company documents still missingFinish each person's step and upload what is named, then start the business
409 KYC_IN_PROGRESSYou started again while the review of the earlier submission is running. Gravv does not bill this callWait for the webhook, or poll the status
400 SUBMISSION_INCOMPLETEThe review refused the submission. The message gives the reason, and KYC stays unsubmittedUpload what the message asks for, then start again
400 DOCUMENT_REJECTEDThe review refused one uploaded file. The message names it, with its document_id and the reasonUpload a corrected file with the same idDocType, then start again
409 KYC_ALREADY_COMPLETED: KYC verification has already been completed for this customer.The customer's KYC is already completedNo action is needed
500 failed to upload documents to verification providerSending the documents failed. KYC stays unsubmittedRetry with the same Idempotency-Key

Outside a running review, a repeat start submits again and is billed again, for example while the review waits for more documents. Gravv replays a 4xx response for 24 hours under its Idempotency-Key, so after you fix the step, start again with a new key.

Verification through the API records no liveness check. A customer verified this way completes a liveness step later if they apply for a card.

Check verification status

The final decision is the customer's basic KYC entry, or the customer.kyc.status.* webhook. To see where the review stands in the meantime, call the Get applicant verification status endpoint.

Before any verification is submitted, the endpoint returns 404 KYC_NOT_INITIATED, and the message names the calls to make. A customer verified by automatic document verification has no review, so the endpoint returns 404 KYC_ALREADY_COMPLETED. Read that customer's basic entry with Get a customer instead.

While the review is in progress, the value of the reviewStatus field is pending and there's no reviewResult field:

Pending status response
{
"data": {
"reviewStatus": "pending",
"priority": 0
},
"error": null
}

Once the review finishes, reviewStatus is completed and reviewResult holds the decision:

Approved status response
{
"data": {
"reviewStatus": "completed",
"reviewResult": {
"reviewAnswer": "approved"
},
"reviewDate": "2026-06-19 21:59:00+0000",
"priority": 0
},
"error": null
}

A rejected review lists the reason codes in rejectLabels, and reviewRejectType shows whether the customer can resubmit:

Rejected status response
{
"data": {
"reviewStatus": "completed",
"reviewResult": {
"reviewAnswer": "rejected",
"rejectLabels": [
"BAD_SELFIE",
"SCREENSHOTS",
"UNSATISFACTORY_PHOTOS"
],
"reviewRejectType": "RETRY"
},
"reviewDate": "2026-06-19 20:44:19+0000",
"priority": 0
},
"error": null
}

The status data object contains:

•
reviewStatus: pending while the review is in progress, or completed once a decision is returned.
•
reviewResult: the decision, present once the review is completed.
◦
reviewAnswer: approved or rejected.
◦
rejectLabels: reason codes for a rejection, present only when reviewAnswer is rejected.
◦
reviewRejectType: the rejection category, such as RETRY, present only when reviewAnswer is rejected.
•
reviewDate: the decision timestamp, present once the review is completed.
•
priority: the applicant's review priority.

Get uploaded documents

To see which documents a customer has uploaded, call the Get KYC document data endpoint. It returns the metadata for each uploaded document, newest first:

Uploaded documents response
{
"data": {
"customer_id": "aabe0a33-6716-42e2-bbca-7abf1a8bd91c",
"documents": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"IDType": "PASSPORT",
"IDSubType": "FRONT_SIDE",
"IDNumber": "A12345678",
"IssuingCountry": "NGA",
"IssuedDate": "2020-01-01",
"ExpiryDate": "2030-01-01",
"has_front_image": true,
"has_back_image": false,
"OriginalFilename": "passport_front.jpg"
}
],
"count": 1
},
"error": null
}
Warning

IDNumber is the full document number, in plain text. Do not log it, and show it only to people allowed to see identity data.

•
For a customer with no uploaded documents, the call returns 404 no KYC document data found for customer, not an empty list. Treat it as "no documents".
•
A two-sided ID is two rows, one FRONT_SIDE and one BACK_SIDE.
•
To get a document's image or PDF, see Download KYC documents.
Was this page helpful? Yes No