The caller's working context for an AI agent

Returns the caller's identity, their role in the pinned org, and the integrations they could attach when building an agent in the current space (their own or org-shared). One payload powering the chat system prompt, the MCP get_me tool, and direct API/MCP callers — so an agent can prefer already-connected integrations and respect the caller's role (operations beyond it 403 at invoke time). The space is the one the credential (API key, token) is bound to — an X-Space-Id naming another is refused — else the one X-Space-Id names; with neither the request is a 400, except through the MCP server, which falls back to the org's default space.

GET/api/me/context

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Header Parameters

X-Org-Id?string

Organization ID. Required for cookie auth. Not needed for API key auth (org resolved from key).

Formatuuid
X-Space-Id?string

Space ID. Required for space-scoped routes (agents, runs, schedules, and space-scoped module routes). Not needed for API key auth (space resolved from key).

curl -X GET "https://your-instance/api/me/context"
{
  "user": {
    "id": "user_abc",
    "name": "Ada Lovelace",
    "email": "[email protected]"
  },
  "org": {
    "id": "org_abc123",
    "role": "member",
    "name": "Acme",
    "slug": "acme"
  },
  "space": {
    "id": "spc_5b8c0e13-4f7a-4d92-b3c6-71e0a4d9f582",
    "name": "Sales",
    "personal": false
  },
  "connections": [
    {
      "integration_package_id": "@appstrate/gmail",
      "name": "Gmail",
      "source": "own"
    },
    {
      "integration_package_id": "@appstrate/clickup",
      "name": "ClickUp",
      "source": "shared"
    }
  ],
  "recent_runs": [
    {
      "packageId": "@appstrate/triage",
      "status": "failed",
      "runNumber": 7,
      "started_at": "2026-06-25T09:12:00.000Z",
      "error": "Gmail token expired"
    }
  ],
  "agents": [
    {
      "packageId": "@appstrate/triage",
      "display_name": "Inbox Triage",
      "description": "Sorts and labels incoming email.",
      "takes_input": false,
      "published": true,
      "home_writable": false,
      "source": "system"
    }
  ],
  "agents_truncated": false,
  "agents_total": 1,
  "skills": [
    {
      "packageId": "@appstrate/web-research",
      "display_name": "Web Research",
      "description": "Multi-source web search and synthesis.",
      "version": "1.2.0",
      "published": true,
      "home_writable": false,
      "source": "system"
    }
  ],
  "skills_truncated": false,
  "skills_total": 1
}
{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}