{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-me-response-schema.json",
  "title": "MeResponse",
  "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/MeResponse",
  "type": "object",
  "required": [
    "user_id",
    "email",
    "email_verified",
    "onboarding_completed",
    "active_org_goals",
    "app_intros_seen",
    "prompts",
    "memberships",
    "totp_enabled",
    "password_set",
    "terms_accepted",
    "marketing_opt_in"
  ],
  "properties": {
    "active_org_goals": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Goals the active org picked at onboarding, in the order they were\npicked. The SPA orders the sidebar by them."
    },
    "active_org_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "app_intros_seen": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Apps whose welcome screen the user has already seen."
    },
    "deletion_scheduled_for": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the account will be erased, while a deletion is pending (30-day\ngrace period). The SPA shows a banner offering to cancel."
    },
    "email": {
      "type": "string"
    },
    "email_verified": {
      "type": "boolean"
    },
    "marketing_opt_in": {
      "type": "boolean",
      "description": "Whether the user opted in to product news and offers by e-mail."
    },
    "memberships": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MeMembership"
      }
    },
    "onboarding_completed": {
      "type": "boolean",
      "description": "Whether the active org completed the first-run wizard (`true` when no\norg is active). The SPA routes to `/onboarding` while it is `false`."
    },
    "password_set": {
      "type": "boolean",
      "description": "Whether the account has a password of its own. `false` for OAuth-only\naccounts, which set a first password without giving a current one."
    },
    "profile": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/MeProfile"
        }
      ]
    },
    "prompts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PromptStateView"
      },
      "description": "The user's history with the modals offered when opening the app."
    },
    "terms_accepted": {
      "type": "boolean",
      "description": "Whether the current terms (CGU/CGV/privacy) are accepted. `false` for a\nnew OAuth account and after a terms version bump: the SPA asks again."
    },
    "terms_accepted_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the terms were accepted."
    },
    "terms_version_accepted": {
      "type": [
        "string",
        "null"
      ],
      "description": "Version of the terms the user accepted, when recorded."
    },
    "totp_enabled": {
      "type": "boolean"
    },
    "user_id": {
      "type": "string",
      "format": "uuid"
    }
  },
  "$defs": {
    "MeMembership": {
      "type": "object",
      "required": [
        "org_id",
        "role"
      ],
      "properties": {
        "org_id": {
          "type": "string",
          "format": "uuid"
        },
        "role": {
          "type": "string"
        }
      }
    },
    "MeProfile": {
      "type": "object",
      "properties": {
        "avatar_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "URL of the profile photo, relative to the API origin; `None` when the\nuser has none."
        },
        "display_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "first_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "locale": {
          "type": [
            "string",
            "null"
          ],
          "description": "Preferred display language (`fr` | `en`); `None` means no explicit\npreference, leaving resolution to org default / navigator / `fr`."
        }
      }
    },
    "PromptStateView": {
      "type": "object",
      "description": "The user's history with one prompt, as `GET /v1/auth/me` reports it.",
      "required": [
        "key",
        "shown_count",
        "opted_out"
      ],
      "properties": {
        "key": {
          "type": "string",
          "description": "Prompt identifier (`pwa_install`, …)."
        },
        "last_shown_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When it was last displayed."
        },
        "opted_out": {
          "type": "boolean",
          "description": "Whether the user asked never to see it again."
        },
        "shown_count": {
          "type": "integer",
          "format": "int32",
          "description": "Times it was displayed."
        }
      }
    }
  }
}