Skip to main content

Poll CLI Signup Token

GET/v1/sign_up/{cli_token}

Returns the account credentials for a minted cli_token once signup has completed, and 202 Accepted until then. The CLI calls this endpoint repeatedly after sending the user to the signup_url returned by POST /sign_up.

  • 202 Accepted. The accounts service has not propagated the user yet, or has propagated the user but not minted the first API key. Keep polling. An unknown token also returns 202, because the API does not record a token at mint time, so the CLI must set its own polling deadline.
  • 200 OK. The user and first API key exist. The API returns the credentials once. Later polls return 410 Gone.
  • 410 Gone. The token has expired or has already been claimed.

Path parameters

cli_token string

The token returned by POST /sign_up.

Response

Responses vary by status:

Success (200)

result contains the user credentials once signup is complete and Rails has propagated the user to the API.

  • result object
    • user_token string

      User-level token used to manage account resources via the api.

    • test_api_key string

      Initial test API key for the account.

    • user_id string

      Internal api user id.

Credentials are returned exactly once. Subsequent polls with the same token return 410 Gone.

Pending (202)

Signup is still in progress. Keep polling.

response.json
{
"code": 2020,
"message": "Pending",
"result": {
"status": "pending"
}
}

Expired or Claimed (410)

Token has expired or has already been claimed.

response.json
{
"code": 4100,
"message": "Token expired or already claimed"
}

The standard { result, code, message } envelope is described in the API reference.

Polling Strategy

The CLI is responsible for:

  • Polling at a reasonable interval (suggest 1–2 second backoff)
  • Implementing a polling deadline (e.g., 10 minutes)
  • Stopping when a 200, 410, or timeout occurs

The API does not record the cli_token at mint time — it only becomes known to the API once Rails propagates the user. A 202 Accepted can persist indefinitely if the user never completes signup. Set a deadline on the CLI side.