Skip to main content
GET
/
api
/
v1
/
principals
/
me
Get the current caller's information
curl --request GET \
  --url https://auth.cognite.com/api/v1/principals/me
import requests

url = "https://auth.cognite.com/api/v1/principals/me"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://auth.cognite.com/api/v1/principals/me', 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://auth.cognite.com/api/v1/principals/me",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$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://auth.cognite.com/api/v1/principals/me"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://auth.cognite.com/api/v1/principals/me")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://auth.cognite.com/api/v1/principals/me")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "id": "5yAFQRAATb7vtWGp4gvbJD3wE7VS81CGuQ7EZT",
  "type": "SERVICE_ACCOUNT",
  "name": "My service account",
  "createdBy": {
    "orgId": "my-org",
    "userId": "-user-string-id-aBc123"
  },
  "createdTime": 1730204346000,
  "lastUpdatedTime": 1730204346000,
  "pictureUrl": "<string>",
  "externalId": "my.known.id",
  "description": "This is a service account used by data pipeline A-xxx"
}

Response

200 - application/json

The principal that issued the request.

A principal

id
string
required

Unique identifier of a principal

Example:

"5yAFQRAATb7vtWGp4gvbJD3wE7VS81CGuQ7EZT"

type
enum<string>
required

Principal type

Available options:
SERVICE_ACCOUNT
Example:

"SERVICE_ACCOUNT"

name
string
required

Human-readable name of the principal

Required string length: 1 - 50
Example:

"My service account"

createdBy
object
required

The principal that created the entity.

createdTime
integer<int64>
required

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

lastUpdatedTime
integer<int64>
required

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

pictureUrl
string<url>
required

URL to a picture of the principal

externalId
string

The external ID provided by the client. Must be unique for the resource type.

Maximum string length: 255
Example:

"my.known.id"

description
string

Longer description of a service account

Maximum string length: 500
Example:

"This is a service account used by data pipeline A-xxx"

Last modified on July 10, 2026