Rotate an API client secret
curl --request POST \
--url https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret \
--header 'x-siro-auth-token: <api-key>'import requests
url = "https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret"
headers = {"x-siro-auth-token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-siro-auth-token': '<api-key>'}};
fetch('https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret', 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.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-siro-auth-token: <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://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-siro-auth-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret")
.header("x-siro-auth-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-siro-auth-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"clientId": "<string>",
"clientSecret": "<string>"
},
"cursor": "<string>",
"pageSize": 123,
"limit": 123,
"total": 123,
"hasNextPage": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>",
"expected": "<string>",
"received": "<string>"
}
],
"name": "ZodError"
}{
"error": "<string>"
}Client apps
Rotate an API client secret
Issues a new secret and returns it once. The client id does not change, the previous secret keeps working until the next rotation, and only the caller who created the client can rotate it.
POST
/
v1
/
core
/
m2m-clients
/
{organizationId}
/
{clientId}
/
rotate-secret
Rotate an API client secret
curl --request POST \
--url https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret \
--header 'x-siro-auth-token: <api-key>'import requests
url = "https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret"
headers = {"x-siro-auth-token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-siro-auth-token': '<api-key>'}};
fetch('https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret', 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.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-siro-auth-token: <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://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-siro-auth-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret")
.header("x-siro-auth-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.siro.ai/v1/core/m2m-clients/{organizationId}/{clientId}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-siro-auth-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"clientId": "<string>",
"clientSecret": "<string>"
},
"cursor": "<string>",
"pageSize": 123,
"limit": 123,
"total": 123,
"hasNextPage": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>",
"expected": "<string>",
"received": "<string>"
}
],
"name": "ZodError"
}{
"error": "<string>"
}Issues a new secret for an existing client app. The
clientId does not change.
The new clientSecret is returned once. Store it immediately. The previous secret keeps working until you rotate again.
Only the caller who created the client can rotate it.Authorizations
Access token from POST https://auth.siro.ai/oauth2/token (client_credentials), or a Siro OAuth access token. Send x-siro-auth-token: <access-token>.
Path Parameters
The organization this client belongs to.
The id of the API client.