- Documentation
- »Developers
- »Authentication
Authentication
API Keys
Learn how to create and manage API keys. The same key works on both the REST API and the GraphQL API.
Creating an API Key
- Navigate to your account settings
- Click on "API Keys" in the sidebar
- Click "Generate New Key"
- Copy and store your key securely — you will not be able to see this again so make a note
A key is created in one workspace — either your personal workspace or a single Organisation. A key created against an Organisation acts as one of that Organisation's owner accounts — an arbitrary one if it has several, and not necessarily the same one after the owners change.
On the REST API the key is the workspace: there is no workspace parameter on any endpoint, and an Organisation key reaches that Organisation and nothing else.
On the GraphQL API the workspace is an argument you pass. Queries return the acting account's personal workspace unless you explicitly ask for the Organisation's data with organisationId, and a key can reach any workspace the account it acts as belongs to — so choose the organisationId you want rather than assuming the key confines you to one. See Workspaces for how to do that.
Create separate keys per integration if you want to revoke them independently.
Using API Keys
Include your API key in the Authorization header:
Authorization: Bearer your-api-key-here
Testing Your API Key
You can test your API key by fetching your user account information:
curl -X POST https://audioaudit.io/api/graphql \
-H "Authorization: Bearer your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"query": "query { user { id email firstName lastName } }"
}'
You should see a GraphQL response with an id, email, firstName and lastName. For a personal key that is your own account; for an Organisation key it is one of the accounts that owns the Organisation.
Once that works, head to the GraphQL API page for the queries that list your podcasts and reports.
Security Best Practices
- Never expose API keys in client-side code
- Rotate keys regularly
- Use different keys for different environments and applications