Update a Tenant
This endpoint updates the Tenant data.
curl --request PATCH \
--url https://api.example.com/tenants/{id} \
--header 'Content-Type: */*' \
--data '{
"base_url": "<string>",
"sdp_ui_base_url": "<string>"
}'import requests
url = "https://api.example.com/tenants/{id}"
payload = "{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}"
headers = {"Content-Type": "*/*"}
response = requests.patch(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': '*/*'},
body: '{\n "base_url": "<string>",\n "sdp_ui_base_url": "<string>"\n}'
};
fetch('https://api.example.com/tenants/{id}', 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.example.com/tenants/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}",
CURLOPT_HTTPHEADER => [
"Content-Type: */*"
],
]);
$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.example.com/tenants/{id}"
payload := strings.NewReader("{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/tenants/{id}")
.header("Content-Type", "*/*")
.body("{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/tenants/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = '*/*'
request.body = "{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "840dca45-d1df-44cd-83c1-65c04235c25f",
"name": "redcorp",
"base_url": "https://redcorp-backend.sdp.org",
"sdp_ui_base_url": "https://redcorp.sdp.org",
"status": "TENANT_PROVISIONED",
"distribution_account": "GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N",
"is_default": true,
"created_at": "2024-03-27T17:21:51.000Z",
"updated_at": "2024-03-27T17:21:51.000Z"
}{
"error": "<string>",
"extras": {}
}{
"error": "Not authorized",
"extras": {
"status": 401,
"message": "Not authorized"
}
}{
"error": "Not found",
"extras": {
"status": 404,
"message": "Resource not found"
}
}Path Parameters
ID of the Tenant.
Body
List of fields to update for the tenant
Response
Updated Tenant details
"1736bed3-7b92-4760-8ff2-51fb08ee079f"
The tenant name. It should match the pattern ^[a-z-]+$.
"bluecorp"
The SDP backend server's base URL.
"https://bluecorp-backend.sdp.org"
The SDP UI/dashboard Base URL.
"https://bluecorp.sdp.org"
TENANT_CREATED, TENANT_PROVISIONED, TENANT_ACTIVATED, TENANT_DEACTIVATED The Stellar account address used for distributing funds.
"GCXAJ3XJ3VK3JFH3QMDFOSKM2NMMZBSO3VIT6EUPQWSDW2J74M23RRSL"
The Stellar account type used for distributing funds.
DISTRIBUTION_ACCOUNT.STELLAR.ENV, DISTRIBUTION_ACCOUNT.STELLAR.DB_VAULT, DISTRIBUTION_ACCOUNT.CIRCLE.DB_VAULT The status of the distribution account used for distributing funds.
ACTIVE, PENDING_USER_ACTIVATION Boolean flag that shows whether the tenant is the default or not.
"2024-03-27T17:21:51Z"
"2024-03-27T17:21:51Z"
The timestamp when the tenant was (soft) deleted.
"2024-03-27T17:21:51Z"
curl --request PATCH \
--url https://api.example.com/tenants/{id} \
--header 'Content-Type: */*' \
--data '{
"base_url": "<string>",
"sdp_ui_base_url": "<string>"
}'import requests
url = "https://api.example.com/tenants/{id}"
payload = "{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}"
headers = {"Content-Type": "*/*"}
response = requests.patch(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': '*/*'},
body: '{\n "base_url": "<string>",\n "sdp_ui_base_url": "<string>"\n}'
};
fetch('https://api.example.com/tenants/{id}', 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.example.com/tenants/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}",
CURLOPT_HTTPHEADER => [
"Content-Type: */*"
],
]);
$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.example.com/tenants/{id}"
payload := strings.NewReader("{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/tenants/{id}")
.header("Content-Type", "*/*")
.body("{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/tenants/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = '*/*'
request.body = "{\n \"base_url\": \"<string>\",\n \"sdp_ui_base_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "840dca45-d1df-44cd-83c1-65c04235c25f",
"name": "redcorp",
"base_url": "https://redcorp-backend.sdp.org",
"sdp_ui_base_url": "https://redcorp.sdp.org",
"status": "TENANT_PROVISIONED",
"distribution_account": "GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N",
"is_default": true,
"created_at": "2024-03-27T17:21:51.000Z",
"updated_at": "2024-03-27T17:21:51.000Z"
}{
"error": "<string>",
"extras": {}
}{
"error": "Not authorized",
"extras": {
"status": 401,
"message": "Not authorized"
}
}{
"error": "Not found",
"extras": {
"status": 404,
"message": "Resource not found"
}
}