curl --request POST \
--url https://{instance}.cyrisma.com/ta/v1/auth/client-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "pc_q3kz0v7m1x9s2d4f6h8j0l2n",
"client_secret": "pcs_…",
"requested_scopes": [
"pulse.read",
"pulse.write"
]
}
'import requests
url = "https://{instance}.cyrisma.com/ta/v1/auth/client-token"
payload = {
"client_id": "pc_q3kz0v7m1x9s2d4f6h8j0l2n",
"client_secret": "pcs_…",
"requested_scopes": ["pulse.read", "pulse.write"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: 'pc_q3kz0v7m1x9s2d4f6h8j0l2n',
client_secret: 'pcs_…',
requested_scopes: ['pulse.read', 'pulse.write']
})
};
fetch('https://{instance}.cyrisma.com/ta/v1/auth/client-token', 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://{instance}.cyrisma.com/ta/v1/auth/client-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => 'pc_q3kz0v7m1x9s2d4f6h8j0l2n',
'client_secret' => 'pcs_…',
'requested_scopes' => [
'pulse.read',
'pulse.write'
]
]),
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://{instance}.cyrisma.com/ta/v1/auth/client-token"
payload := strings.NewReader("{\n \"client_id\": \"pc_q3kz0v7m1x9s2d4f6h8j0l2n\",\n \"client_secret\": \"pcs_…\",\n \"requested_scopes\": [\n \"pulse.read\",\n \"pulse.write\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://{instance}.cyrisma.com/ta/v1/auth/client-token")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"pc_q3kz0v7m1x9s2d4f6h8j0l2n\",\n \"client_secret\": \"pcs_…\",\n \"requested_scopes\": [\n \"pulse.read\",\n \"pulse.write\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.cyrisma.com/ta/v1/auth/client-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"pc_q3kz0v7m1x9s2d4f6h8j0l2n\",\n \"client_secret\": \"pcs_…\",\n \"requested_scopes\": [\n \"pulse.read\",\n \"pulse.write\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"token_type": "<string>",
"expires_in": 123,
"expires_at": "2023-11-07T05:31:56Z",
"subject_type": "<string>"
}Exchange an API key for an access token
Exchanges an API key for a bearer token, valid for one hour by default. The token is for the API key’s own tenant, and gives access to that tenant and every tenant beneath it.
- 401 (no body): the client id or secret is missing or wrong, or the key has been revoked.
- 403
tenant_context_denied: the tenant is not active (for example suspended), or the key has no access left. - 403
scope_denied:requested_scopesasks for a scope the key does not hold.
curl --request POST \
--url https://{instance}.cyrisma.com/ta/v1/auth/client-token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "pc_q3kz0v7m1x9s2d4f6h8j0l2n",
"client_secret": "pcs_…",
"requested_scopes": [
"pulse.read",
"pulse.write"
]
}
'import requests
url = "https://{instance}.cyrisma.com/ta/v1/auth/client-token"
payload = {
"client_id": "pc_q3kz0v7m1x9s2d4f6h8j0l2n",
"client_secret": "pcs_…",
"requested_scopes": ["pulse.read", "pulse.write"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: 'pc_q3kz0v7m1x9s2d4f6h8j0l2n',
client_secret: 'pcs_…',
requested_scopes: ['pulse.read', 'pulse.write']
})
};
fetch('https://{instance}.cyrisma.com/ta/v1/auth/client-token', 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://{instance}.cyrisma.com/ta/v1/auth/client-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => 'pc_q3kz0v7m1x9s2d4f6h8j0l2n',
'client_secret' => 'pcs_…',
'requested_scopes' => [
'pulse.read',
'pulse.write'
]
]),
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://{instance}.cyrisma.com/ta/v1/auth/client-token"
payload := strings.NewReader("{\n \"client_id\": \"pc_q3kz0v7m1x9s2d4f6h8j0l2n\",\n \"client_secret\": \"pcs_…\",\n \"requested_scopes\": [\n \"pulse.read\",\n \"pulse.write\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://{instance}.cyrisma.com/ta/v1/auth/client-token")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"pc_q3kz0v7m1x9s2d4f6h8j0l2n\",\n \"client_secret\": \"pcs_…\",\n \"requested_scopes\": [\n \"pulse.read\",\n \"pulse.write\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.cyrisma.com/ta/v1/auth/client-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"pc_q3kz0v7m1x9s2d4f6h8j0l2n\",\n \"client_secret\": \"pcs_…\",\n \"requested_scopes\": [\n \"pulse.read\",\n \"pulse.write\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"token_type": "<string>",
"expires_in": 123,
"expires_at": "2023-11-07T05:31:56Z",
"subject_type": "<string>"
}Authorizations
A machine-client token from POST /v1/auth/client-token. Reads need the pulse.read scope; provisioning and tenant updates need pulse.write, which the token only carries when requested_scopes asks for it. Creating, changing, disabling and resetting MFA for users, and the tenant sign-in policy, need a signed-in user's token instead: they reject API-key tokens.
Body
Exchanges an API key (client id and secret) for a bearer token for the key's own tenant.
The scopes the token should carry: pulse.read, pulse.write, or both.
When omitted, the token gets pulse.read only, even if the key also holds
pulse.write. Provisioning, suspend, reactivate, decommission, job status, updates and user
management all need pulse.write, so ask for it explicitly. Asking for a scope the key
does not hold returns 403 scope_denied.
Response
OK
A bearer token. Send it as Authorization: Bearer <access_token>. There is no refresh token: request a new one before expires_at.
