Authentication
API Keys
Every request to the Gravv API requires an Api-Key. After creating a Gravv account, we generate two pairs of API Keys for you: a publishable Public Key and a server-side Secret Key, for both Sandbox and Live modes.
To regenerate your API keys, click Rotate API Key in your Dashboard. Ensure you rotate your keys regularly to maintain security and prevent unauthorized access.
Keep your API keys secure and don't share them in GitHub repositories, client-side code, or any environment accessible to others.
Also, send all requests over HTTPS to protect sensitive data. Requests without valid authorization return a 401 Unauthorized response.
Obtain and use your API Keys
To obtain your API Key, follow these steps:
- Sign in to your Gravv Dashboard with your registered business email address.
- Toggle
Sandboxmode on for testing, orProductionfor live. - Click
Managein the side navigation. - Click
Configureunder the Manage section. - Now click
API keys, then click the copy button underSecret Keyto copy your Secret Key, or underPublic Keyto copy your Public Key. - Include the API Key in your request header:
curl -X POST https://api.gravv.xyz/v1/customers \
-H "Api-Key: <Api Key>" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Bode",
"last_name": "Thomas",
"middle_name": "Olaoye",
"email": "[email protected]",
"phone": "+2348069867745",
"type": "individual",
"gender": "male",
"date_of_birth": "2024-04-16",
"address": {
"address_line1": "Same Global Housing Estate",
"city": "Lokogoma",
"country": "NG",
"postal_code": "900107",
"state": "NG-FC"
}
}'
Webhooks
For webhooks, you need to create them and generate their Secret Key:
- Follow steps 1 through 3 in Obtain and use your API Keys.
- Click
Webhooksin the Dashboard. - Click
Create Webhookto open the form. - Enter your webhook endpoint in the
Webhook URLfield. - Click
Generateto create your webhookSecret Key.
You can regenerate your Secret Key at any time by clicking Rotate API Key in your Dashboard.
Updated 2 months ago
