Creating your first API key
Prerequisites
You need a ComplianceGrid account. Sign up at compliancegrid.ai/register.
Step 1: Open the Developer area
After logging in, open Dashboard → Developer → API Keys.
Step 2: Create a key
Click Sandbox Key or Production Key. A key is created for the environment you choose; there are no per-key names, permissions or rate-limit settings. Permissions come from your subscriptions: subscribe to the APIs you need under Dashboard → Developer → Subscriptions (a subscription is per API and per environment), or use Subscribe to all.
Step 3: Copy and store it securely
The key is shown once. Store it in a secrets manager or your CI/CD secrets. Keys look like this:
cg_sk_<64 hex characters> sandbox cg_pk_<64 hex characters> production
Each environment can hold at most 2 active keys at a time (a key being rotated counts until its grace period ends).
Step 4: Make your first call
curl -H "x-api-key: $CG_API_KEY" \ "https://sandbox.api.compliancegrid.ai/v1/hs/search?q=laptop"
A 200 response means the key works. A 401 invalid_api_key means the key is wrong or revoked; a 403 not_subscribed means you have not subscribed to that API in this environment.
Key management
- Rotate with the rotate endpoint (see *Rotating API keys without downtime*)
- Never commit keys to source control
- Monitor usage under Dashboard → Developer → Usage
Was this article helpful?