Reading your identity
GET /self/me returns the id of the organization the caller belongs to. It is the simplest authenticated endpoint on the API, so it is the best first call to make once you can build a token: if it returns your organization id, your authentication is working end to end. It is also the one value most other calls need first: the orgId that /organizations, /subscriptions and /iam/api-clients take and return.
Before you start
You need a valid access token. Get one as an API client. Reading needs the api:full:read scope.
Read your identity
Send a GET to /self/me with your access token in the Authorization header. Pin apiVersion to protect your integration from future changes:
curl -sS "https://api.cybersentriq.com/self/me?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
const res = await fetch(
"https://api.cybersentriq.com/self/me?apiVersion=1.0",
{ headers: { Authorization: `Bearer ${accessToken}` } },
);
const me = await res.json();
import requests
res = requests.get(
"https://api.cybersentriq.com/self/me",
params={"apiVersion": "1.0"},
headers={"Authorization": f"Bearer {access_token}"},
)
me = res.json()
using System.Net.Http;
var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get,
"https://api.cybersentriq.com/self/me?apiVersion=1.0");
req.Headers.Add("Authorization", $"Bearer {accessToken}");
var res = await http.SendAsync(req);
var me = await res.Content.ReadAsStringAsync();
req, _ := http.NewRequest("GET",
"https://api.cybersentriq.com/self/me?apiVersion=1.0", nil)
req.Header.Set("Authorization", "Bearer "+accessToken)
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
// Decode res.Body into your model.
What you get back
A 200 with your identity record. Its orgId is the id of the organization you belong to: for an API client, the organization the client was created on.
{
"orgId": "6d2a4f1e-0b3c-4d5e-8f7a-9b1c2d3e4f50"
}
Use the value as-is wherever the API asks for an orgId, for example to list the organizations under your own or to create an API client.
Versioning
apiVersion is a query parameter in major.minor form. Omit it and you get the current default, 1.0. Send an unsupported version and the call answers 400 with an api-supported-versions response header listing the versions you can use. Every response carries that header, so you can always see what is available.
Pin apiVersion in production clients so a new default cannot change your integration's behavior underneath it.
When it fails
Every error is application/problem+json with a stable type URI of the form https://api.cybersentriq.com/problems/<slug>:
{
"type": "https://api.cybersentriq.com/problems/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "The access token is missing, invalid or expired."
}
Match on type or the status code, never on title or detail.
| Status | type |
Meaning |
|---|---|---|
| 400 | invalid-api-version |
The apiVersion value is not supported. Check the api-supported-versions response header. |
| 401 | unauthorized |
The access token is missing, invalid or expired. Request a new token and retry once. |
| 403 | insufficient-scope |
The token lacks api:full:read. Request a token with it; see Access scopes. |
| 403 | forbidden |
The caller is not permitted to read this. Retrying will not help. |
| 405 | method-not-allowed |
Only GET is served. The Allow header says so. |
| 429 | too-many-requests |
You have hit the rate allowance. Wait for Retry-After seconds, then retry. |
| 500, 502, 503 | internal-error, upstream-error, upstream-unavailable |
The call could not be served. Retry after a delay. |
Next
- Use the
orgIdyou now hold: Managing organizations, Managing API clients and Managing subscriptions. - See a full flow: Building an end-to-end integration.