Almost all Unprice API endpoints require authentication using an Api key. Api keys provide access to your Unprice resources.

Bearer Authentication

Authentication is performed using HTTP Bearer authentication in the Authorization header:

Authorization: Bearer unprice_live_1234567890

Example request:

curl -X GET "https://api.unprice.dev/v1/plans/getPlanVersion/{planVersionId}" \
  -H "Authorization: Bearer unprice_live_1234567890" \
  -H "Content-Type: application/json"

Security Best Practices

Never expose your api key in client-side code or include it in public repositories. For frontend applications, always use a backend server to proxy requests to the Unprice API.

Authentication Errors

If your authentication fails, you’ll receive a 401 Unauthorized or 403 Forbidden response with an error message:

{
  "meta": {
    "requestId": "req_abc123xyz789"
  },
  "error": {
    "title": "Unauthorized",
    "detail": "The provided api key is invalid or has been revoked",
    "status": 401,
    "type": "https://unprice.dev/docs/errors/unauthorized"
  }
}

Common authentication issues include:

  • Missing the Authorization header
  • Invalid key format
  • Revoked or expired api key