API authentication reference for the Hey Chocolate GraphQL API.
Authentication header
Include your API key in the X-API-Key header:
curl -X POST https://api.heychocolate.com/graphql \ -H "Content-Type: application/json" \ -H "X-API-Key: sk_live_your_key_here" \ -d '{"query": "{ me { id name tier } }"}'
Verifying your key
query { me { id name email organization { id name tier } apiKey { prefix createdAt lastUsedAt permissions } }}
Error responses
Missing API key
{ "errors": [ { "message": "Authentication required. Provide a valid API key via the X-API-Key header.", "extensions": { "code": "UNAUTHENTICATED" } } ]}
{ "errors": [ { "message": "Your API key does not have permission to access this resource. Required tier: Growth", "extensions": { "code": "FORBIDDEN", "requiredTier": "GROWTH" } } ]}