Check whether the current identity has a project permission
curl --request GET \
--url https://api.sapt.ai/auth/check-permission \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sapt.ai/auth/check-permission"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sapt.ai/auth/check-permission', 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.sapt.ai/auth/check-permission",
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>"
],
]);
$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.sapt.ai/auth/check-permission"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sapt.ai/auth/check-permission")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/auth/check-permission")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"allowed": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Auth
Check whether the current identity has a project permission
Debug endpoint. Resolves the caller identity and returns whether it holds the given project-scoped permission.
GET
/
auth
/
check-permission
Check whether the current identity has a project permission
curl --request GET \
--url https://api.sapt.ai/auth/check-permission \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sapt.ai/auth/check-permission"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sapt.ai/auth/check-permission', 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.sapt.ai/auth/check-permission",
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>"
],
]);
$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.sapt.ai/auth/check-permission"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sapt.ai/auth/check-permission")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/auth/check-permission")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"allowed": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
JWT token obtained from /api/auth/token endpoint. Token is verified using JWKS and must include a valid user identifier.
Query Parameters
Available options:
settings:read, settings:write, settings:manage, members:read, members:write, members:manage, roles:read, roles:write, roles:manage, audit_log:read, audit_log:write, audit_log:manage, crm_types:read, crm_types:write, crm_types:manage, crm_objects:read, crm_objects:write, crm_objects:manage, cms_types:read, cms_types:write, cms_types:manage, cms_items:read, cms_items:write, cms_items:manage, meta_planner:read, meta_planner:write, meta_planner:manage, assets:read, assets:write, assets:manage, workflows:read, workflows:write, workflows:manage, integrations:read, integrations:write, integrations:manage, oauth_clients:read, oauth_clients:write, oauth_clients:manage, agents:read, agents:write, agents:manage, web_analytics:read, web_analytics:write, web_analytics:manage, social:read, social:write, social:manage, tenant_email:read, tenant_email:write, tenant_email:manage, meta_ads:read, meta_ads:write, meta_ads:manage, google_ads:read, google_ads:write, google_ads:manage, google_business:read, google_business:write, google_business:manage, contracts:read, contracts:write, contracts:manage, service_accounts:read, service_accounts:write, service_accounts:manage, support_tickets:read, support_tickets:write, support_tickets:manage, billing:read, billing:write, billing:manage, calendar:read, calendar:write, calendar:manage, sub_projects:read, sub_projects:write, sub_projects:manage, project_templates:read, project_templates:write, project_templates:manage Response
Permission check result