Tokens

Gofer API Token


List all Gofer API tokens

GET/api/tokens

This endpoint is restricted to admin tokens only.

Responses

StatusBodyDescription
200ListTokensResponsesuccessful operation
4XXErrorError
5XXErrorError

Create a new token

POST/api/tokens

This endpoint is restricted to admin tokens only.

Request body (required): CreateTokenRequest

Responses

StatusBodyDescription
201CreateTokenResponsesuccessful creation
4XXErrorError
5XXErrorError

Create root admin token

POST/api/tokens/bootstrap

This endpoint can only be hit once and will create the root admin token, from which all other tokens can be created.

Responses

StatusBodyDescription
201CreateTokenResponsesuccessful creation
4XXErrorError
5XXErrorError

Start a browser sign in

POST/api/tokens/web-login

Returns a short lived, single use code that a browser can trade for the calling token, so the CLI can open the web UI already signed in without ever putting the token itself in a URL.

Responses

StatusBodyDescription
201CreateWebLoginResponsesuccessful creation
4XXErrorError
5XXErrorError

Finish a browser sign in

POST/api/tokens/web-login/exchange

Trades a code from create_web_login for the token that created it. Each code works once. The code is sent in the body rather than the path so it stays out of request logs.

Request body (required): ExchangeWebLoginRequest

Responses

StatusBodyDescription
200ExchangeWebLoginResponsesuccessful operation
4XXErrorError
5XXErrorError

Get api token who made the request

GET/api/tokens/whoami

Responses

StatusBodyDescription
200WhoAmIResponsesuccessful operation
4XXErrorError
5XXErrorError

Get api token by id

GET/api/tokens/{id}

Path parameters

NameTypeRequiredDescription
idstringyesThe unique identifier for the target namespace.

Responses

StatusBodyDescription
200GetTokenByIDResponsesuccessful operation
4XXErrorError
5XXErrorError

Update a token's state

PATCH/api/tokens/{id}

Path parameters

NameTypeRequiredDescription
idstringyesThe unique identifier for the target namespace.

Request body (required): UpdateTokenRequest

Responses

StatusBodyDescription
204noneresource updated
4XXErrorError
5XXErrorError

Delete api token by id

DELETE/api/tokens/{id}

This endpoint is restricted to admin tokens only.

Path parameters

NameTypeRequiredDescription
idstringyesThe unique identifier for the target namespace.

Responses

StatusBodyDescription
204nonesuccessful deletion
4XXErrorError
5XXErrorError