{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/groundmail-dev/json-schema/groundmail-dev-oauth-token-response-schema.json",
  "title": "OAuthTokenResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/groundmail-dev-oauth-api-openapi.yml#/components/schemas/OAuthTokenResponse",
  "type": "object",
  "required": [
    "access_token",
    "token_type",
    "expires_in",
    "refresh_token",
    "scope"
  ],
  "properties": {
    "access_token": {
      "type": "string",
      "description": "Bearer token for the API (`gm_oat_…`)"
    },
    "token_type": {
      "type": "string",
      "enum": [
        "Bearer"
      ]
    },
    "expires_in": {
      "type": "integer"
    },
    "refresh_token": {
      "type": "string",
      "description": "Single-use; store the new one each time"
    },
    "scope": {
      "type": "string"
    },
    "workspace": {
      "type": "object",
      "description": "Device grant only",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "user": {
      "type": "object",
      "description": "Device grant only",
      "properties": {
        "id": {
          "type": "string"
        },
        "email": {
          "type": "string"
        }
      }
    }
  }
}