What changed
A project key is an application. That makes it safe to leave lying around, but it also means it cannot create the next project, so starting one used to mean opening the dashboard, minting a key, and pasting it back. Account tokens are the other half. They represent you rather than one project, so an agent holding one can create an application and deploy to it without a browser.The flow
1
Ask for a code
2
Show the user the link
Print
verificationUriComplete and userCode. The link already carries
the code, so nothing has to be typed.Showing the code anyway is what makes the prompt safe: someone who arrived
from a link they did not generate can see it does not match their own
terminal, and refuse.3
Poll while they approve
interval seconds. Until someone approves, you get 400 with
error: "authorization_pending", which means keep waiting.4
Store the token
Approval returns
200 with the token. Codes are single use: a second poll
for the same deviceCode returns expired_token.Create a project
applicationId to .antideploy.json in the project. It holds no secret,
so it can be committed, and a teammate who clones the repository deploys to the
same application without configuring anything.
A name you already have returns
409 with code: "name_taken" and the
existing applicationId, so a script that runs twice reuses the project
rather than leaving a trail of near-duplicates.Deploy
An account token is entitled to many applications, so it has to say which one:applicationId goes in the query string rather than the form so a 404 or a
409 costs you a header instead of a finished upload of the whole project.
The same applies to /api/v1/secrets. Project keys are unaffected: they still
identify their own application and still send no id.
What it cannot do
An account token is more powerful than a project key, so it is deliberately fenced:- It cannot read secret values back. No endpoint returns one, for any credential.
- It cannot delete an application. That needs the dashboard.
- It cannot mint another account token. A credential that can clone itself cannot be revoked, because the holder just makes a replacement faster than you can kill them.
Revoking
Open Account tokens in the dashboard and revoke it. It stops working immediately, because revocation is checked on every request rather than cached, and the terminal that held it logs in again with one approval.Revoking is a browser action, deliberately. An account token cannot revoke
anything, including itself: a stolen credential that could kill the legitimate
ones would leave the thief as the only holder.
Deploy over the API
The full push reference.