Workflow Policies
Create or update workflow policy
Creates or updates the workflow execution policy for a project.
PUT
/
v1
/
workflow-policies
/
{projectID}
Create or update workflow policy
curl --request PUT \
--url https://api.strait.dev/v1/workflow-policies/{projectID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"forbidden_step_types": [
"<string>"
],
"max_depth": 123,
"max_fan_out": 123,
"require_approval_for_deploy": true
}
'import requests
url = "https://api.strait.dev/v1/workflow-policies/{projectID}"
payload = {
"forbidden_step_types": ["<string>"],
"max_depth": 123,
"max_fan_out": 123,
"require_approval_for_deploy": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
forbidden_step_types: ['<string>'],
max_depth: 123,
max_fan_out: 123,
require_approval_for_deploy: true
})
};
fetch('https://api.strait.dev/v1/workflow-policies/{projectID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.strait.dev/v1/workflow-policies/{projectID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'forbidden_step_types' => [
'<string>'
],
'max_depth' => 123,
'max_fan_out' => 123,
'require_approval_for_deploy' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.strait.dev/v1/workflow-policies/{projectID}"
payload := strings.NewReader("{\n \"forbidden_step_types\": [\n \"<string>\"\n ],\n \"max_depth\": 123,\n \"max_fan_out\": 123,\n \"require_approval_for_deploy\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.strait.dev/v1/workflow-policies/{projectID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"forbidden_step_types\": [\n \"<string>\"\n ],\n \"max_depth\": 123,\n \"max_fan_out\": 123,\n \"require_approval_for_deploy\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.strait.dev/v1/workflow-policies/{projectID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"forbidden_step_types\": [\n \"<string>\"\n ],\n \"max_depth\": 123,\n \"max_fan_out\": 123,\n \"require_approval_for_deploy\": true\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"max_depth": 123,
"max_fan_out": 123,
"project_id": "<string>",
"require_approval_for_deploy": true,
"updated_at": "2023-11-07T05:31:56Z",
"$schema": "<string>",
"forbidden_step_types": [
"<string>"
]
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}Authorizations
API key passed as Bearer token
Path Parameters
Body
application/json
Response
OK
A URL to the JSON Schema for this object.
Example:
"https://api.strait.dev/schemas/WorkflowPolicy.json"
⌘I
Create or update workflow policy
curl --request PUT \
--url https://api.strait.dev/v1/workflow-policies/{projectID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"forbidden_step_types": [
"<string>"
],
"max_depth": 123,
"max_fan_out": 123,
"require_approval_for_deploy": true
}
'import requests
url = "https://api.strait.dev/v1/workflow-policies/{projectID}"
payload = {
"forbidden_step_types": ["<string>"],
"max_depth": 123,
"max_fan_out": 123,
"require_approval_for_deploy": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
forbidden_step_types: ['<string>'],
max_depth: 123,
max_fan_out: 123,
require_approval_for_deploy: true
})
};
fetch('https://api.strait.dev/v1/workflow-policies/{projectID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.strait.dev/v1/workflow-policies/{projectID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'forbidden_step_types' => [
'<string>'
],
'max_depth' => 123,
'max_fan_out' => 123,
'require_approval_for_deploy' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.strait.dev/v1/workflow-policies/{projectID}"
payload := strings.NewReader("{\n \"forbidden_step_types\": [\n \"<string>\"\n ],\n \"max_depth\": 123,\n \"max_fan_out\": 123,\n \"require_approval_for_deploy\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.strait.dev/v1/workflow-policies/{projectID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"forbidden_step_types\": [\n \"<string>\"\n ],\n \"max_depth\": 123,\n \"max_fan_out\": 123,\n \"require_approval_for_deploy\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.strait.dev/v1/workflow-policies/{projectID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"forbidden_step_types\": [\n \"<string>\"\n ],\n \"max_depth\": 123,\n \"max_fan_out\": 123,\n \"require_approval_for_deploy\": true\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"max_depth": 123,
"max_fan_out": 123,
"project_id": "<string>",
"require_approval_for_deploy": true,
"updated_at": "2023-11-07T05:31:56Z",
"$schema": "<string>",
"forbidden_step_types": [
"<string>"
]
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}