> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

# Get Identity

GET https://app.polytomic.com/api/me

Returns information about the authenticated caller and, if applicable, the organization they are scoped to.

Use this endpoint to confirm which kind of credential is being used before
calling endpoints with stricter authorization rules.

For user-scoped credentials, the response includes the resolved user and
organization details. For non-user keys, the response identifies the key class
with the corresponding boolean flags instead of impersonating a user.

This endpoint is especially useful when debugging why a request is being
accepted or rejected by endpoints that are limited to particular caller types.

Reference: https://apidocs.polytomic.com/api-reference/identity/get

## Response

### 200

OK

- `data` (GetIdentityResponseSchema, optional)

## Errors

### 401 Unauthorized Error

Unauthorized

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

### 403 Forbidden Error

Forbidden

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

### 500 Internal Server Error

Internal Server Error

- `key` (string, optional)
- `message` (string, optional)
- `metadata` (map from string to any, optional)
- `status` (integer, optional)

## Types

### GetIdentityResponseSchema

- `credential` (IdentityCredentialSchema, optional)
- `email` (string, optional) — The email of the caller.
- `id` (string, optional) — The ID of the caller; this will be omitted for non-user callers.
- `is_organization` (boolean, optional) — Whether the caller is using an organization key.
- `is_partner` (boolean, optional) — Whether the caller is using a partner key.
- `is_system` (boolean, optional) — Whether the caller is a system actor.
- `is_user` (boolean, optional) — Whether the caller is a user.
- `organization_id` (string, optional) — The ID of the organization the caller belongs to.
- `organization_name` (string, optional) — The name of the organization the caller belongs to.
- `role` (string, optional, deprecated) — Deprecated legacy role name. Populated only for user callers.

### IdentityCredentialSchema

- `api_key_profile` (IdentityCredentialAPIKeyProfileSchema, optional)
- `harbor` (IdentityCredentialHarborSchema, optional)
- `method` (string, optional) — Authentication method used for the request.
- `mode` (string, optional) — API key mode applied to the credential when available.
- `oauth_client_id` (string, optional) — OAuth client ID for OAuth-issued API keys.
- `oauth_resource` (string, optional) — Protected resource URL this OAuth-issued credential is bound to.

### IdentityCredentialAPIKeyProfileSchema

- `capabilities` (IdentityCredentialCapabilitiesSchema, optional)
- `description` (string, optional) — Organization-provided summary of the data and questions this scoped profile supports.
- `id` (string, optional) — Stable API key profile ID.
- `kind` (string, optional) — API key profile kind.
- `name` (string, optional) — Stable API key profile name.

### IdentityCredentialHarborSchema

- `actions_enabled` (boolean, optional) — Whether the organization has the Harbor actions feature enabled. Controls action tool visibility in new MCP sessions; does not grant permission or indicate that an action is configured.
- `description` (string, optional) — Organization-provided summary of the Harbor.
- `id` (string, optional) — Immutable Harbor ID.
- `mcp_server_url` (string, optional) — Readable MCP resource URL for authorizing this Harbor independently. The credential's Harbor ID remains authoritative.
- `name` (string, optional) — Current Harbor display name.

### IdentityCredentialCapabilitiesSchema

- `query` (IdentityCredentialConnectionCapabilitySchema, optional)
- `schemas` (IdentityCredentialConnectionCapabilitySchema, optional)

### IdentityCredentialConnectionCapabilitySchema

- `connection_ids` (list of string, optional, nullable) — Connection IDs enabled for this capability.

## Examples

**Response**

```json
{
  "data": {
    "credential": {
      "api_key_profile": {
        "capabilities": {
          "query": {
            "connection_ids": [
              "248df4b7-aa70-47b8-a036-33ac447e668d"
            ]
          },
          "schemas": {
            "connection_ids": [
              "248df4b7-aa70-47b8-a036-33ac447e668d"
            ]
          }
        },
        "description": "string",
        "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
        "kind": "scoped_data",
        "name": "Sales ops agent"
      },
      "harbor": {
        "actions_enabled": true,
        "description": "string",
        "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
        "mcp_server_url": "string",
        "name": "Sales ops Harbor"
      },
      "method": "api_key",
      "mode": "read_only",
      "oauth_client_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "oauth_resource": "string"
    },
    "email": "mail@example.com",
    "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "is_organization": false,
    "is_partner": false,
    "is_system": false,
    "is_user": true,
    "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "organization_name": "My Organization",
    "role": "admin"
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.polytomic.com/api/me"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://app.polytomic.com/api/me';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://app.polytomic.com/api/me"

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

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.polytomic.com/api/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
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.polytomic.com/api/me")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.polytomic.com/api/me');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.polytomic.com/api/me");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://app.polytomic.com/api/me")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```