Skip to main content
Get CORS configuration
curl --request GET \
  --url https://sapi.withsutro.com/applications/{applicationId}/cors \
  --header 'Authorization: Bearer <token>' \
  --header 'x-sutro-api-client: <api-key>'
import requests

url = "https://sapi.withsutro.com/applications/{applicationId}/cors"

headers = {
    "Authorization": "Bearer <token>",
    "x-sutro-api-client": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'x-sutro-api-client': '<api-key>'}
};

fetch('https://sapi.withsutro.com/applications/{applicationId}/cors', 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://sapi.withsutro.com/applications/{applicationId}/cors",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "x-sutro-api-client: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sapi.withsutro.com/applications/{applicationId}/cors"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("x-sutro-api-client", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://sapi.withsutro.com/applications/{applicationId}/cors")
  .header("Authorization", "Bearer <token>")
  .header("x-sutro-api-client", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://sapi.withsutro.com/applications/{applicationId}/cors")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-sutro-api-client"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "allowedOrigins": [
    "http://localhost:8080",
    "https://app.example.com"
  ]
}

Authorizations

Authorization
string
header
required

Builder authentication and authorization

x-sutro-api-client
string
header
required

A unique identifier for the API Client making a request

Path Parameters

applicationId
string<uuid>
required

Response

The current CORS configuration

CORS (Cross-Origin Resource Sharing) configuration for the application's backend API

allowedOrigins
string[]
required

List of allowed origins that can make cross-origin requests to the backend API

Example:
[
  "http://localhost:8080",
  "https://app.example.com"
]