{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/converly-io/json-schema/converly-io-signup-response-schema.json",
  "title": "SignupResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/converly-io-signup-api-openapi.yml#/components/schemas/SignupResponse",
  "type": "object",
  "properties": {
    "already_bootstrapped": {
      "type": "boolean",
      "description": "False on fresh bootstrap (HTTP 201). True on idempotent no-op (HTTP 200)."
    },
    "account_id": {
      "$ref": "#/$defs/AccountId"
    },
    "user_id": {
      "$ref": "#/$defs/UserId"
    },
    "site_id": {
      "allOf": [
        {
          "$ref": "#/$defs/SiteId"
        },
        {
          "type": [
            "string",
            "null"
          ]
        }
      ]
    },
    "api_key": {
      "allOf": [
        {
          "$ref": "#/$defs/SignupApiKey"
        },
        {
          "type": [
            "object",
            "null"
          ],
          "description": "Present only on fresh bootstrap AND when mint_initial_api_key was true. Null on idempotent no-ops (a retry never mints an additional key)."
        }
      ]
    }
  },
  "required": [
    "already_bootstrapped",
    "account_id",
    "user_id",
    "site_id",
    "api_key"
  ],
  "$defs": {
    "AccountId": {
      "type": "string",
      "pattern": "^acct_[0-9A-Za-z]{22}$",
      "description": "Prefixed account id, e.g. acct_xxxxxx"
    },
    "ApiKeyId": {
      "type": "string",
      "pattern": "^key_[0-9A-Za-z]{22}$",
      "description": "Prefixed API key id, e.g. key_xxxxxx"
    },
    "SignupApiKey": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/ApiKeyId"
        },
        "plaintext": {
          "type": "string",
          "description": "sk_live_* plaintext — returned once, never again."
        },
        "prefix": {
          "type": "string",
          "description": "First 12 chars (safe to log / display)."
        }
      },
      "required": [
        "id",
        "plaintext",
        "prefix"
      ]
    },
    "SiteId": {
      "type": "string",
      "pattern": "^site_[0-9A-Za-z]{22}$",
      "description": "Prefixed site id, e.g. site_xxxxxx"
    },
    "UserId": {
      "type": "string",
      "pattern": "^usr_[0-9A-Za-z]{22}$",
      "description": "Prefixed user id, e.g. usr_xxxxxx"
    }
  }
}