Skip to Content
zued

Sign in by link

An agent without a key asks for one, and a person approves it in zued.

POST
/auth/device

Needs no key. Rate limited per IP address.

Request Body

application/json
  1. body
client_name*Client Name

The agent's name. The person who approves the link reads it, and it names the key.

Length1 <= length <= 80
scopes?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.

Default
[  "read"]

Response Body

Successful Response

application/json
  1. response
device_code*Device Code

Secret. Send it to POST /v1/auth/token until the key comes back.

user_code*User Code

Show it to the person: the page they approve on shows the same code.

verification_uri*Verification Uri

Where the person types the user code.

verification_uri_complete*Verification Uri Complete

The link to give the person. It carries the user code.

expires_in*Expires In

Seconds until both codes expire.

interval*Interval

Seconds to wait between two polls of POST /v1/auth/token.

Example Request
curl -X POST 'https://api.zued.ai/v1/auth/device' \  -H 'Content-Type: application/json' \  -d '{  "client_name": "string"}'
Example Response
{  "device_code": "string",  "user_code": "string",  "verification_uri": "string",  "verification_uri_complete": "string",  "expires_in": 0,  "interval": 0}
POST
/auth/token

Needs no key. The first poll after the approval creates the key; every later poll gets invalid_grant.

Request Body

application/json
  1. body
grant_type*Grant Type

Always urn:ietf:params:oauth:grant-type:device_code.

device_code*Device Code

The device_code of POST /v1/auth/device.

Response Body

Successful Response

application/json
  1. response
access_token*Access Token

The 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 Type
scope*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.

Example Request
curl -X POST 'https://api.zued.ai/v1/auth/token' \  -H 'Content-Type: application/json' \  -d '{  "grant_type": "string",  "device_code": "string"}'
Example Response
{  "access_token": "string",  "token_type": "Bearer",  "scope": "string"}