{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/notifly-io/json-schema/notifly-io-integration-response-dto-schema.json",
  "title": "IntegrationResponseDto",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/notifly-io-openapi.yml#/components/schemas/IntegrationResponseDto",
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "The unique identifier of the integration record in the database. This is automatically generated."
    },
    "_environmentId": {
      "type": "string",
      "description": "The unique identifier for the environment associated with this integration. This links to the Environment collection."
    },
    "_organizationId": {
      "type": "string",
      "description": "The unique identifier for the organization that owns this integration. This links to the Organization collection."
    },
    "name": {
      "type": "string",
      "description": "The name of the integration, which is used to identify it in the user interface."
    },
    "identifier": {
      "type": "string",
      "description": "A unique string identifier for the integration, often used for API calls or internal references."
    },
    "providerId": {
      "type": "string",
      "description": "The identifier for the provider of the integration (e.g., \"mailgun\", \"twilio\")."
    },
    "channel": {
      "type": "string",
      "description": "The channel type for the integration, which defines how it communicates (e.g., email, SMS). Not set for agent-kind integrations.",
      "enum": [
        "in_app",
        "email",
        "sms",
        "chat",
        "push",
        "tool"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Distinguishes delivery integrations from agent-runtime integrations. Defaults to \"delivery\". Agent integrations do not have a channel.",
      "enum": [
        "delivery",
        "agent"
      ]
    },
    "credentials": {
      "description": "The decrypted credentials required for the integration to function (e.g. provider API keys, signing secrets). Only returned to dashboard/session-token callers; API-key authenticated callers receive the integration metadata without this field to avoid amplifying API-key leaks into provider-credential leaks.",
      "allOf": [
        {
          "$ref": "#/$defs/CredentialsDto"
        }
      ]
    },
    "configurations": {
      "description": "The configurations required for enabling the additional configurations of the integration.",
      "allOf": [
        {
          "$ref": "#/$defs/ConfigurationsDto"
        }
      ]
    },
    "active": {
      "type": "boolean",
      "description": "Indicates whether the integration is currently active. An active integration will process events and messages."
    },
    "deleted": {
      "type": "boolean",
      "description": "Indicates whether the integration has been marked as deleted (soft delete)."
    },
    "deletedAt": {
      "type": "string",
      "description": "The timestamp indicating when the integration was deleted. This is set when the integration is soft deleted."
    },
    "deletedBy": {
      "type": "string",
      "description": "The identifier of the user who performed the deletion of this integration. Useful for audit trails."
    },
    "primary": {
      "type": "boolean",
      "description": "Indicates whether this integration is marked as primary. A primary integration is often the default choice for processing."
    },
    "conditions": {
      "description": "Legacy StepFilter conditions. Ignored when `rules` is also set.",
      "deprecated": true,
      "type": "array",
      "items": {
        "$ref": "#/$defs/StepFilterDto"
      }
    },
    "rules": {
      "type": [
        "object",
        "null"
      ],
      "description": "JSONLogic used at send time to select this integration. Takes precedence over `conditions`.",
      "additionalProperties": true
    }
  },
  "required": [
    "_environmentId",
    "_organizationId",
    "name",
    "identifier",
    "providerId",
    "active",
    "deleted",
    "primary"
  ],
  "$defs": {
    "BuilderFieldTypeEnum": {
      "type": "string",
      "enum": [
        "BOOLEAN",
        "TEXT",
        "DATE",
        "NUMBER",
        "STATEMENT",
        "LIST",
        "MULTI_LIST",
        "GROUP"
      ]
    },
    "ConfigurationsDto": {
      "type": "object",
      "properties": {
        "inboundWebhookEnabled": {
          "type": "boolean"
        },
        "inboundWebhookSigningKey": {
          "type": "string"
        },
        "payloadSchema": {
          "type": "string",
          "description": "JSON Schema describing the payload accepted by this integration."
        }
      }
    },
    "CredentialsDto": {
      "type": "object",
      "properties": {
        "apiKey": {
          "type": "string"
        },
        "user": {
          "type": "string"
        },
        "secretKey": {
          "type": "string"
        },
        "hmacSecretKeyEncoding": {
          "type": "string",
          "description": "Email webhook: how `secretKey` is interpreted when signing webhook calls. `text` signs with the raw UTF-8 bytes; `base64`/`hex` decode it to binary first (e.g. for AWS KMS).",
          "enum": [
            "text",
            "base64",
            "hex"
          ]
        },
        "authMethod": {
          "type": "string",
          "description": "Twilio: `apiKey` authenticates with `apiKey` (API Key SID) and `secretKey` (API Key Secret) on behalf of `accountSid`. When omitted, `token` (Auth Token) is used.",
          "enum": [
            "apiKey"
          ]
        },
        "domain": {
          "type": "string"
        },
        "password": {
          "type": "string"
        },
        "host": {
          "type": "string"
        },
        "port": {
          "type": "string"
        },
        "secure": {
          "type": "boolean"
        },
        "region": {
          "type": "string"
        },
        "accountSid": {
          "type": "string"
        },
        "messageProfileId": {
          "type": "string"
        },
        "token": {
          "type": "string"
        },
        "from": {
          "type": "string"
        },
        "senderName": {
          "type": "string"
        },
        "projectName": {
          "type": "string"
        },
        "applicationId": {
          "type": "string"
        },
        "clientId": {
          "type": "string"
        },
        "requireTls": {
          "type": "boolean"
        },
        "ignoreTls": {
          "type": "boolean"
        },
        "tlsOptions": {
          "type": "object"
        },
        "baseUrl": {
          "type": "string"
        },
        "webhookUrl": {
          "type": "string"
        },
        "redirectUrl": {
          "type": "string"
        },
        "hmac": {
          "type": "boolean"
        },
        "serviceAccount": {
          "type": "string"
        },
        "ipPoolName": {
          "type": "string"
        },
        "configurationSetName": {
          "type": "string"
        },
        "apiKeyRequestHeader": {
          "type": "string"
        },
        "secretKeyRequestHeader": {
          "type": "string"
        },
        "idPath": {
          "type": "string"
        },
        "datePath": {
          "type": "string"
        },
        "apiToken": {
          "type": "string"
        },
        "authenticateByToken": {
          "type": "boolean"
        },
        "authenticationTokenKey": {
          "type": "string"
        },
        "instanceId": {
          "type": "string"
        },
        "alertUid": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "externalLink": {
          "type": "string"
        },
        "channelId": {
          "type": "string"
        },
        "phoneNumberIdentification": {
          "type": "string"
        },
        "accessKey": {
          "type": "string"
        },
        "appSid": {
          "type": "string"
        },
        "senderId": {
          "type": "string"
        },
        "tenantId": {
          "type": "string"
        },
        "AppIOBaseUrl": {
          "type": "string"
        },
        "signingSecret": {
          "type": "string"
        },
        "outboundIntegrationId": {
          "type": "string"
        },
        "outboundConnectedAt": {
          "type": "string"
        },
        "whatsNextCompletedAt": {
          "type": "string",
          "description": "ISO timestamp marking Layer-2 What's next completion (Connected badge + guide hide). WhatsApp Business: stamped on post-connect Access Token rotation or manual confirm."
        },
        "useFromAddressOverride": {
          "type": "boolean"
        },
        "fromAddressOverride": {
          "type": "string"
        },
        "emailSlugPrefix": {
          "type": "string",
          "description": "Agent default shared inbox slug prefix used in `{emailSlugPrefix}-{agentId}@<shared-domain>`. Only meaningful on the NovuAgent email integration."
        },
        "externalEnvironmentId": {
          "type": "string",
          "description": "Claude Managed Agents: ID of the Anthropic environment tied to this integration. Hydrated by the API at integration provisioning time."
        },
        "externalVaultId": {
          "type": "string",
          "description": "Claude Managed Agents: ID of the Anthropic vault (`vlt_…`) tied to this integration. Hydrated by the API at integration provisioning time and used to push OAuth-completed MCP credentials to the per-vault credentials API."
        },
        "externalWorkspaceId": {
          "type": "string",
          "description": "Claude Managed Agents: id of the Anthropic workspace used in console deep links. Defaults to `'default'` (the Default Workspace). Set this when the API key is scoped to a custom workspace (e.g. `wrkspc_…`)."
        }
      }
    },
    "FieldFilterPartDto": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "operator": {
          "type": "string",
          "enum": [
            "LARGER",
            "SMALLER",
            "LARGER_EQUAL",
            "SMALLER_EQUAL",
            "EQUAL",
            "NOT_EQUAL",
            "ALL_IN",
            "ANY_IN",
            "NOT_IN",
            "BETWEEN",
            "NOT_BETWEEN",
            "LIKE",
            "NOT_LIKE",
            "IN"
          ]
        },
        "on": {
          "type": "string",
          "enum": [
            "subscriber",
            "payload"
          ]
        }
      },
      "required": [
        "field",
        "value",
        "operator",
        "on"
      ]
    },
    "StepFilterDto": {
      "type": "object",
      "properties": {
        "isNegated": {
          "type": "boolean"
        },
        "type": {
          "allOf": [
            {
              "$ref": "#/$defs/BuilderFieldTypeEnum"
            }
          ]
        },
        "value": {
          "type": "string",
          "enum": [
            "AND",
            "OR"
          ]
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FieldFilterPartDto"
          }
        }
      },
      "required": [
        "isNegated",
        "type",
        "value",
        "children"
      ]
    }
  }
}