Get started
Authentication
Authenticate every request with an API key that belongs to your organization.
Every request carries an API key in the Authorization header.
Authorization: Bearer vk_live_YOUR_KEYA key belongs to one organization, so you never send an organization header. Valeron reads the organization from the key.
#Create a key
Only the Owner of the organization (or an Individual, who owns their own account) can create, list and revoke keys.
- Sign in to the Valeron app and open Settings › Developers.
- Create a key: give it a name and pick its scopes.
- Copy the key now. It is shown once.
A key looks like vk_live_ followed by 40 random characters. Valeron stores only a hash of it and its first 12 characters (such as vk_live_abcd), which is what the list in Settings shows. If you lose a key, revoke it and create another.
Keep keys on your server. Put them in an environment variable or a secrets manager. Never ship one in browser code, a mobile app or a public repository.
#Who the request acts as
A request made with a key acts as the person who created it, with that person's role. Every rule that applies to that person applies to the key, and the key's scopes narrow it further. History entries name that person, and records written through the API carry the source api.
If the person who created a key stops being the Owner (or the Individual) of the organization, the key stops working and returns 401 api_key_revoked.
#Scopes
Each key has a list of scopes. A route that needs a scope the key does not have returns 403 missing_scope, and the error names the scope. The full access scope is ["*"]. See Scopes for the list.
#What keys cannot do
Keys reach only the public routes in the API reference. Any other route refuses every key with 403 not_available_with_api_key. Keys are managed with a signed-in session only, never with another key, so there is no API route for creating or listing keys.
#Revoke a key
Open Settings › Developers and revoke the key. A revoked key stays in the list so you can see it existed, and it can never be used again. Requests that use it return 401 api_key_revoked.
#Authentication errors
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthenticated | The key is missing or Valeron does not know it. |
| 401 | api_key_revoked | The key was revoked, or its creator is no longer the Owner. |
| 403 | missing_scope | The key does not have the scope the route needs. |
| 403 | not_available_with_api_key | The route is not part of the public API. |
See Errors for the full error shape.
