Preview what a personal-space default would stop

What setting the organization's personal_space_role to the candidate role would stop, without writing anything (the candidate is the preset_role or custom_role_id query parameter, exactly one). schedules counts the ENABLED schedules in live personal spaces whose actor is the space's owner, a member or guest who follows the default (no override of their own, see setMemberPersonalSpaceRole) and would hold, under the candidate, a resolved role without agents:run (guest cap and delete floor applied, as the resolver applies them). Each such schedule disables itself at its next fire (disabled_reason: actor_invalid), and restoring the role does not re-enable it. members counts the distinct owners of those schedules. Owners and admins always hold admin in their own personal space and are never counted; a candidate that grants agents:run answers { schedules: 0, members: 0 }. A snapshot, which a later change can make stale. It discloses only counts, to a caller who may already rewrite the setting: same guard as updateOrgSettings (org:settings).

GET/api/orgs/{orgId}/personal-space-role/impact

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

Query Parameters

preset_role?string

The candidate default as a preset key, the preset_role of updateOrgSettings' personal_space_role. Exactly one of preset_role / custom_role_id, else 400.

Value in"admin" | "builder" | "operator" | "runner" | "viewer"
custom_role_id?string

The candidate default as the id of one of this organization's custom space roles. Exactly one of preset_role / custom_role_id, else 400.

Match^srl_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
curl -X GET "https://your-instance/api/orgs/string/personal-space-role/impact"
{
  "schedules": 3,
  "members": 2
}

{
  "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": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "param": "string",
  "retry_after": 0,
  "login_refusal": "grant",
  "integration_diagnostic": "string",
  "errors": [
    {
      "field": "string",
      "code": "string",
      "message": "string",
      "title": "string",
      "line": 1,
      "column": 1,
      "candidate_connections": [
        {
          "id": "string",
          "label": "string",
          "account_id": "string",
          "owned_by_actor": true,
          "needs_reconnection": true,
          "scopes_granted": [
            "string"
          ],
          "missing_scopes": [
            "string"
          ]
        }
      ],
      "connection_id": "string",
      "missing_scopes": [
        "string"
      ],
      "remedy": "new_connection",
      "owned_by_actor": true,
      "required_scopes": [
        "string"
      ],
      "auth_key": "string",
      "required_auth_key": "string",
      "available_auth_keys": [
        "string"
      ],
      "source": "admin_pin",
      "connect_url": "http://example.com",
      "expiresAt": "2019-08-24T14:15:22Z",
      "packageId": "string"
    }
  ]
}