List an agent's persistence across the organization's spaces

Read-only: the agent's pinned slots and memories in every space of the organization where the caller holds persistence:read and the space reads the agent (homed, placed or shipped with the deployment), each row naming its spaceId. The query and the actor partition are those of GET /api/agents/{scope}/{name}/persistence, judged per space: where the caller holds persistence:delete they see every actor's rows (or the actor_type they name), elsewhere their own actor scope plus the shared rows. Pinned slots come newest update first and memories oldest first, across spaces. 404 when no such space reads the agent. An inline run's shadow agent is not served here. A space the caller holds no role in (a closed space not joined, a private space they are not a member of) contributes nothing, and a credential pinned to a space (a space API key, a space-bound MCP token) reaches that space only. No X-Space-Id: the organization is the path's. An end-user is refused with 403.

GET/api/orgs/{orgId}/agents/{scope}/{name}/persistence

Authorization

better-auth.session_token<token>

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

In: cookie

Path Parameters

orgId*string

Organization ID.

scope*string

Package scope (e.g. @myorg)

Match^@[a-z0-9][a-z0-9-]*$
name*string

Package name

Query Parameters

kind?string

Limit the response to one kind. Omitted → both.

Value in"pinned" | "memory"
actor_type?string

Scope override, honoured only for a caller holding persistence:delete (ignored otherwise). Omitted → that caller sees every actor's rows; every other caller sees their own actor scope.

Value in"user" | "end_user" | "shared"
actor_id?string

Required for actor_type=user or end_user. Omit for shared rows or when no actor type is selected.

Length1 <= length
runId?string

Narrow memories and pinned to rows touched during a specific run.

curl -X GET "https://your-instance/api/orgs/string/agents/string/string/persistence"
{
  "object": "agent_persistence",
  "pinned": [
    {
      "id": 0,
      "key": "string",
      "content": null,
      "runId": "string",
      "actor_type": "user",
      "actor_id": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z",
      "spaceId": "string"
    }
  ],
  "memories": [
    {
      "id": 0,
      "content": "string",
      "runId": "string",
      "actor_type": "user",
      "actor_id": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "pinned": true,
      "spaceId": "string"
    }
  ]
}

{
  "type": "https://docs.appstrate.dev/errors/validation-failed",
  "title": "Validation Failed",
  "status": 400,
  "detail": "name: Invalid input: expected string, received undefined (+2 more)",
  "code": "validation_failed",
  "request_id": "req_abc123",
  "errors": [
    {
      "field": "name",
      "code": "required",
      "message": "Invalid input: expected string, received undefined"
    },
    {
      "field": "email",
      "code": "invalid_format",
      "message": "Invalid email address"
    },
    {
      "field": "age",
      "code": "invalid_type",
      "message": "Invalid input: expected number, received string"
    }
  ]
}

{
  "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"
}
{
  "type": "https://docs.appstrate.dev/errors/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "Resource not found",
  "code": "not_found",
  "request_id": "req_abc123"
}