{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codeatlas-com-br/json-schema/codeatlas-com-br-service-auth-response-schema.json",
  "title": "ServiceAuthResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codeatlas-com-br-openapi.yml#/components/schemas/ServiceAuthResponse",
  "type": "object",
  "required": [
    "registration_id",
    "registration_type",
    "claim_token",
    "claim_token_expires",
    "claim_url",
    "post_claim_scopes",
    "claim"
  ],
  "properties": {
    "registration_id": {
      "type": "string"
    },
    "registration_type": {
      "type": "string",
      "const": "service_auth"
    },
    "claim_token": {
      "type": "string",
      "description": "Returned once. Keep in memory for the ceremony."
    },
    "claim_token_expires": {
      "type": "string",
      "format": "date-time"
    },
    "claim_url": {
      "type": "string",
      "format": "uri"
    },
    "post_claim_scopes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "claim": {
      "type": "object",
      "required": [
        "user_code",
        "verification_uri",
        "expires_in",
        "interval"
      ],
      "properties": {
        "user_code": {
          "type": "string",
          "pattern": "^[0-9]{6}$"
        },
        "verification_uri": {
          "type": "string",
          "format": "uri"
        },
        "expires_in": {
          "type": "integer",
          "const": 600
        },
        "interval": {
          "type": "integer",
          "const": 5
        }
      }
    }
  },
  "additionalProperties": false
}