Create an API key
Go from a new account to a successful GET /v1/companies/me with curl in a few minutes.
This is the shortest path from a new Avaloi account to an authenticated API call. You need a verified email and a company. You do not need a site.
Create the key
- Sign in at my.avaloi.com. If you do not have an account, create one and verify the email.
- Open Company settings and choose API keys. Developers, Admins, and Owners can create keys.
- Choose Create API key. Name it
curl test. Ticksites:readonly. Keys expire in 90 days unless you pick another expiry date. Choose Create key. - Copy the key now. The same dialog shows it once. It starts with
hk_live_(orhk_test_on preview and staging). Avaloi emails you that a key was created. The list shows the prefix, not the secret.
Call the API
Replace the placeholder with your secret.
curl -s https://api.avaloi.com/v1/companies/me \
-H "Authorization: Bearer hk_live_YOUR_SECRET"
A working call returns 200 and JSON with your company id, name, slug, plan (null until plans can be bought), and created_at.
Try it in the reference
Open the API reference tab. Pick Current company. Paste the same secret as a bearer token and send. You see the same JSON.
If the call fails
| Status | Meaning | What to do |
|---|---|---|
| 401 | Missing, unknown, or revoked key | Copy the secret again from a new key. Revocation takes effect within 5 seconds. |
| 403 | Key lacks the scope | GET /v1/companies/me works with sites:read. Invites need users:write. |
| 429 | Rate limit | Wait for Retry-After. The limit is 600 requests per minute per key. |
The activity log shows the call under the key name, curl test. Revoke the key from its three dot menu in the same list when you are done.
Quick answers
Which scopes do I need to create a site?
sites:write. See API keys and scopes.
I lost the secret. Revoke the key and create a new one.
API
POST /v1/api-keysGET /v1/api-keys/currentGET /v1/companies/meDELETE /v1/api-keys/{id}
Related
Still stuck?
Email [email protected] with your site name and what you tried, or send us a message.