Skip to main content
GET
/
identity
Python
import os
from datagrid_ai import Datagrid

client = Datagrid(
    api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
)
identity = client.identity.retrieve()
print(identity.current_teamspace_id)
{
  "object": "identity",
  "user_id": "<string>",
  "current_teamspace_id": "<string>",
  "teamspaces": [
    {
      "teamspace_id": "<string>",
      "permissions": {
        "role": "owner",
        "agent_ids": [
          "<string>"
        ]
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

Caller identity

object
enum<string>
required
Available options:
identity
user_id
string
required

The ID of the authenticated user.

current_teamspace_id
string
required

The teamspace ID this request is scoped to (derived from the API key or the Datagrid-Teamspace header).

teamspaces
object[]
required

All teamspaces the authenticated user is a member of.