Skip to content

Create a CLI token

POST
/v1/cli/tokens
curl --request POST \
--url https://api.hooks.events/v1/cli/tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "CLI", "scopes": [ "example" ] }'
Media typeapplication/json
object
name
string
default: CLI >= 1 characters <= 100 characters
scopes
Array<string>
>= 1 items <= 20 items

Success

Media typeapplication/json
object
data
required
object
id
required

Resource id

string
name
required
string
createdAt
required

ISO-8601 timestamp

string
lastUsedAt
required
Any of:

ISO-8601 timestamp

string
key
additional properties
key
additional properties

Example generated

{
"data": {
"id": "example",
"name": "example",
"createdAt": "example",
"lastUsedAt": "example"
}
}

Validation error

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}

Missing or invalid credentials

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}

The credential lacks the required scope, or the workspace is not writable

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}

Rate limited

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}
X-RateLimit-Limit
integer

Requests allowed per window

X-RateLimit-Remaining
integer
X-RateLimit-Reset
integer

Seconds until the window resets