Skip to content

Make an action need approval (owners only)

POST
/approval-rules
curl --request POST \
--url https://api.global.stillbox.example/v1/approval-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "team_id": "example", "applies_to": "command", "pattern": "example", "four_eyes": true }'
Media typeapplication/json
object
name
required
string
>= 1 characters <= 100 characters
team_id
string
applies_to
required

command: shell commands. file: file edits, by path. web: page fetches, by address.

string
Allowed values: command file web
pattern
required

* matches anything, e.g. git push*, *.tf, https://api.stripe.com/*.

string
>= 1 characters <= 500 characters
four_eyes
boolean

The rule

Media typeapplication/json
object
id
required
string
name
required
string
team_id

Only this team’s sandboxes; absent for the whole organization.

string
applies_to
required

command: shell commands. file: file edits, by path. web: page fetches, by address.

string
Allowed values: command file web
pattern
required
string
four_eyes
required
boolean
created_at
required
string format: date-time

Example

{
"applies_to": "command"
}

The request is invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

The API key is missing or invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

Only an owner can do this (owner_only), or the invitation is for another address (not_invited)

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}