Management APIs / Orgs

List the caller's organizations

GEThttps://api.spice.ai/v1/orgs

Returns every organization the authenticated caller belongs to, each with the caller's effective membership role. A caller with no memberships gets an empty array, not a 404 — clients read 404 as "this deployment does not serve the endpoint", which is a different state. name is the organization handle used in <org>/<app> addressing.

Authorizations

  • AuthorizationstringRequired

    Bearer <token>. Authentication lists the tokens it accepts.

Header parameters

  • X-Org-Namestring

    Optional for every credential, a portal session token included: this listing is how a session finds the organizations it can name elsewhere. When sent, it is authorized as on any other route, so a handle the caller does not belong to is org_forbidden.

    • Pattern: ^[A-Za-z0-9._-]{1,255}$

Responses

200The organizations the caller is a member of, possibly emptyapplication/json
  • orgsarray of objectRequired

    3 properties
    • idintegerRequired

    • namestringRequired

    • rolestringRequired

      The caller's highest-privilege role in the organization.

      • Allowed values: owner, admin, member, viewer

400X-Org-Name is not a valid organization handle (invalid_org_assertion)

401Unauthorized

403Forbidden

Insufficient scope (insufficient_scope), or X-Org-Name names an organization the caller cannot act for (org_forbidden, org_assertion_mismatch, org_deleted)

500Internal server error

OpenAPIapi.spice.ai/openapi.json

curl "https://api.spice.ai/v1/orgs" \
  -H "Authorization: Bearer <token>"
{
  "orgs": [
    {
      "id": 0,
      "name": "string",
      "role": "owner"
    }
  ]
}

application/json