Make an action need approval (owners only)
POST
/approval-rules
const url = 'https://api.global.stillbox.example/v1/approval-rules';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","team_id":"example","applies_to":"command","pattern":"example","four_eyes":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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 }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
team_id
string
applies_to
required
command: shell commands. file: file edits, by path. web: page fetches, by address.
string
pattern
required
* matches anything, e.g. git push*, *.tf, https://api.stripe.com/*.
string
four_eyes
boolean
Responses
Section titled “Responses”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
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"}