Sign in by link
An agent without a key asks for one, and a person approves it in zued.
Needs no key. Rate limited per IP address.
application/json- body
client_name*Client NameThe agent's name. The person who approves the link reads it, and it names the key.
1 <= length <= 80scopes?array<>['read'] for a key that reads. Add 'write' for one that may also change actions and webhooks, and 'setup' for one that may also set up projects and start paid measurements (crawls, prompt writing, engine runs). The person who approves may grant less.
[ "read"]Successful Response
application/json- response
device_code*Device CodeSecret. Send it to POST /v1/auth/token until the key comes back.
user_code*User CodeShow it to the person: the page they approve on shows the same code.
verification_uri*Verification UriWhere the person types the user code.
verification_uri_complete*Verification Uri CompleteThe link to give the person. It carries the user code.
expires_in*Expires InSeconds until both codes expire.
interval*IntervalSeconds to wait between two polls of POST /v1/auth/token.
curl -X POST 'https://api.zued.ai/v1/auth/device' \ -H 'Content-Type: application/json' \ -d '{ "client_name": "string"}'{ "device_code": "string", "user_code": "string", "verification_uri": "string", "verification_uri_complete": "string", "expires_in": 0, "interval": 0}Needs no key. The first poll after the approval creates the key; every later poll gets invalid_grant.
application/json- body
grant_type*Grant TypeAlways urn:ietf:params:oauth:grant-type:device_code.
device_code*Device CodeThe device_code of POST /v1/auth/device.
Successful Response
application/json- response
access_token*Access TokenThe account key. Shown in this answer only: keep it. Send it as 'Authorization: Bearer zk_...' and name the project of each request in the header Zued-Project. It reaches the projects the person who approved it picked, or every project they own when they picked all, each while they own it. GET /v1/projects lists them.
token_type*Token Typescope*Scope'read', with 'write' for a key that may also change actions and webhooks and 'setup' for one that may set up projects and start measurements, space-separated. The person may grant less than the agent asked for.
curl -X POST 'https://api.zued.ai/v1/auth/token' \ -H 'Content-Type: application/json' \ -d '{ "grant_type": "string", "device_code": "string"}'{ "access_token": "string", "token_type": "Bearer", "scope": "string"}