API keys
API keys let the CLI, CI jobs, and your own scripts use the velixir API.
Create one
In the dashboard, open API keys and create a key. You choose:
- Permission - Read (view apps, releases, and deployments), Write (create, deploy, and change things), or Read + Write. Deploying needs Write or Read + Write.
- Scope - Account (every project and app in the team), Project (one project and its apps), or App (a single app). Give CI the narrowest scope that works.
- Expiry - optional.
The key is shown once, so store it straight away, in your CI's secrets or a password manager.
velixir login makes a key for you after you approve the sign-in in your browser, so you only need to create one by hand for CI or scripts.
Use it
Send the key in the X-Api-Key header:
curl -H "X-Api-Key: $VELIXIR_API_KEY" https://velixir.net/api/v1/apps
The CLI reads it from the VELIXIR_API_KEY environment variable, or from ~/.velixir/config.json after velixir login. Every endpoint is in the API reference.
Keys belong to one team
A key works against the team it was created in, whatever team you have selected in the dashboard. Working with two teams means a key for each.
Revoke a key
Click Revoke next to the key on the API keys page. Anything still using it stops working straight away.