Skip to main content

Authentication & Authorization

Valydar uses API keys for authentication. All requests must include your key in the Authorization header using the Bearer scheme.

Getting an API Key

Contact support@valydar.com to request a sandbox or production API key. You can also create additional keys via the Admin API.

Using Your Key

Include the key in the Authorization: Bearer header:

curl -X GET https://api.dev.valydar.com/health \
-H "Authorization: Bearer YOUR_API_KEY"

API Key Roles

Every API key has a role that determines which endpoints it can access. See Authorization & Roles for the full permission matrix.

RoleDescription
adminFull access to all endpoints, including key management
serviceCan create/read verifications, upload documents, run checks
readonlyCan only read verification results
auditorCan read verifications and view admin/key listings

If your key doesn't have permission for an endpoint, the API returns 403 Forbidden:

{
"error": {
"code": "forbidden",
"message": "insufficient permissions: service requires keys:create"
}
}

Security Best Practices

  • Never expose API keys in client-side code
  • Store keys in environment variables or a secrets manager
  • Use separate keys for sandbox and production
  • Assign the least-privileged role needed
  • Rotate keys regularly
  • Revoke unused keys via DELETE /admin/keys/{id}

Environment Variables

export VALYDAR_API_KEY="your-api-key-here"
curl -X POST https://api.dev.valydar.com/verifications \
-H "Authorization: Bearer $VALYDAR_API_KEY"

Rate Limits

Rate limits are per API key:

TierRequests/min
All environments100

Exceeding the rate limit returns a 429 Too Many Requests response with error code rate_limit_exceeded.

Errors

StatusMeaning
401Missing or invalid API key
403API key doesn't have permission (insufficient role)
429Rate limit exceeded