{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-auth-context-response-schema.json",
  "title": "AuthContextResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asap-cool-auth-api-openapi.yml#/components/schemas/AuthContextResponse",
  "type": "object",
  "required": [
    "memberships"
  ],
  "properties": {
    "active_org_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Active org for this caller. Present for token principals (API key /\nOAuth, where it is fixed at issuance) and for session callers that have\nselected an org; `None` only for a session with no active org."
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "description": "Signed-in user email — `None` for token principals."
    },
    "memberships": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MeMembership"
      },
      "description": "Org memberships of the signed-in user — empty for token principals."
    },
    "user_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Signed-in user id — `None` for token principals (API key / OAuth),\nwhich authenticate an org rather than a user."
    }
  },
  "$defs": {
    "MeMembership": {
      "type": "object",
      "required": [
        "org_id",
        "role"
      ],
      "properties": {
        "org_id": {
          "type": "string",
          "format": "uuid"
        },
        "role": {
          "type": "string"
        }
      }
    }
  }
}