{
  "openapi": "3.1.0",
  "info": {
    "title": "LemuAI API",
    "version": "1.0.12",
    "description": "The public LemuAI REST API. Docs: https://docs.lemuai.com/api-reference/overview"
  },
  "servers": [
    {
      "url": "https://app.lemuai.com"
    }
  ],
  "components": {
    "schemas": {
      "BatchItem": {
        "properties": {
          "data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Data"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "shopify_customer_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Shopify Customer Id"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          },
          "key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          }
        },
        "type": "object",
        "title": "BatchItem"
      },
      "BatchUpsert": {
        "properties": {
          "records": {
            "items": {
              "$ref": "#/components/schemas/BatchItem"
            },
            "type": "array",
            "maxItems": 1000,
            "minItems": 1,
            "title": "Records"
          }
        },
        "type": "object",
        "required": [
          "records"
        ],
        "title": "BatchUpsert"
      },
      "BulkUpsertContactItem": {
        "properties": {
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "first_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "First Name"
          },
          "last_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Name"
          },
          "company": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Company"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "custom_fields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Fields"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "title": "BulkUpsertContactItem",
        "description": "A single contact in a bulk upsert request.\n\nAny fields beyond the standard ones are automatically collected into custom_fields."
      },
      "BulkUpsertRequest": {
        "properties": {
          "list_name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "List Name",
            "description": "List to upsert into (created if it doesn't exist)"
          },
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/BulkUpsertContactItem"
            },
            "type": "array",
            "maxItems": 5000,
            "minItems": 1,
            "title": "Contacts",
            "description": "Contacts to upsert (max 5000)"
          }
        },
        "type": "object",
        "required": [
          "list_name",
          "contacts"
        ],
        "title": "BulkUpsertRequest",
        "description": "Schema for bulk upserting contacts into a named list."
      },
      "CallType": {
        "type": "string",
        "enum": [
          "inbound",
          "outbound"
        ],
        "title": "CallType"
      },
      "CampaignResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "workflow_id": {
            "type": "integer",
            "title": "Workflow Id"
          },
          "workflow_name": {
            "type": "string",
            "title": "Workflow Name"
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type"
          },
          "source_id": {
            "type": "string",
            "title": "Source Id"
          },
          "total_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Rows"
          },
          "processed_rows": {
            "type": "integer",
            "title": "Processed Rows"
          },
          "failed_rows": {
            "type": "integer",
            "title": "Failed Rows"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "retry_config": {
            "$ref": "#/components/schemas/RetryConfigResponse"
          },
          "schedule_config": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScheduleConfigResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "circuit_breaker": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CircuitBreakerConfigResponse"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "workflow_id",
          "workflow_name",
          "state",
          "source_type",
          "source_id",
          "total_rows",
          "processed_rows",
          "failed_rows",
          "created_at",
          "started_at",
          "completed_at",
          "retry_config"
        ],
        "title": "CampaignResponse"
      },
      "CampaignsResponse": {
        "properties": {
          "campaigns": {
            "items": {
              "$ref": "#/components/schemas/CampaignResponse"
            },
            "type": "array",
            "title": "Campaigns"
          }
        },
        "type": "object",
        "required": [
          "campaigns"
        ],
        "title": "CampaignsResponse"
      },
      "CircuitBreakerConfigResponse": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": false
          },
          "failure_threshold": {
            "type": "number",
            "title": "Failure Threshold",
            "default": 0.5
          },
          "window_seconds": {
            "type": "integer",
            "title": "Window Seconds",
            "default": 120
          },
          "min_calls_in_window": {
            "type": "integer",
            "title": "Min Calls In Window",
            "default": 5
          }
        },
        "type": "object",
        "title": "CircuitBreakerConfigResponse"
      },
      "ConsentChannel": {
        "type": "string",
        "enum": [
          "email",
          "sms",
          "whatsapp",
          "voice"
        ],
        "title": "ConsentChannel",
        "description": "Channels a contact can opt in to or out of."
      },
      "ConsentStatus": {
        "type": "string",
        "enum": [
          "subscribed",
          "unsubscribed"
        ],
        "title": "ConsentStatus",
        "description": "Consent state for one channel. No row at all means unknown."
      },
      "ContactActivityItem": {
        "properties": {
          "event_id": {
            "type": "string",
            "title": "Event Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "title": "Occurred At"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          },
          "anonymous_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anonymous Id"
          },
          "properties": {
            "additionalProperties": true,
            "type": "object",
            "title": "Properties"
          }
        },
        "type": "object",
        "required": [
          "event_id",
          "event_type",
          "occurred_at",
          "source"
        ],
        "title": "ContactActivityItem"
      },
      "ContactActivityResponse": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/ContactActivityItem"
            },
            "type": "array",
            "title": "Events"
          },
          "next_before": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Before"
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "ContactActivityResponse"
      },
      "ContactConsentResponse": {
        "properties": {
          "channel": {
            "$ref": "#/components/schemas/ConsentChannel"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConsentStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "source_detail": {
            "additionalProperties": true,
            "type": "object",
            "title": "Source Detail"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "can_contact": {
            "type": "boolean",
            "title": "Can Contact"
          }
        },
        "type": "object",
        "required": [
          "channel",
          "can_contact"
        ],
        "title": "ContactConsentResponse"
      },
      "ContactConsentUpdate": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/ConsentStatus"
          },
          "source": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Source",
            "default": "manual"
          },
          "source_detail": {
            "additionalProperties": true,
            "type": "object",
            "title": "Source Detail"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ContactConsentUpdate"
      },
      "ContactConsentsResponse": {
        "properties": {
          "contact_id": {
            "type": "integer",
            "title": "Contact Id"
          },
          "opted_out": {
            "type": "boolean",
            "title": "Opted Out"
          },
          "consents": {
            "items": {
              "$ref": "#/components/schemas/ContactConsentResponse"
            },
            "type": "array",
            "title": "Consents"
          }
        },
        "type": "object",
        "required": [
          "contact_id",
          "opted_out",
          "consents"
        ],
        "title": "ContactConsentsResponse"
      },
      "ContactEventItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "event_id": {
            "type": "string",
            "title": "Event Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "anonymous_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anonymous Id"
          },
          "event_data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Event Data"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "event_id",
          "event_type",
          "source",
          "phone",
          "contact_id",
          "contact_name",
          "event_data",
          "created_at"
        ],
        "title": "ContactEventItem"
      },
      "ContactListResponse": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the contact list"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Description of the contact list"
          },
          "list_metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "List Metadata",
            "description": "Additional metadata"
          },
          "column_schema": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Column Schema",
            "description": "Custom column definitions"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "organization_id": {
            "type": "integer",
            "title": "Organization Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "name",
          "id",
          "organization_id",
          "created_at",
          "updated_at"
        ],
        "title": "ContactListResponse",
        "description": "Schema for contact list response."
      },
      "ContactListSummary": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "title": "ContactListSummary",
        "description": "Minimal contact list info for embedding in contact responses."
      },
      "ContactListWithCountResponse": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "description": "Name of the contact list"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Description of the contact list"
          },
          "list_metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "List Metadata",
            "description": "Additional metadata"
          },
          "column_schema": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Column Schema",
            "description": "Custom column definitions"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "organization_id": {
            "type": "integer",
            "title": "Organization Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "member_count": {
            "type": "integer",
            "title": "Member Count",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "name",
          "id",
          "organization_id",
          "created_at",
          "updated_at"
        ],
        "title": "ContactListWithCountResponse",
        "description": "Schema for contact list response with member count."
      },
      "ContactMessageItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "channel": {
            "type": "string",
            "title": "Channel"
          },
          "direction": {
            "type": "string",
            "title": "Direction"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "provider_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Status"
          },
          "template_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Name"
          },
          "source_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Type"
          },
          "source_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Id"
          },
          "workflow_run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow Run Id"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "meta": {
            "additionalProperties": true,
            "type": "object",
            "title": "Meta"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "sent_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "read_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read At"
          },
          "failed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "channel",
          "direction",
          "status",
          "created_at"
        ],
        "title": "ContactMessageItem"
      },
      "ContactMessagesResponse": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/ContactMessageItem"
            },
            "type": "array",
            "title": "Messages"
          },
          "next_before_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Before Id"
          }
        },
        "type": "object",
        "title": "ContactMessagesResponse"
      },
      "ContactResponse": {
        "properties": {
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id",
            "description": "ID from external system (CRM, etc)"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "Phone number"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "Email address"
          },
          "first_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "First Name",
            "description": "First name"
          },
          "last_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Name",
            "description": "Last name"
          },
          "company": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Company",
            "description": "Company name"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Job title"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "List of tags for categorization"
          },
          "custom_fields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Fields",
            "description": "Custom fields as key-value pairs"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "organization_id": {
            "type": "integer",
            "title": "Organization Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "phone_last4": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Last4"
          },
          "phone_masked": {
            "type": "boolean",
            "title": "Phone Masked",
            "default": false
          },
          "metrics": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics"
          }
        },
        "type": "object",
        "required": [
          "id",
          "organization_id",
          "created_at",
          "updated_at"
        ],
        "title": "ContactResponse",
        "description": "Schema for contact response.\n\n``phone`` is masked (``\u2022\u2022\u2022\u2022 1234``) unless the caller may view PII\n(org owner/admin, or a team member with ``can_view_pii``). ``phone_masked``\ntells the client which it got; ``phone_last4`` is always available for\ndisplay."
      },
      "ContactUpsertRequest": {
        "properties": {
          "list_name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "List Name",
            "description": "Name of the contact list to add the contact to (created if it doesn't exist)"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "Phone number \u2014 used as the upsert key"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "first_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "First Name"
          },
          "last_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Name"
          },
          "company": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Company"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "custom_fields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Fields"
          }
        },
        "type": "object",
        "required": [
          "list_name"
        ],
        "title": "ContactUpsertRequest",
        "description": "Request body for POST /contacts/upsert."
      },
      "ContactUpsertResponse": {
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/ContactResponse"
          },
          "contact_list": {
            "$ref": "#/components/schemas/ContactListResponse"
          },
          "contact_created": {
            "type": "boolean",
            "title": "Contact Created"
          },
          "list_created": {
            "type": "boolean",
            "title": "List Created"
          }
        },
        "type": "object",
        "required": [
          "contact",
          "contact_list",
          "contact_created",
          "list_created"
        ],
        "title": "ContactUpsertResponse",
        "description": "Response body for POST /contacts/upsert."
      },
      "ContactWithListsResponse": {
        "properties": {
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id",
            "description": "ID from external system (CRM, etc)"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "Phone number"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "Email address"
          },
          "first_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "First Name",
            "description": "First name"
          },
          "last_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Name",
            "description": "Last name"
          },
          "company": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Company",
            "description": "Company name"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Job title"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "List of tags for categorization"
          },
          "custom_fields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Fields",
            "description": "Custom fields as key-value pairs"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "organization_id": {
            "type": "integer",
            "title": "Organization Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "phone_last4": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Last4"
          },
          "phone_masked": {
            "type": "boolean",
            "title": "Phone Masked",
            "default": false
          },
          "metrics": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics"
          },
          "lists": {
            "items": {
              "$ref": "#/components/schemas/ContactListSummary"
            },
            "type": "array",
            "title": "Lists"
          }
        },
        "type": "object",
        "required": [
          "id",
          "organization_id",
          "created_at",
          "updated_at"
        ],
        "title": "ContactWithListsResponse",
        "description": "Schema for contact response including list memberships."
      },
      "EventLogResponse": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/ContactEventItem"
            },
            "type": "array",
            "title": "Events"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "store": {
            "type": "string",
            "title": "Store",
            "default": "postgres"
          }
        },
        "type": "object",
        "required": [
          "events",
          "total"
        ],
        "title": "EventLogResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InboundEventRequest": {
        "properties": {
          "event_type": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Event Type",
            "description": "e.g. cart_added, order_placed"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone",
            "description": "Contact phone \u2014 used to resolve/upsert the contact"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "Contact email \u2014 used to resolve the contact"
          },
          "anonymous_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Anonymous Id",
            "description": "Website pixel / SDK visitor id \u2014 links anonymous activity"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id",
            "description": "Your own id for this person (CRM, backend)"
          },
          "list_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "List Name",
            "description": "If provided, upserts the contact into this list"
          },
          "data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data",
            "description": "Arbitrary event payload"
          }
        },
        "type": "object",
        "required": [
          "event_type"
        ],
        "title": "InboundEventRequest",
        "description": "Body for POST /events."
      },
      "InboundEventResponse": {
        "properties": {
          "event_id": {
            "type": "integer",
            "title": "Event Id"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          },
          "triggered_workflows": {
            "type": "integer",
            "title": "Triggered Workflows"
          }
        },
        "type": "object",
        "required": [
          "event_id",
          "contact_id",
          "triggered_workflows"
        ],
        "title": "InboundEventResponse",
        "description": "Response for POST /events."
      },
      "PaginatedContactListsResponse": {
        "properties": {
          "lists": {
            "items": {
              "$ref": "#/components/schemas/ContactListWithCountResponse"
            },
            "type": "array",
            "title": "Lists"
          },
          "total_count": {
            "type": "integer",
            "title": "Total Count"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "total_pages": {
            "type": "integer",
            "title": "Total Pages"
          }
        },
        "type": "object",
        "required": [
          "lists",
          "total_count",
          "page",
          "limit",
          "total_pages"
        ],
        "title": "PaginatedContactListsResponse",
        "description": "Paginated response for contact lists."
      },
      "PaginatedContactsResponse": {
        "properties": {
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/ContactResponse"
            },
            "type": "array",
            "title": "Contacts"
          },
          "total_count": {
            "type": "integer",
            "title": "Total Count"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "total_pages": {
            "type": "integer",
            "title": "Total Pages"
          }
        },
        "type": "object",
        "required": [
          "contacts",
          "total_count",
          "page",
          "limit",
          "total_pages"
        ],
        "title": "PaginatedContactsResponse",
        "description": "Paginated response for contacts."
      },
      "RecordUpsert": {
        "properties": {
          "data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Data"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "external_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "External Id"
          },
          "shopify_customer_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Shopify Customer Id"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          }
        },
        "type": "object",
        "title": "RecordUpsert",
        "description": "One record: its fields, and its owner for a new record (any of the\nidentifiers ``POST /events`` takes, or a contact id)."
      },
      "RetryConfigResponse": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "max_retries": {
            "type": "integer",
            "title": "Max Retries"
          },
          "retry_delay_seconds": {
            "type": "integer",
            "title": "Retry Delay Seconds"
          },
          "retry_on_busy": {
            "type": "boolean",
            "title": "Retry On Busy"
          },
          "retry_on_no_answer": {
            "type": "boolean",
            "title": "Retry On No Answer"
          },
          "retry_on_voicemail": {
            "type": "boolean",
            "title": "Retry On Voicemail"
          }
        },
        "type": "object",
        "required": [
          "enabled",
          "max_retries",
          "retry_delay_seconds",
          "retry_on_busy",
          "retry_on_no_answer",
          "retry_on_voicemail"
        ],
        "title": "RetryConfigResponse"
      },
      "ScheduleConfigResponse": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "timezone": {
            "type": "string",
            "title": "Timezone"
          },
          "slots": {
            "items": {
              "$ref": "#/components/schemas/TimeSlotResponse"
            },
            "type": "array",
            "title": "Slots"
          }
        },
        "type": "object",
        "required": [
          "enabled",
          "timezone",
          "slots"
        ],
        "title": "ScheduleConfigResponse"
      },
      "TimeSlotResponse": {
        "properties": {
          "day_of_week": {
            "type": "integer",
            "title": "Day Of Week"
          },
          "start_time": {
            "type": "string",
            "title": "Start Time"
          },
          "end_time": {
            "type": "string",
            "title": "End Time"
          }
        },
        "type": "object",
        "required": [
          "day_of_week",
          "start_time",
          "end_time"
        ],
        "title": "TimeSlotResponse"
      },
      "TransactionalSend": {
        "properties": {
          "template_id": {
            "type": "integer",
            "title": "Template Id"
          },
          "to": {
            "type": "string",
            "maxLength": 320,
            "minLength": 3,
            "title": "To"
          },
          "data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Data"
          },
          "sender_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sender Id"
          },
          "template_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Version"
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 998
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject"
          }
        },
        "type": "object",
        "required": [
          "template_id",
          "to"
        ],
        "title": "TransactionalSend"
      },
      "TriggerCallRequest": {
        "properties": {
          "phone_number": {
            "type": "string",
            "title": "Phone Number"
          },
          "initial_context": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Context"
          }
        },
        "type": "object",
        "required": [
          "phone_number"
        ],
        "title": "TriggerCallRequest",
        "description": "Request model for triggering a call via API"
      },
      "TriggerCallResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "workflow_run_id": {
            "type": "integer",
            "title": "Workflow Run Id"
          },
          "workflow_run_name": {
            "type": "string",
            "title": "Workflow Run Name"
          }
        },
        "type": "object",
        "required": [
          "status",
          "workflow_run_id",
          "workflow_run_name"
        ],
        "title": "TriggerCallResponse",
        "description": "Response model for successful call initiation"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WebhookTriggerResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Status message"
          },
          "trigger_id": {
            "type": "integer",
            "title": "Trigger Id",
            "description": "ID of the fired trigger"
          },
          "workflow_id": {
            "type": "integer",
            "title": "Workflow Id",
            "description": "ID of the triggered workflow"
          },
          "queued": {
            "type": "boolean",
            "title": "Queued",
            "description": "Whether the execution was queued"
          }
        },
        "type": "object",
        "required": [
          "message",
          "trigger_id",
          "workflow_id",
          "queued"
        ],
        "title": "WebhookTriggerResponse",
        "description": "Response from a webhook trigger."
      },
      "WhatsAppMessageOut": {
        "properties": {
          "message_id": {
            "type": "integer",
            "title": "Message Id"
          },
          "provider_message_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Message Id"
          },
          "direction": {
            "type": "string",
            "title": "Direction"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "To"
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Id"
          },
          "template_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Name"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "sent_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "read_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read At"
          },
          "clicked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clicked At"
          },
          "failed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed At"
          }
        },
        "type": "object",
        "required": [
          "message_id",
          "direction",
          "status",
          "created_at"
        ],
        "title": "WhatsAppMessageOut"
      },
      "WhatsAppTemplateSend": {
        "properties": {
          "to": {
            "type": "string",
            "maxLength": 32,
            "minLength": 8,
            "title": "To"
          },
          "template_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Id"
          },
          "template_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Name"
          },
          "language": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16,
                "minLength": 2
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "variables": {
            "additionalProperties": true,
            "type": "object",
            "maxProperties": 100,
            "title": "Variables"
          },
          "header_text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Text"
          },
          "header_media_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Media Url"
          },
          "header_filename": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 240
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Filename"
          },
          "button_url_value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Button Url Value"
          },
          "coupon_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 15
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupon Code"
          },
          "thumbnail_product_retailer_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Thumbnail Product Retailer Id"
          },
          "product_retailer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 30,
            "title": "Product Retailer Ids"
          },
          "from": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "From"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "to"
        ],
        "title": "WhatsAppTemplateSend"
      },
      "WorkflowListResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "total_runs": {
            "type": "integer",
            "title": "Total Runs"
          },
          "workflow_uuid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workflow Uuid"
          },
          "last_run_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run At"
          },
          "success_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Success Rate"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "created_at",
          "total_runs"
        ],
        "title": "WorkflowListResponse",
        "description": "Lightweight response for workflow listings (excludes large fields)."
      },
      "WorkflowRunResponseSchema": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "workflow_id": {
            "type": "integer",
            "title": "Workflow Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "mode": {
            "type": "string",
            "title": "Mode"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "is_completed": {
            "type": "boolean",
            "title": "Is Completed"
          },
          "transcript_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcript Url"
          },
          "recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Url"
          },
          "user_recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Recording Url"
          },
          "bot_recording_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bot Recording Url"
          },
          "transcript_public_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcript Public Url"
          },
          "recording_public_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recording Public Url"
          },
          "user_recording_public_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Recording Public Url"
          },
          "bot_recording_public_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bot Recording Public Url"
          },
          "public_access_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Public Access Token"
          },
          "cost_info": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Info"
          },
          "usage_info": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usage Info"
          },
          "definition_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Definition Id"
          },
          "initial_context": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Context"
          },
          "gathered_context": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gathered Context"
          },
          "call_type": {
            "$ref": "#/components/schemas/CallType"
          },
          "logs": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logs"
          },
          "annotations": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Annotations"
          }
        },
        "type": "object",
        "required": [
          "id",
          "workflow_id",
          "name",
          "mode",
          "created_at",
          "is_completed",
          "transcript_url",
          "recording_url",
          "cost_info",
          "definition_id",
          "call_type"
        ],
        "title": "WorkflowRunResponseSchema"
      },
      "WorkflowRunsResponse": {
        "properties": {
          "runs": {
            "items": {
              "$ref": "#/components/schemas/WorkflowRunResponseSchema"
            },
            "type": "array",
            "title": "Runs"
          },
          "total_count": {
            "type": "integer",
            "title": "Total Count"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "total_pages": {
            "type": "integer",
            "title": "Total Pages"
          },
          "applied_filters": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Applied Filters"
          }
        },
        "type": "object",
        "required": [
          "runs",
          "total_count",
          "page",
          "limit",
          "total_pages"
        ],
        "title": "WorkflowRunsResponse"
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/api/v1/public/agent/{uuid}": {
      "post": {
        "summary": "Trigger an outbound call",
        "description": "Initiate a phone call via API trigger.\n\nThis endpoint allows external systems (CRMs, automation tools, etc.) to\nprogrammatically trigger outbound phone calls with custom context variables.\n\nArgs:\n    uuid: The unique trigger UUID\n    request: The call request with phone number and optional context\n    x_api_key: API key for authentication (passed in X-API-Key header)\n\nReturns:\n    TriggerCallResponse with workflow run details\n\nRaises:\n    HTTPException: Various error conditions (401, 403, 404, 400)",
        "operationId": "initiate_call_api_v1_public_agent__uuid__post",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerCallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerCallResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/calls/trigger"
        }
      }
    },
    "/api/v1/events": {
      "post": {
        "tags": [
          "events"
        ],
        "summary": "Send an event",
        "description": "Ingest an inbound contact event and trigger matching automation workflows.\n\nThe contact is resolved from any of phone, email, anonymous_id or\nexternal_id (merging contacts they prove are one person); a new contact\nis only created when a phone or email is given. If `list_name`\nis provided the contact is added to that list (created if it doesn't\nexist).\nAfter storing the event, any active `contact_event` triggers whose\n`event_type` matches are scheduled for deferred execution.",
        "operationId": "ingest_event_api_v1_events_post",
        "parameters": [
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboundEventRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEventResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/events/trigger"
        }
      },
      "get": {
        "tags": [
          "events"
        ],
        "summary": "List events",
        "description": "Recent events of every source for the org, newest first: from the\nevent store when it is on (it also holds website visits by visitors not\nyet known), otherwise from contact_events.",
        "operationId": "list_events_api_v1_events_get",
        "parameters": [
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Event Type"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only events from this source (api, shopify, pixel, \u2026)",
              "title": "Source"
            },
            "description": "Only events from this source (api, shopify, pixel, \u2026)"
          },
          {
            "name": "include_message_updates",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Also list message status updates (message_sent, \u2026); event store only",
              "default": false,
              "title": "Include Message Updates"
            },
            "description": "Also list message status updates (message_sent, \u2026); event store only"
          },
          {
            "name": "phone",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Legacy phone-only filter",
              "title": "Phone"
            },
            "description": "Legacy phone-only filter"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search phone, contact name, or event type",
              "title": "Search"
            },
            "description": "Search phone, contact name, or event type"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start (YYYY-MM-DD or ISO datetime)",
              "title": "Start Date"
            },
            "description": "Inclusive start (YYYY-MM-DD or ISO datetime)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end (YYYY-MM-DD or ISO datetime)",
              "title": "End Date"
            },
            "description": "Inclusive end (YYYY-MM-DD or ISO datetime)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "unique_by_phone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Collapse to one row per distinct phone number (the most recent event for that number), instead of one row per event. Used by the Contacts page's 'Event Contacts' view, which is about contacts, not a raw event log.",
              "default": false,
              "title": "Unique By Phone"
            },
            "description": "Collapse to one row per distinct phone number (the most recent event for that number), instead of one row per event. Used by the Contacts page's 'Event Contacts' view, which is about contacts, not a raw event log."
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventLogResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/events/list"
        }
      }
    },
    "/api/v1/workflow/fetch": {
      "get": {
        "summary": "List agents",
        "description": "Get all workflows for the authenticated user's organization.\n\nReturns a lightweight response with only essential fields for listing.\nUse GET /workflow/fetch/{workflow_id} to get full workflow details.",
        "operationId": "get_workflows_api_v1_workflow_fetch_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status - can be single value (active/archived) or comma-separated (active,archived)",
              "title": "Status"
            },
            "description": "Filter by status - can be single value (active/archived) or comma-separated (active,archived)"
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkflowListResponse"
                  },
                  "title": "Response Get Workflows Api V1 Workflow Fetch Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/agents/list"
        }
      }
    },
    "/api/v1/workflow/{workflow_id}/runs": {
      "get": {
        "summary": "List calls",
        "description": "Get workflow runs with optional filtering and sorting.\n\nFilters should be provided as a JSON-encoded array of filter criteria.\nExample: [{\"attribute\": \"dateRange\", \"value\": {\"from\": \"2024-01-01\", \"to\": \"2024-01-31\"}}]",
        "operationId": "get_workflow_runs_api_v1_workflow__workflow_id__runs_get",
        "parameters": [
          {
            "name": "workflow_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workflow Id"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "JSON-encoded filter criteria",
              "title": "Filters"
            },
            "description": "JSON-encoded filter criteria"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Field to sort by (e.g., 'duration', 'created_at')",
              "title": "Sort By"
            },
            "description": "Field to sort by (e.g., 'duration', 'created_at')"
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort order ('asc' or 'desc')",
              "default": "desc",
              "title": "Sort Order"
            },
            "description": "Sort order ('asc' or 'desc')"
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowRunsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/agents/runs/list"
        }
      }
    },
    "/api/v1/campaign/": {
      "get": {
        "summary": "List campaigns",
        "description": "Get campaigns for user's organization",
        "operationId": "get_campaigns_api_v1_campaign__get",
        "parameters": [
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/campaigns/list"
        }
      }
    },
    "/api/v1/contacts": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "List contacts",
        "description": "All the organization's contacts (or one list's), newest first, with\noptional filters, search, sorting and pagination.",
        "operationId": "list_contacts_api_v1_contacts_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "description": "Items per page",
              "default": 50,
              "title": "Limit"
            },
            "description": "Items per page"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search in name, email, phone (any format), company, external id",
              "title": "Search"
            },
            "description": "Search in name, email, phone (any format), company, external id"
          },
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated tags to filter by",
              "title": "Tags"
            },
            "description": "Comma-separated tags to filter by"
          },
          {
            "name": "has_email",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter contacts with/without email",
              "title": "Has Email"
            },
            "description": "Filter contacts with/without email"
          },
          {
            "name": "has_phone",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter contacts with/without phone",
              "title": "Has Phone"
            },
            "description": "Filter contacts with/without phone"
          },
          {
            "name": "list_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter contacts in a specific list",
              "title": "List Id"
            },
            "description": "Filter contacts in a specific list"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Column to sort by",
              "default": "created_at",
              "title": "Sort By"
            },
            "description": "Column to sort by"
          },
          {
            "name": "sort_dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(asc|desc)$",
              "description": "Sort direction",
              "default": "desc",
              "title": "Sort Dir"
            },
            "description": "Sort direction"
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedContactsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/list"
        }
      }
    },
    "/api/v1/contacts/bulk-upsert": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Bulk upsert contacts",
        "description": "Bulk upsert contacts into a named list (up to 5000 at a time).\n\nMatches each contact by phone then external_id. Creates if not found,\nupdates if found. An external_id that belongs to a contact with a\ndifferent phone isn't a match: the row is added as a new contact without\nit and listed in ``warnings``. The list is created automatically if it\ndoesn't exist.",
        "operationId": "bulk_upsert_contacts_api_v1_contacts_bulk_upsert_post",
        "parameters": [
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/bulk-upsert"
        }
      }
    },
    "/api/v1/contacts/upsert": {
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "Upsert a contact",
        "description": "Upsert a contact and add it to a named list.\n\nLooks up the contact by phone number within the org. If found, merges\ncustom_fields and updates any provided scalar fields. If not found, creates\nthe contact. The list is found or created by name. Returns the contact, the\nlist, and flags indicating whether each was newly created.",
        "operationId": "upsert_contact_api_v1_contacts_upsert_post",
        "parameters": [
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactUpsertResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/upsert"
        }
      }
    },
    "/api/v1/contacts/lists": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "List contact lists",
        "description": "List contact lists for the organization with pagination.",
        "operationId": "list_contact_lists_api_v1_contacts_lists_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Items per page",
              "default": 50,
              "title": "Limit"
            },
            "description": "Items per page"
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedContactListsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/lists"
        }
      }
    },
    "/api/v1/contacts/lists/{list_id}/contacts": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "List contacts in a list",
        "description": "Get contacts in a list with pagination, sorting, and search.",
        "operationId": "get_list_contacts_api_v1_contacts_lists__list_id__contacts_get",
        "parameters": [
          {
            "name": "list_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "List Id"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Items per page",
              "default": 25,
              "title": "Limit"
            },
            "description": "Items per page"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Column to sort by",
              "default": "added_at",
              "title": "Sort By"
            },
            "description": "Column to sort by"
          },
          {
            "name": "sort_dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(asc|desc)$",
              "description": "Sort direction",
              "default": "desc",
              "title": "Sort Dir"
            },
            "description": "Sort direction"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search in name, phone, email, company",
              "title": "Search"
            },
            "description": "Search in name, phone, email, company"
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedContactsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/list-members"
        }
      }
    },
    "/api/v1/contacts/{contact_id}": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Get a contact",
        "description": "Get a contact by ID, including list memberships.",
        "operationId": "get_contact_api_v1_contacts__contact_id__get",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Contact Id"
            }
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactWithListsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/get"
        }
      }
    },
    "/api/v1/contacts/{contact_id}/consents": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Contact consent",
        "description": "Consent state for every channel, including channels never recorded.",
        "operationId": "get_contact_consents_api_v1_contacts__contact_id__consents_get",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Contact Id"
            }
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactConsentsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/consents"
        }
      }
    },
    "/api/v1/contacts/{contact_id}/consents/{channel}": {
      "put": {
        "tags": [
          "contacts"
        ],
        "summary": "Set contact consent",
        "description": "Record an opt-in or opt-out for one channel (kept in the consent history).",
        "operationId": "set_contact_consent_api_v1_contacts__contact_id__consents__channel__put",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Contact Id"
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ConsentChannel"
            }
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactConsentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactConsentsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/consents"
        }
      }
    },
    "/api/v1/contacts/{contact_id}/activity": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Contact activity",
        "description": "Everything this person did, newest first \u2014 including activity recorded\nagainst contacts that were later merged into this one, and website visits\nfrom before they signed in.",
        "operationId": "get_contact_activity_api_v1_contacts__contact_id__activity_get",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Contact Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only events before this time (for paging)",
              "title": "Before"
            },
            "description": "Only events before this time (for paging)"
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactActivityResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/activity"
        }
      }
    },
    "/api/v1/contacts/{contact_id}/messages": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "Contact messages",
        "description": "Every message to or from this person on any channel (calls included),\nnewest first, with delivery status.",
        "operationId": "list_contact_messages_api_v1_contacts__contact_id__messages_get",
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Contact Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only messages older than this one (for paging)",
              "title": "Before Id"
            },
            "description": "Only messages older than this one (for paging)"
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactMessagesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/contacts/messages"
        }
      }
    },
    "/api/v1/objects/{api_name}/records/{key}": {
      "put": {
        "tags": [
          "objects"
        ],
        "summary": "Create or update a record",
        "description": "Create or update one record. Fields sent replace, fields not sent\nare kept, ``null`` clears a field.",
        "operationId": "upsert_record_api_v1_objects__api_name__records__key__put",
        "parameters": [
          {
            "name": "api_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Api Name"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/records/upsert"
        }
      }
    },
    "/api/v1/objects/{api_name}/records/batch": {
      "post": {
        "tags": [
          "objects"
        ],
        "summary": "Create or update records in bulk",
        "description": "Up to 1,000 records; each row succeeds or fails on its own.",
        "operationId": "upsert_batch_api_v1_objects__api_name__records_batch_post",
        "parameters": [
          {
            "name": "api_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Api Name"
            }
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/records/batch"
        }
      }
    },
    "/api/v1/email/send": {
      "post": {
        "tags": [
          "email"
        ],
        "summary": "Send a transactional email",
        "description": "Send a transactional email (order, shipping, account) from a template.\nMarketing mail goes through journeys and campaigns, not this API.",
        "operationId": "send_transactional_api_v1_email_send_post",
        "parameters": [
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionalSend"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Send Transactional Api V1 Email Send Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/email/send"
        }
      }
    },
    "/api/v1/workflow-execution/webhooks/{trigger_id}": {
      "post": {
        "tags": [
          "workflow-execution"
        ],
        "summary": "Start a journey with a webhook",
        "description": "Receive an external webhook request and fire the associated workflow trigger.",
        "operationId": "webhook_trigger_api_v1_workflow_execution_webhooks__trigger_id__post",
        "parameters": [
          {
            "name": "trigger_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Trigger Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "default": {},
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTriggerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/webhooks"
        },
        "security": []
      }
    },
    "/api/v1/whatsapp/messages/template": {
      "post": {
        "tags": [
          "whatsapp"
        ],
        "summary": "Send a WhatsApp template",
        "description": "Send one approved WhatsApp template to one number. Values for the\ntemplate's variables go in ``variables`` ({\"1\": \"Priya\"} for {{1}}, or\n{\"customer_name\": \"Priya\"} for a template with named variables). Paid\nfrom the WhatsApp balance; never sent to a contact who opted out.",
        "operationId": "send_template_api_v1_whatsapp_messages_template_post",
        "parameters": [
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsAppTemplateSend"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Send Template Api V1 Whatsapp Messages Template Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/whatsapp/send-template"
        }
      }
    },
    "/api/v1/whatsapp/messages/{message_id}": {
      "get": {
        "tags": [
          "whatsapp"
        ],
        "summary": "Get a WhatsApp message",
        "description": "A WhatsApp message's status, by LemuAI's ``message_id`` (a number) or\nWhatsApp's id (``wamid.\u2026``).",
        "operationId": "get_message_api_v1_whatsapp_messages__message_id__get",
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Message Id"
            }
          },
          {
            "name": "pixel_auth_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pixel Auth Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppMessageOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.lemuai.com/api-reference/whatsapp/get-message"
        }
      }
    }
  }
}
