JavaScript
import Roark from '@roarkanalytics/sdk';
const client = new Roark({
bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});
const me = await client.me.get();
console.log(me.data);import os
from roark_analytics import Roark
client = Roark(
bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted
)
me = client.me.get()
print(me.data)curl --request GET \
--url https://api.roark.ai/v1/me \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/me",
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.roark.ai/v1/me"
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.roark.ai/v1/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/me")
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{
"data": {
"tokenScope": "USER",
"user": {
"id": "0b2b1c34-5d6e-4f70-8192-a3b4c5d6e7f8",
"email": "ada@example.com",
"name": "Ada Lovelace"
},
"organization": {
"id": "9f8e7d6c-5b4a-4312-9081-7f6e5d4c3b2a",
"name": "Example Inc"
},
"defaultProject": {
"id": "1a2b3c4d-5e6f-4701-8293-a4b5c6d7e8f9",
"name": "Support Line",
"slug": "support-line"
},
"grantedPermissions": [
"call:read",
"metric:read"
],
"scopes": [
"READ"
]
}
}{
"type": "authentication",
"code": "unauthorized",
"message": "Authentication required"
}{
"type": "rate_limit",
"code": "too_many_requests",
"message": "Rate limit exceeded"
}{
"type": "internal",
"code": "internal_error",
"message": "Internal server error"
}Me
Describe the current credential
Returns the scope of the credential making the request, the organization it acts in, its default project (if any) and the permissions it was granted. Works for both project-scoped API keys and user-scoped credentials from the CLI or an MCP connector.
GET
/
v1
/
me
JavaScript
import Roark from '@roarkanalytics/sdk';
const client = new Roark({
bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});
const me = await client.me.get();
console.log(me.data);import os
from roark_analytics import Roark
client = Roark(
bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted
)
me = client.me.get()
print(me.data)curl --request GET \
--url https://api.roark.ai/v1/me \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/me",
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.roark.ai/v1/me"
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.roark.ai/v1/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/me")
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{
"data": {
"tokenScope": "USER",
"user": {
"id": "0b2b1c34-5d6e-4f70-8192-a3b4c5d6e7f8",
"email": "ada@example.com",
"name": "Ada Lovelace"
},
"organization": {
"id": "9f8e7d6c-5b4a-4312-9081-7f6e5d4c3b2a",
"name": "Example Inc"
},
"defaultProject": {
"id": "1a2b3c4d-5e6f-4701-8293-a4b5c6d7e8f9",
"name": "Support Line",
"slug": "support-line"
},
"grantedPermissions": [
"call:read",
"metric:read"
],
"scopes": [
"READ"
]
}
}{
"type": "authentication",
"code": "unauthorized",
"message": "Authentication required"
}{
"type": "rate_limit",
"code": "too_many_requests",
"message": "Rate limit exceeded"
}{
"type": "internal",
"code": "internal_error",
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
The current credential
The credential making this request, and what it is bound to
Show child attributes
Show child attributes
Example:
{ "tokenScope": "USER", "user": { "id": "0b2b1c34-5d6e-4f70-8192-a3b4c5d6e7f8", "email": "ada@example.com", "name": "Ada Lovelace" }, "organization": { "id": "9f8e7d6c-5b4a-4312-9081-7f6e5d4c3b2a", "name": "Example Inc" }, "defaultProject": { "id": "1a2b3c4d-5e6f-4701-8293-a4b5c6d7e8f9", "name": "Support Line", "slug": "support-line" }, "grantedPermissions": ["call:read", "metric:read"], "scopes": ["READ"] }