{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/hookbase/main/json-schema/hookbase-created-source-schema.json",
  "title": "CreatedSource",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hookbase-openapi.json#/components/schemas/CreatedSource",
  "allOf": [
    {
      "$ref": "#/$defs/Source"
    },
    {
      "type": "object",
      "properties": {
        "signingSecret": {
          "type": [
            "string",
            "null"
          ],
          "description": "The full secret, returned only here. Hookbase-generated when omitted for providers that take an operator-chosen secret. null for built-in-key providers and for asana/notion until the vendor issues it."
        },
        "verifyToken": {
          "type": "string",
          "description": "WhatsApp only: the Meta Verify token, returned in full only here."
        }
      }
    }
  ],
  "$defs": {
    "Source": {
      "type": "object",
      "description": "A source. The full signing secret is never included except in the create response.",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "organizationId": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "provider": {
          "type": [
            "string",
            "null"
          ],
          "description": "Provider id selecting the signature scheme. null verifies as custom."
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "hasSigningSecret": {
          "type": "boolean",
          "description": "A signing secret is stored."
        },
        "signingSecretLast4": {
          "type": [
            "string",
            "null"
          ],
          "description": "Last four characters of the stored secret, e.g. \"...a1b2\"."
        },
        "awaitingSigningSecret": {
          "type": "boolean",
          "description": "true when the provider issues its secret only after the ingest URL is registered (asana, notion) and none is set yet. Events are accepted unverified until it is."
        },
        "verifiesWithoutSecret": {
          "type": "boolean",
          "description": "true when the provider is verified with a key Hookbase already has (wise, wise-sandbox, aws-sns); no secret is stored or needed."
        },
        "rejectInvalidSignatures": {
          "type": "boolean"
        },
        "rateLimitPerMinute": {
          "type": [
            "integer",
            "null"
          ]
        },
        "isActive": {
          "type": "boolean"
        },
        "customDomainId": {
          "type": [
            "string",
            "null"
          ]
        },
        "ipFilterMode": {
          "type": "string",
          "enum": [
            "none",
            "allowlist",
            "denylist",
            "both"
          ]
        },
        "ipAllowlist": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ipDenylist": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "encryptFields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "maskFields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dedupEnabled": {
          "type": "boolean"
        },
        "dedupStrategy": {
          "type": "string",
          "enum": [
            "auto",
            "provider_id",
            "payload_hash",
            "idempotency_key",
            "none"
          ]
        },
        "dedupWindowHours": {
          "type": "integer"
        },
        "dedupCustomHeader": {
          "type": [
            "string",
            "null"
          ]
        },
        "transientMode": {
          "type": "boolean"
        },
        "allowedMethods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "[] = any method."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "eventCount": {
          "type": "integer"
        },
        "routeCount": {
          "type": "integer"
        },
        "ingestUrl": {
          "type": "string",
          "description": "Get and create responses only."
        }
      }
    }
  }
}