curl --request PUT \
--url https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mfa_requirement": "required",
"allowed_mfa_methods": [
"email",
"totp"
],
"expected_version": 3,
"require_sso": false
}
'import requests
url = "https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy"
payload = {
"mfa_requirement": "required",
"allowed_mfa_methods": ["email", "totp"],
"expected_version": 3,
"require_sso": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mfa_requirement: 'required',
allowed_mfa_methods: ['email', 'totp'],
expected_version: 3,
require_sso: false
})
};
fetch('https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy', 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/msp/admin/tenants/{tenantId}/auth-policy",
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([
'mfa_requirement' => 'required',
'allowed_mfa_methods' => [
'email',
'totp'
],
'expected_version' => 3,
'require_sso' => false
]),
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/msp/admin/tenants/{tenantId}/auth-policy"
payload := strings.NewReader("{\n \"mfa_requirement\": \"required\",\n \"allowed_mfa_methods\": [\n \"email\",\n \"totp\"\n ],\n \"expected_version\": 3,\n \"require_sso\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mfa_requirement\": \"required\",\n \"allowed_mfa_methods\": [\n \"email\",\n \"totp\"\n ],\n \"expected_version\": 3,\n \"require_sso\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mfa_requirement\": \"required\",\n \"allowed_mfa_methods\": [\n \"email\",\n \"totp\"\n ],\n \"expected_version\": 3,\n \"require_sso\": false\n}"
response = http.request(request)
puts response.read_body{
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mfa_requirement": "<string>",
"allowed_mfa_methods": [
"email"
],
"version": 123,
"updated_at": "2023-11-07T05:31:56Z",
"require_sso": false
}{
"status": 123,
"code": "<string>",
"trace_id": "<string>",
"denied_scopes": [
"<string>"
],
"attempts_remaining": 123,
"retry_after_seconds": 123
}{
"status": 123,
"code": "<string>",
"trace_id": "<string>",
"denied_scopes": [
"<string>"
],
"attempts_remaining": 123,
"retry_after_seconds": 123
}{
"status": 123,
"code": "<string>",
"trace_id": "<string>",
"denied_scopes": [
"<string>"
],
"attempts_remaining": 123,
"retry_after_seconds": 123
}Set a tenant's authentication policy
Replaces a tenant’s sign-in policy. It applies to that tenant only, not the tenants beneath it.
Needs a signed-in user’s token. API-key tokens from POST /v1/auth/client-token are rejected. The user needs pulse.write and an admin role.
- 400
auth_request_invalid: an invalidmfa_requirement,allowed_mfa_methodsorexpected_version. - 401
invalid_credentials: missing, invalid or outdated token. - 403
tenant_context_denied: an API-key token, no admin role orpulse.write, or the tenant is outside your hierarchy. - 404
tenant_context_not_found: the tenant has no policy. - 409
policy_version_conflict: the policy changed since you read it. Read it again and retry. - 409
require_sso_needs_sso_session: turning onrequire_ssoneeds you to be signed in to this tenant with SSO.
curl --request PUT \
--url https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mfa_requirement": "required",
"allowed_mfa_methods": [
"email",
"totp"
],
"expected_version": 3,
"require_sso": false
}
'import requests
url = "https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy"
payload = {
"mfa_requirement": "required",
"allowed_mfa_methods": ["email", "totp"],
"expected_version": 3,
"require_sso": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mfa_requirement: 'required',
allowed_mfa_methods: ['email', 'totp'],
expected_version: 3,
require_sso: false
})
};
fetch('https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy', 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/msp/admin/tenants/{tenantId}/auth-policy",
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([
'mfa_requirement' => 'required',
'allowed_mfa_methods' => [
'email',
'totp'
],
'expected_version' => 3,
'require_sso' => false
]),
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/msp/admin/tenants/{tenantId}/auth-policy"
payload := strings.NewReader("{\n \"mfa_requirement\": \"required\",\n \"allowed_mfa_methods\": [\n \"email\",\n \"totp\"\n ],\n \"expected_version\": 3,\n \"require_sso\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mfa_requirement\": \"required\",\n \"allowed_mfa_methods\": [\n \"email\",\n \"totp\"\n ],\n \"expected_version\": 3,\n \"require_sso\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.cyrisma.com/ta/v1/msp/admin/tenants/{tenantId}/auth-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mfa_requirement\": \"required\",\n \"allowed_mfa_methods\": [\n \"email\",\n \"totp\"\n ],\n \"expected_version\": 3,\n \"require_sso\": false\n}"
response = http.request(request)
puts response.read_body{
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mfa_requirement": "<string>",
"allowed_mfa_methods": [
"email"
],
"version": 123,
"updated_at": "2023-11-07T05:31:56Z",
"require_sso": false
}{
"status": 123,
"code": "<string>",
"trace_id": "<string>",
"denied_scopes": [
"<string>"
],
"attempts_remaining": 123,
"retry_after_seconds": 123
}{
"status": 123,
"code": "<string>",
"trace_id": "<string>",
"denied_scopes": [
"<string>"
],
"attempts_remaining": 123,
"retry_after_seconds": 123
}{
"status": 123,
"code": "<string>",
"trace_id": "<string>",
"denied_scopes": [
"<string>"
],
"attempts_remaining": 123,
"retry_after_seconds": 123
}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.
Path Parameters
Body
Replaces the whole policy: send every field, because an omitted require_sso is saved as
false. Invalid values return 400 auth_request_invalid.
Tightening the policy (making MFA required, or removing an allowed method) signs every user of the tenant out: their existing tokens stop working.
Whether users must use multi-factor authentication: disabled | required.
required: every user must complete MFA, and users without a method are asked to set one up.disabled: MFA is not forced, but users who have already set up a method are still asked for it.
disabled, required Response
OK
How users of one tenant sign in. The policy applies to that tenant only; tenants beneath it keep their own.
