Skip to main content
PUT
/
api
/
v1
/
projects
/
{id}
/
settings
Update project settings
curl --request PUT \
  --url https://api.dualship.run/api/v1/projects/{id}/settings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Workspace-Id: <x-workspace-id>' \
  --data '
{
  "cors": {
    "allow_credentials": true,
    "allowed_headers": [
      "<string>"
    ],
    "allowed_methods": [
      "<string>"
    ],
    "allowed_origins": [
      "<string>"
    ],
    "enabled": true,
    "max_age": 302400
  },
  "log_filters": {
    "masked_keywords": [
      "<string>"
    ]
  },
  "logging": {
    "enabled": true
  },
  "rate_limit": {
    "burst_size": 5000,
    "enabled": true,
    "requests_per_min": 50000
  }
}
'
import requests

url = "https://api.dualship.run/api/v1/projects/{id}/settings"

payload = {
"cors": {
"allow_credentials": True,
"allowed_headers": ["<string>"],
"allowed_methods": ["<string>"],
"allowed_origins": ["<string>"],
"enabled": True,
"max_age": 302400
},
"log_filters": { "masked_keywords": ["<string>"] },
"logging": { "enabled": True },
"rate_limit": {
"burst_size": 5000,
"enabled": True,
"requests_per_min": 50000
}
}
headers = {
"X-Workspace-Id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {
'X-Workspace-Id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cors: {
allow_credentials: true,
allowed_headers: ['<string>'],
allowed_methods: ['<string>'],
allowed_origins: ['<string>'],
enabled: true,
max_age: 302400
},
log_filters: {masked_keywords: ['<string>']},
logging: {enabled: true},
rate_limit: {burst_size: 5000, enabled: true, requests_per_min: 50000}
})
};

fetch('https://api.dualship.run/api/v1/projects/{id}/settings', 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.dualship.run/api/v1/projects/{id}/settings",
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([
'cors' => [
'allow_credentials' => true,
'allowed_headers' => [
'<string>'
],
'allowed_methods' => [
'<string>'
],
'allowed_origins' => [
'<string>'
],
'enabled' => true,
'max_age' => 302400
],
'log_filters' => [
'masked_keywords' => [
'<string>'
]
],
'logging' => [
'enabled' => true
],
'rate_limit' => [
'burst_size' => 5000,
'enabled' => true,
'requests_per_min' => 50000
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Workspace-Id: <x-workspace-id>"
],
]);

$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.dualship.run/api/v1/projects/{id}/settings"

payload := strings.NewReader("{\n \"cors\": {\n \"allow_credentials\": true,\n \"allowed_headers\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"max_age\": 302400\n },\n \"log_filters\": {\n \"masked_keywords\": [\n \"<string>\"\n ]\n },\n \"logging\": {\n \"enabled\": true\n },\n \"rate_limit\": {\n \"burst_size\": 5000,\n \"enabled\": true,\n \"requests_per_min\": 50000\n }\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("X-Workspace-Id", "<x-workspace-id>")
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.dualship.run/api/v1/projects/{id}/settings")
.header("X-Workspace-Id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cors\": {\n \"allow_credentials\": true,\n \"allowed_headers\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"max_age\": 302400\n },\n \"log_filters\": {\n \"masked_keywords\": [\n \"<string>\"\n ]\n },\n \"logging\": {\n \"enabled\": true\n },\n \"rate_limit\": {\n \"burst_size\": 5000,\n \"enabled\": true,\n \"requests_per_min\": 50000\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.dualship.run/api/v1/projects/{id}/settings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-Workspace-Id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cors\": {\n \"allow_credentials\": true,\n \"allowed_headers\": [\n \"<string>\"\n ],\n \"allowed_methods\": [\n \"<string>\"\n ],\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"enabled\": true,\n \"max_age\": 302400\n },\n \"log_filters\": {\n \"masked_keywords\": [\n \"<string>\"\n ]\n },\n \"logging\": {\n \"enabled\": true\n },\n \"rate_limit\": {\n \"burst_size\": 5000,\n \"enabled\": true,\n \"requests_per_min\": 50000\n }\n}"

response = http.request(request)
puts response.read_body
{
  "cors": {
    "allow_credentials": true,
    "allowed_headers": [
      "<string>"
    ],
    "allowed_methods": [
      "<string>"
    ],
    "allowed_origins": [
      "<string>"
    ],
    "enabled": true,
    "max_age": 86400
  },
  "log_filters": {
    "masked_keywords": [
      "<string>"
    ]
  },
  "logging": {
    "enabled": true
  },
  "rate_limit": {
    "burst_size": 100,
    "enabled": true,
    "requests_per_min": 1000
  }
}
{
"code": "BAD_REQUEST",
"error": "invalid request parameters"
}
{
"code": "UNAUTHORIZED",
"error": "unauthorized"
}
{
"code": "NOT_FOUND",
"error": "resource not found"
}
{
"code": "INTERNAL_ERROR",
"error": "internal server error"
}

Authorizations

Authorization
string
header
required

JWT Bearer token authentication

Headers

X-Workspace-Id
string
required

Workspace ID

Path Parameters

id
string
required

Project ID

Body

application/json

Settings to update

cors
object
log_filters
object
logging
object
rate_limit
object

Response

Updated project settings

cors
object
log_filters
object
logging
object
rate_limit
object