{
  "openapi": "3.0.3",
  "info": {
    "title": "Pocketflows API",
    "version": "0.0.4"
  },
  "servers": [
    {
      "url": "https://api.pocketflows.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/available_steps": {
      "get": {
        "responses": {
          "200": {
            "description": "A dictionary with an `available_steps` property which are the available steps for the project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available_steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The unique identifier of the step"
                          },
                          "type": {
                            "type": "string",
                            "description": "The type of the step"
                          },
                          "display_text": {
                            "type": "string",
                            "description": "The displayable name of the step"
                          },
                          "image_urls_supported": {
                            "type": "boolean",
                            "description": "Whether the step supports image URLs"
                          },
                          "custom_step_id": {
                            "type": "string",
                            "description": "The ID of the custom step if this is a custom step"
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "display_text"
                        ]
                      },
                      "description": "An array of available steps"
                    }
                  },
                  "required": [
                    "available_steps"
                  ]
                }
              }
            }
          }
        },
        "summary": "List the available steps for a project",
        "tags": [
          "Projects"
        ]
      }
    },
    "/project": {
      "get": {
        "responses": {
          "200": {
            "description": "A `Project` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          }
        },
        "summary": "Retrieve a project",
        "tags": [
          "Projects"
        ]
      }
    },
    "/businesses/{id}/segment_usage": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "query",
            "name": "start_time",
            "schema": {
              "type": "string"
            },
            "description": "The start time of the usage period. Provided as a string in ISO 8601 format.",
            "required": false
          },
          {
            "in": "query",
            "name": "end_time",
            "schema": {
              "type": "string"
            },
            "description": "The end time of the usage period. Provided as a string in ISO 8601 format.",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "The segment usage for the business within the time window",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sms": {
                      "type": "integer",
                      "description": "The number of SMS segments sent"
                    },
                    "mms": {
                      "type": "integer",
                      "description": "The number of MMS segments sent"
                    },
                    "email": {
                      "type": "integer",
                      "description": "The number of email segments sent"
                    },
                    "scheduled_segment_usage": {
                      "type": "object",
                      "properties": {
                        "sms": {
                          "type": "integer",
                          "description": "The number of scheduled SMS segments"
                        },
                        "mms": {
                          "type": "integer",
                          "description": "The number of scheduled MMS segments"
                        },
                        "email": {
                          "type": "integer",
                          "description": "The number of scheduled email segments"
                        }
                      },
                      "required": [
                        "sms",
                        "mms",
                        "email"
                      ],
                      "description": "The scheduled segment usage for campaigns not yet sent"
                    },
                    "in_progress_segment_usage": {
                      "type": "object",
                      "properties": {
                        "sms": {
                          "type": "integer",
                          "description": "The number of in-progress SMS segments remaining"
                        },
                        "mms": {
                          "type": "integer",
                          "description": "The number of in-progress MMS segments remaining"
                        },
                        "email": {
                          "type": "integer",
                          "description": "The number of in-progress email segments remaining"
                        }
                      },
                      "required": [
                        "sms",
                        "mms",
                        "email"
                      ],
                      "description": "The estimated segment usage for in-progress campaigns"
                    },
                    "start_time": {
                      "type": "string",
                      "description": "The start time of the usage period in ISO 8601 format"
                    },
                    "end_time": {
                      "type": "string",
                      "description": "The end time of the usage period in ISO 8601 format"
                    }
                  },
                  "required": [
                    "sms",
                    "mms",
                    "email",
                    "scheduled_segment_usage",
                    "in_progress_segment_usage",
                    "start_time",
                    "end_time"
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve the segment usage for a business",
        "tags": [
          "Segment usage"
        ]
      }
    },
    "/project_defined_events": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "description": "The event name. Likely takes the form `customer.created` or similar"
                  },
                  "display_text": {
                    "type": "string",
                    "description": "The human-readable text for this event. Should grammatically follow \"When...\" e.g. \"a customer is created\""
                  },
                  "purchase_amount_path": {
                    "type": "string",
                    "description": "Path for extracting purchase amount from event data"
                  }
                },
                "required": [
                  "event",
                  "display_text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `ProjectDefinedEvent` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDefinedEvent"
                }
              }
            }
          }
        },
        "summary": "Create a project defined event",
        "tags": [
          "Project defined events"
        ]
      },
      "get": {
        "responses": {
          "200": {
            "description": "A list of `ProjectDefinedEvent` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "project_defined_events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectDefinedEvent"
                      },
                      "description": "An array of `ProjectDefinedEvent` objects"
                    }
                  },
                  "required": [
                    "project_defined_events"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all project-defined events",
        "tags": [
          "Project defined events"
        ]
      }
    },
    "/project_defined_events/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the `ProjectDefinedEvent` object",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `ProjectDefinedEvent` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDefinedEvent"
                }
              }
            }
          }
        },
        "summary": "Retrieve a project-defined event",
        "tags": [
          "Project defined events"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project defined event",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "display_text": {
                    "type": "string",
                    "description": "The human-readable text for this event. Should grammatically follow \"When...\" e.g. \"a customer is created\""
                  },
                  "purchase_amount_path": {
                    "type": "string",
                    "nullable": true,
                    "description": "Path for extracting purchase amount from event data"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `ProjectDefinedEvent` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDefinedEvent"
                }
              }
            }
          }
        },
        "summary": "Update a project defined event",
        "tags": [
          "Project defined events"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the `ProjectDefinedEvent` object",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `ProjectDefinedEvent` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDefinedEvent"
                }
              }
            }
          }
        },
        "summary": "Delete a project-defined event",
        "tags": [
          "Project defined events"
        ]
      }
    },
    "/project_defined_events/{id}/filter_types": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project defined event",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A list of filter types associated with the project-defined event",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "filter_types": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "variable_name": {
                            "type": "string",
                            "description": "The name of the variable"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "string",
                              "number",
                              "boolean",
                              "array",
                              "object",
                              "date",
                              "null"
                            ],
                            "description": "The type of the variable"
                          }
                        },
                        "required": [
                          "variable_name",
                          "type"
                        ]
                      },
                      "description": "An array of filter types"
                    }
                  },
                  "required": [
                    "filter_types"
                  ]
                }
              }
            }
          }
        },
        "summary": "List the types of all variables associated with the project-defined event",
        "tags": [
          "Project defined events"
        ]
      }
    },
    "/businesses/{id}/track": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "description": "The name of the event"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "The data associated with the event"
                  }
                },
                "required": [
                  "event"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "HTTP status acknowledging the event was properly received",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "summary": "Track an event occuring within a business",
        "tags": [
          "Events"
        ]
      }
    },
    "/businesses": {
      "get": {
        "responses": {
          "200": {
            "description": "A dictionary with a `businesses` property which is an array of `Business` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "businesses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Business"
                      },
                      "description": "An array of businesses"
                    }
                  },
                  "required": [
                    "businesses"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all businesses",
        "tags": [
          "Businesses"
        ]
      },
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the business"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "nullable": true,
                    "description": "Arbitrary metadata to associate with the business"
                  },
                  "external_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "An external identifier for the business. Must be unique within the project"
                  },
                  "website": {
                    "type": "string",
                    "nullable": true,
                    "description": "The website URL for the business"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Business` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Business"
                }
              }
            }
          }
        },
        "summary": "Create a business",
        "tags": [
          "Businesses"
        ]
      }
    },
    "/businesses/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `Business` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Business"
                }
              }
            }
          }
        },
        "summary": "Retrieve a business",
        "tags": [
          "Businesses"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The updated name of the business. Can be omitted"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "nullable": true,
                    "description": "Arbitrary metadata to associate with the business"
                  },
                  "external_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "An external identifier for the business. Must be unique within the project"
                  },
                  "website": {
                    "type": "string",
                    "nullable": true,
                    "description": "The website URL for the business"
                  },
                  "disabled_steps": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "email",
                        "sms"
                      ]
                    },
                    "nullable": true,
                    "description": "Steps to disable for this business. Pass `null` to inherit the project's `disabled_steps`. Pass an array (including `[]`) to override the project's setting."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Business` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Business"
                }
              }
            }
          }
        },
        "summary": "Update a business",
        "tags": [
          "Businesses"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `Business` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Business"
                }
              }
            }
          }
        },
        "summary": "Delete a business",
        "tags": [
          "Businesses"
        ]
      }
    },
    "/businesses/{id}/registration_information": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "business_name": {
                    "type": "string",
                    "nullable": true,
                    "description": "Business name"
                  },
                  "business_type": {
                    "type": "string",
                    "nullable": true,
                    "description": "Business type"
                  },
                  "business_industry": {
                    "type": "string",
                    "nullable": true,
                    "description": "Business industry"
                  },
                  "business_registration_identifier": {
                    "type": "string",
                    "nullable": true,
                    "description": "Business registration identifier"
                  },
                  "business_registration_number": {
                    "type": "string",
                    "nullable": true,
                    "description": "Business registration number"
                  },
                  "business_identity": {
                    "type": "string",
                    "nullable": true,
                    "description": "Business identity"
                  },
                  "business_regime_of_operation": {
                    "type": "string",
                    "nullable": true,
                    "description": "Business regime of operation"
                  },
                  "company_type": {
                    "type": "string",
                    "nullable": true,
                    "description": "Company type"
                  },
                  "website_url": {
                    "type": "string",
                    "nullable": true,
                    "description": "Website URL"
                  },
                  "social_media_profiles_urls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Social media profile URLs"
                  },
                  "street_address": {
                    "type": "string",
                    "nullable": true,
                    "description": "Street address"
                  },
                  "street_address_line_2": {
                    "type": "string",
                    "nullable": true,
                    "description": "Street address line 2"
                  },
                  "city": {
                    "type": "string",
                    "nullable": true,
                    "description": "City"
                  },
                  "region": {
                    "type": "string",
                    "nullable": true,
                    "description": "Region/state"
                  },
                  "postal_code": {
                    "type": "string",
                    "nullable": true,
                    "description": "Postal code"
                  },
                  "iso_country_code": {
                    "type": "string",
                    "nullable": true,
                    "description": "ISO country code"
                  },
                  "contact": {
                    "type": "object",
                    "properties": {
                      "first_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Contact person's first name"
                      },
                      "last_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Contact person's last name"
                      },
                      "title": {
                        "type": "string",
                        "nullable": true,
                        "description": "Contact person's title"
                      },
                      "job_position": {
                        "type": "string",
                        "nullable": true,
                        "description": "Contact person's job position"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Contact person's phone number"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "Contact person's email address"
                      }
                    },
                    "nullable": true,
                    "description": "Contact person information"
                  },
                  "supplemental_links": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Supplemental links"
                  },
                  "privacy_policy_link": {
                    "type": "string",
                    "nullable": true,
                    "description": "Privacy policy URL"
                  },
                  "preferred_phone_number_prefixes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Preferred 3-digit area code prefixes for phone number provisioning"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created or updated business registration information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessRegistrationInformation"
                }
              }
            }
          }
        },
        "summary": "Create or update business registration information",
        "tags": [
          "Business registration informations"
        ]
      }
    },
    "/businesses/{id}/available_steps": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with an `available_steps` property which are the available steps for the business",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available_steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The unique identifier of the step"
                          },
                          "type": {
                            "type": "string",
                            "description": "The type of the step"
                          },
                          "display_text": {
                            "type": "string",
                            "description": "The displayable name of the step"
                          },
                          "image_urls_supported": {
                            "type": "boolean",
                            "description": "Whether the step supports image URLs"
                          },
                          "custom_step_id": {
                            "type": "string",
                            "description": "The ID of the custom step if this is a custom step"
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "display_text"
                        ]
                      },
                      "description": "An array of available steps"
                    }
                  },
                  "required": [
                    "available_steps"
                  ]
                }
              }
            }
          }
        },
        "summary": "List the available steps for a business",
        "tags": [
          "Businesses"
        ]
      }
    },
    "/businesses/{id}/variables": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The variables for the business",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The variables for the business"
                    }
                  },
                  "required": [
                    "variables"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get all variables for a business",
        "tags": [
          "Variables"
        ]
      }
    },
    "/businesses/{id}/available_variables": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The variables available for the business, with induced values where known",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available_variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The dotted variable name, e.g. business.name"
                          },
                          "value": {
                            "type": "string",
                            "nullable": true,
                            "description": "The induced value, or null when the variable resolves per-recipient"
                          }
                        },
                        "required": [
                          "name",
                          "value"
                        ]
                      },
                      "description": "The variables available for the business"
                    }
                  },
                  "required": [
                    "available_variables"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get all available variables for a business, with known values",
        "tags": [
          "Variables"
        ]
      }
    },
    "/email_templates/{id}/variables": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The variables for the email template",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The variables for the email template"
                    }
                  },
                  "required": [
                    "variables"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get all variables for an email template",
        "tags": [
          "Variables"
        ]
      }
    },
    "/sms_templates/{id}/variables": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The variables for the SMS template",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The variables for the SMS template"
                    }
                  },
                  "required": [
                    "variables"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get all variables for an SMS template",
        "tags": [
          "Variables"
        ]
      }
    },
    "/businesses/{id}/customers": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "query",
            "name": "email_address",
            "schema": {
              "type": "string"
            },
            "description": "The email address to filter on",
            "required": false
          },
          {
            "in": "query",
            "name": "phone_number",
            "schema": {
              "type": "string"
            },
            "description": "The phone number to filter on",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `customers` property which is an array of `Customer` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      },
                      "description": "An array of customers"
                    }
                  },
                  "required": [
                    "customers"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all customers for a business",
        "tags": [
          "Customers"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email_address": {
                        "type": "string",
                        "description": "The email address of the customer"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The phone number of the customer"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "nullable": true,
                        "description": "Any metadata to attach to the customer"
                      },
                      "full_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "The full name of the customer"
                      }
                    },
                    "required": [
                      "email_address"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "phone_number": {
                        "type": "string",
                        "description": "The phone number of the customer"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "The email address of the customer"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "nullable": true,
                        "description": "Any metadata to attach to the customer"
                      },
                      "full_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "The full name of the customer"
                      }
                    },
                    "required": [
                      "phone_number"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Customer` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          }
        },
        "summary": "Create a customer",
        "tags": [
          "Customers"
        ]
      }
    },
    "/businesses/{id}/customers/batch": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customers": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "email_address": {
                              "type": "string",
                              "description": "The email address of the customer"
                            },
                            "phone_number": {
                              "type": "string",
                              "nullable": true,
                              "description": "The phone number of the customer"
                            },
                            "metadata": {
                              "type": "object",
                              "additionalProperties": true,
                              "nullable": true,
                              "description": "Any metadata to attach to the customer"
                            },
                            "full_name": {
                              "type": "string",
                              "nullable": true,
                              "description": "The full name of the customer"
                            }
                          },
                          "required": [
                            "email_address"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "phone_number": {
                              "type": "string",
                              "description": "The phone number of the customer"
                            },
                            "email_address": {
                              "type": "string",
                              "nullable": true,
                              "description": "The email address of the customer"
                            },
                            "metadata": {
                              "type": "object",
                              "additionalProperties": true,
                              "nullable": true,
                              "description": "Any metadata to attach to the customer"
                            },
                            "full_name": {
                              "type": "string",
                              "nullable": true,
                              "description": "The full name of the customer"
                            }
                          },
                          "required": [
                            "phone_number"
                          ]
                        }
                      ]
                    },
                    "description": "An array of customer data to create"
                  }
                },
                "required": [
                  "customers"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An array of created `Customer` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer",
                        "nullable": true
                      },
                      "description": "An array of created `Customer` objects (null for entries that failed)"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string",
                            "description": "The error message"
                          },
                          "path": {
                            "type": "string",
                            "description": "The path to the field that caused the error"
                          }
                        },
                        "required": [
                          "message",
                          "path"
                        ]
                      },
                      "description": "An array of errors"
                    }
                  },
                  "required": [
                    "customers"
                  ]
                }
              }
            }
          }
        },
        "summary": "Create multiple customers",
        "tags": [
          "Customers"
        ]
      }
    },
    "/businesses/{id}/customers/batch_update": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The ID of the customer"
                        },
                        "phone_number": {
                          "type": "string",
                          "nullable": true,
                          "description": "The updated phone number of the customer"
                        },
                        "email_address": {
                          "type": "string",
                          "nullable": true,
                          "description": "The updated email address of the customer"
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": true,
                          "nullable": true,
                          "description": "The updated metadata of the customer"
                        },
                        "full_name": {
                          "type": "string",
                          "nullable": true,
                          "description": "The updated full name of the customer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "description": "An array of customer data to update. Must identify every customer with their ID"
                  }
                },
                "required": [
                  "customers"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An array of updated `Customer` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      },
                      "description": "An array of updated `Customer` objects"
                    }
                  },
                  "required": [
                    "customers"
                  ]
                }
              }
            }
          }
        },
        "summary": "Update multiple customers",
        "tags": [
          "Customers"
        ]
      }
    },
    "/customers/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `Customer` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          }
        },
        "summary": "Retrieve a customer",
        "tags": [
          "Customers"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email_address": {
                    "type": "string",
                    "nullable": true,
                    "description": "The email address of the customer"
                  },
                  "phone_number": {
                    "type": "string",
                    "nullable": true,
                    "description": "The phone number of the customer"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "nullable": true,
                    "description": "The metadata of the customer"
                  },
                  "full_name": {
                    "type": "string",
                    "nullable": true,
                    "description": "The full name of the customer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Customer` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          }
        },
        "summary": "Update a customer",
        "tags": [
          "Customers"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `Customer` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          }
        },
        "summary": "Delete a customer",
        "tags": [
          "Customers"
        ]
      }
    },
    "/customers/{id}/unsubscribe": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "campaign"
                        ],
                        "description": "The type of unsubscribe. `campaign` in this case indicates unsubscribing from a single campaign"
                      },
                      "campaign_id": {
                        "type": "string",
                        "description": "The ID of the campaign to unsubscribe from"
                      }
                    },
                    "required": [
                      "type",
                      "campaign_id"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "trigger"
                        ],
                        "description": "The type of unsubscribe. `trigger` in this case indicates unsubscribing from a single trigger"
                      },
                      "trigger_id": {
                        "type": "string",
                        "description": "The ID of the trigger to unsubscribe from"
                      }
                    },
                    "required": [
                      "type",
                      "trigger_id"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "all"
                        ],
                        "description": "The type of unsubscribe. `all` in this case indicates unsubscribing from all campaigns"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "future"
                        ],
                        "description": "The type of unsubscribe. `future` in this case indicates unsubscribing from all current and future campaigns"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The `Customer` object which was unsubscribed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          }
        },
        "summary": "Unsubscribe a customer from campaigns and triggers",
        "tags": [
          "Customers"
        ]
      }
    },
    "/customers/{id}/unsubscribe_info": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The marketing resources the customer has opted out of",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "unsubscribed_campaigns": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The campaigns the customer has unsubscribed from"
                    },
                    "unsubscribed_triggers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The triggers the customer has unsubscribed from"
                    },
                    "unsubscribed_from_all": {
                      "type": "boolean",
                      "description": "Whether the customer has opted out of all marketing"
                    }
                  },
                  "required": [
                    "unsubscribed_campaigns",
                    "unsubscribed_triggers",
                    "unsubscribed_from_all"
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve unsubscribe info for a customer",
        "tags": [
          "Customers"
        ]
      }
    },
    "/customers/{id}/resubscribe": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "campaign"
                        ],
                        "description": "The type of resubscribe. `campaign` in this case indicates resubscribing to a single campaign"
                      },
                      "campaign_id": {
                        "type": "string",
                        "description": "The ID of the campaign to resubscribe to"
                      }
                    },
                    "required": [
                      "type",
                      "campaign_id"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "trigger"
                        ],
                        "description": "The type of resubscribe. `trigger` in this case indicates resubscribing to a single trigger"
                      },
                      "trigger_id": {
                        "type": "string",
                        "description": "The ID of the trigger to resubscribe to"
                      }
                    },
                    "required": [
                      "type",
                      "trigger_id"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "future"
                        ],
                        "description": "The type of resubscribe. `future` in this case indicates resubscribing to future campaigns. Does not resubscribe the customer to any existing campaigns or triggers"
                      }
                    },
                    "required": [
                      "type"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The `Customer` object which was resubscribed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          }
        },
        "summary": "Resubscribe a customer to campaigns and triggers",
        "tags": [
          "Customers"
        ]
      }
    },
    "/customers/{id}/segments": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The segments the customer belongs to",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "segments": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Segment"
                      },
                      "description": "The segments the customer belongs to"
                    }
                  },
                  "required": [
                    "segments"
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve the segments a customer belongs to",
        "tags": [
          "Customers"
        ]
      }
    },
    "/customers/{id}/campaigns": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string"
            },
            "description": "Cursor returned from the previous page's `page_info.end_cursor`. The row it points to is excluded from the result.",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "A paginated list of campaigns the customer is enrolled in, newest campaign first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "page_info": {
                      "type": "object",
                      "properties": {
                        "has_next_page": {
                          "type": "boolean",
                          "description": "Whether there are more results after this page"
                        },
                        "end_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Cursor to pass as `after` on the next request. Null when the page is empty."
                        }
                      },
                      "required": [
                        "has_next_page",
                        "end_cursor"
                      ],
                      "description": "Pagination metadata"
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of records matching the filters (across all pages). Only present when `expand[]=total_count` is requested; opt-in because COUNT(*) is O(N) on large filtered sets."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Campaign"
                      },
                      "description": "The campaigns the customer is enrolled in on this page, newest campaign first"
                    }
                  },
                  "required": [
                    "page_info",
                    "data"
                  ]
                }
              }
            }
          }
        },
        "summary": "List the campaigns a customer is enrolled in (paginated)",
        "tags": [
          "Customers"
        ]
      }
    },
    "/businesses/{id}/segments": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `segments` property which is an array of `Segment` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "segments": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Segment"
                      },
                      "description": "An array of segments"
                    }
                  },
                  "required": [
                    "segments"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all the business's segments",
        "tags": [
          "Segments"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the segment"
                  },
                  "static_customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "A list of customer IDs to always include in this segment"
                  },
                  "customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "A list of customer IDs to include in this segment"
                  },
                  "filter": {
                    "type": "string",
                    "nullable": true,
                    "description": "The filter for this segment"
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "A plain-English description of the segment using bullet-point markdown"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Metadata attached to this segment"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Segment` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          }
        },
        "summary": "Create a segment",
        "tags": [
          "Segments"
        ]
      }
    },
    "/segments/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `Segment` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          }
        },
        "summary": "Retrieve a segment",
        "tags": [
          "Segments"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the segment"
                  },
                  "static_customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "A list of customer IDs to always include in this segment"
                  },
                  "customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "A list of customer IDs to include in this segment"
                  },
                  "filter": {
                    "type": "string",
                    "nullable": true,
                    "description": "The filter for this segment"
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "A plain-English description of the segment using bullet-point markdown"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Metadata attached to this segment"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Segment` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          }
        },
        "summary": "Update a segment",
        "tags": [
          "Segments"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `Segment` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          }
        },
        "summary": "Delete a segment",
        "tags": [
          "Segments"
        ]
      }
    },
    "/segments/{id}/available_variables": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The variables available for the segment, with induced values",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available_variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The dotted variable name, e.g. segment.name"
                          },
                          "value": {
                            "type": "string",
                            "nullable": true,
                            "description": "The induced value"
                          }
                        },
                        "required": [
                          "name",
                          "value"
                        ]
                      },
                      "description": "The variables available for the segment"
                    }
                  },
                  "required": [
                    "available_variables"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get all available variables for a segment, with known values",
        "tags": [
          "Segments"
        ]
      }
    },
    "/segments/{id}/customers": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The customers in the segment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      },
                      "description": "The customers in the segment"
                    }
                  },
                  "required": [
                    "customers"
                  ]
                }
              }
            }
          }
        },
        "summary": "Show the customers in a segment",
        "tags": [
          "Segments"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer": {
                    "type": "string",
                    "description": "The ID of the customer to add to the segment"
                  }
                },
                "required": [
                  "customer"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Segment` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          }
        },
        "summary": "Add a customer to a segment",
        "tags": [
          "Segments"
        ]
      }
    },
    "/segments/{id}/customer_ids": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The customer IDs in the segment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customer_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of IDs of the customers in the segment"
                    }
                  },
                  "required": [
                    "customer_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "Show the customer IDs in a segment",
        "tags": [
          "Segments"
        ]
      }
    },
    "/segments/{id}/static_customers": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The static customers in the segment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "static_customers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      },
                      "description": "The static customers in the segment"
                    }
                  },
                  "required": [
                    "static_customers"
                  ]
                }
              }
            }
          }
        },
        "summary": "Show the static customers in a segment",
        "tags": [
          "Segments"
        ]
      }
    },
    "/segments/{id}/static_customer_ids": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The static customer IDs in the segment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "static_customer_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of IDs of the static customers in the segment"
                    }
                  },
                  "required": [
                    "static_customer_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "Show the static customer IDs in a segment",
        "tags": [
          "Segments"
        ]
      }
    },
    "/segments/{id}/customers/{customer_id}": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          },
          {
            "in": "path",
            "name": "customer_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer to remove from the segment",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The updated `Segment` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          }
        },
        "summary": "Remove a customer from a segment",
        "tags": [
          "Segments"
        ]
      }
    },
    "/segments/{id}/copy": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the segment",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The copied `Segment` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          }
        },
        "summary": "Create a copy of an existing segment",
        "tags": [
          "Segments"
        ]
      }
    },
    "/customers/{id}/unsubscribe_embeds": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer that's unsubscribing",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The created `UnsubscribeEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnsubscribeEmbed"
                }
              }
            }
          }
        },
        "summary": "Create an unsubscribe embed",
        "tags": [
          "Unsubscribe embeds"
        ]
      }
    },
    "/unsubscribe_embeds/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the unsubscribe embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An `UnsubscribeEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnsubscribeEmbed"
                }
              }
            }
          }
        },
        "summary": "Retrieve an unsubscribe embed",
        "tags": [
          "Unsubscribe embeds"
        ]
      }
    },
    "/unsubscribe_embeds/{id}/show": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the unsubscribe embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The embeddable HTML that will render a UI for unsubscribing from a campaign",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Embed the unsubscribe form",
        "tags": [
          "Unsubscribe embeds"
        ]
      }
    },
    "/businesses/{id}/email_templates": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "query",
            "name": "include_project_email_templates",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Whether to include project email templates in the list of business's email templates",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with an `email_templates` property which is an array of `EmailTemplate` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "email_templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EmailTemplate"
                      },
                      "description": "An array of email templates"
                    }
                  },
                  "required": [
                    "email_templates"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all email templates for a business",
        "tags": [
          "Email templates"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the email template"
                      },
                      "subject": {
                        "type": "string",
                        "description": "The subject of the email template. Variables are supported via `{{ variableName }}`"
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "content": {
                              "type": "string",
                              "description": "The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'"
                            },
                            "name": {
                              "type": "string",
                              "description": "The intended name of the attachment"
                            }
                          },
                          "required": [
                            "content",
                            "name"
                          ]
                        },
                        "description": "An array of attachments that will always be sent with this template"
                      },
                      "one_off": {
                        "type": "boolean",
                        "description": "Whether this is a one off email template"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The metadata of the email template"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "editor",
                          "old_editor"
                        ],
                        "description": "The kind of the email template"
                      },
                      "template_json": {
                        "description": "The JSON representing the email template. Mutually exclusive with plain text email templates"
                      }
                    },
                    "required": [
                      "name",
                      "subject",
                      "template_json"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the email template"
                      },
                      "subject": {
                        "type": "string",
                        "description": "The subject of the email template. Variables are supported via `{{ variableName }}`"
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "content": {
                              "type": "string",
                              "description": "The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'"
                            },
                            "name": {
                              "type": "string",
                              "description": "The intended name of the attachment"
                            }
                          },
                          "required": [
                            "content",
                            "name"
                          ]
                        },
                        "description": "An array of attachments that will always be sent with this template"
                      },
                      "one_off": {
                        "type": "boolean",
                        "description": "Whether this is a one off email template"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The metadata of the email template"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "unlayer"
                        ],
                        "description": "The kind of the email template"
                      }
                    },
                    "required": [
                      "name",
                      "subject"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the email template"
                      },
                      "subject": {
                        "type": "string",
                        "description": "The subject of the email template"
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "content": {
                              "type": "string",
                              "description": "The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'"
                            },
                            "name": {
                              "type": "string",
                              "description": "The intended name of the attachment"
                            }
                          },
                          "required": [
                            "content",
                            "name"
                          ]
                        },
                        "description": "An array of attachments that will always be sent with this template"
                      },
                      "one_off": {
                        "type": "boolean",
                        "description": "Whether this is a one off email template"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The metadata of the email template"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "unlayer"
                        ],
                        "description": "The kind of the email template"
                      },
                      "new_template_json": {
                        "description": "The JSON representing the rich text email template"
                      },
                      "new_template_html": {
                        "type": "string",
                        "description": "The HTML representation of the rich text email template"
                      }
                    },
                    "required": [
                      "name",
                      "subject",
                      "new_template_json",
                      "new_template_html"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the email template"
                      },
                      "subject": {
                        "type": "string",
                        "description": "The subject of the email template. Variables are supported via `{{ variableName }}`"
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "content": {
                              "type": "string",
                              "description": "The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'"
                            },
                            "name": {
                              "type": "string",
                              "description": "The intended name of the attachment"
                            }
                          },
                          "required": [
                            "content",
                            "name"
                          ]
                        },
                        "description": "An array of attachments that will always be sent with this template"
                      },
                      "one_off": {
                        "type": "boolean",
                        "description": "Whether this is a one off email template"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The metadata of the email template"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "html"
                        ],
                        "description": "The kind of the email template"
                      },
                      "template_html": {
                        "type": "string",
                        "description": "The HTML representing the email template"
                      }
                    },
                    "required": [
                      "name",
                      "subject",
                      "template_html"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `EmailTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Create an email template",
        "tags": [
          "Email templates"
        ]
      }
    },
    "/email_templates/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An `EmailTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Retrieve an email template",
        "tags": [
          "Email templates"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the email template"
                  },
                  "subject": {
                    "type": "string",
                    "description": "The subject of the email template. Variables are supported via `{{ variableName }}`"
                  },
                  "body": {
                    "type": "string",
                    "description": "The plaintext version of the body of the email template. Variables are supported via `{{ variableName }}`"
                  },
                  "template_html": {
                    "type": "string",
                    "description": "The HTML representation of the email template. Mutually exclusive with plain text email templates."
                  },
                  "template_json": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "The JSON representation of the email template. This will override the `name`, `subject`, and `body` properties"
                  },
                  "new_template_json": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "The JSON representing the rich text email template. Mutually exclusive with plain text email templates"
                  },
                  "new_template_html": {
                    "type": "string",
                    "description": "The HTML representation of the rich text email template. Mutually exclusive with plain text email templates"
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "content": {
                              "type": "string",
                              "description": "The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'"
                            },
                            "name": {
                              "type": "string",
                              "description": "The intended name of the attachment"
                            }
                          },
                          "required": [
                            "content",
                            "name"
                          ]
                        }
                      ]
                    },
                    "description": "An array of existing attachment IDs or new attachments that will always be sent with this template"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "unlayer",
                      "editor",
                      "old_editor",
                      "html"
                    ],
                    "description": "The kind of the email template"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "The metadata for the email template"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `EmailTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Update an email template",
        "tags": [
          "Email templates"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `EmailTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Delete an email template",
        "tags": [
          "Email templates"
        ]
      }
    },
    "/email_templates/{id}/preview.png": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The image of the compiled email template",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Preview an email template as an image",
        "security": [],
        "tags": [
          "Email templates"
        ]
      }
    },
    "/email_templates/{id}/preview": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The HTML of the compiled email template",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Preview an email template",
        "security": [],
        "tags": [
          "Email templates"
        ]
      }
    },
    "/email_templates/{id}/copy": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `EmailTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Create a copy of an existing email template",
        "tags": [
          "Email templates"
        ]
      }
    },
    "/email_templates/{id}/copy_one_off": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template to copy",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The copied `EmailTemplate` object. As a one-off, it will not be return from `GET /businesses/:id/email_templates`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Copy an email template as a one-off",
        "tags": [
          "Email templates"
        ]
      }
    },
    "/email_templates/{id}/embeds": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expires_in": {
                    "type": "number",
                    "description": "The number of seconds until the embed will expire"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `EmailTemplateEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateEmbed"
                }
              }
            }
          }
        },
        "summary": "Create an email template embed to edit an existing email template",
        "tags": [
          "Email template embeds"
        ]
      }
    },
    "/businesses/{id}/email_templates/embeds": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expires_in": {
                    "type": "number",
                    "description": "The number of seconds until the embed will expire"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `EmailTemplateEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateEmbed"
                }
              }
            }
          }
        },
        "summary": "Create an email template embed to create a brand new email template",
        "tags": [
          "Email template embeds"
        ]
      }
    },
    "/email_template_embeds/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `EmailTemplateEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateEmbed"
                }
              }
            }
          }
        },
        "summary": "Retrieve an email template embed",
        "tags": [
          "Email template embeds"
        ]
      }
    },
    "/email_template_embeds/{id}/show": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template embed",
            "required": true
          },
          {
            "in": "query",
            "name": "hide_top_bar",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to hide the top bar when embedding the email template editor",
            "required": false
          },
          {
            "in": "query",
            "name": "hide_buttons",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to hide the \"Save\" and \"Send Test Email\" buttons when embedding the email template editor",
            "required": false
          },
          {
            "in": "query",
            "name": "hide_save_button",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to hide the \"Save\" button when embedding the email template editor",
            "required": false
          },
          {
            "in": "query",
            "name": "hide_send_test_email_button",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to hide the \"Send Test Email\" button when embedding the email template editor",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "The embeddable HTML that will render a UI for editing the email template",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Embed the email template editor",
        "security": [],
        "tags": [
          "Email template embeds"
        ]
      }
    },
    "/project_email_templates": {
      "get": {
        "responses": {
          "200": {
            "description": "A dictionary with a `project_email_templates` property which is an array of `ProjectEmailTemplate` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "project_email_templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectEmailTemplate"
                      },
                      "description": "An array of project email templates"
                    }
                  },
                  "required": [
                    "project_email_templates"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all project email templates",
        "tags": [
          "Project email templates"
        ]
      }
    },
    "/project_email_templates/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project email template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `ProjectEmailTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectEmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Retrieve a project email template",
        "tags": [
          "Project email templates"
        ]
      }
    },
    "/project_email_templates/{id}/preview.png": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project email template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The image of the compiled project email template",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Preview a project email template as an image",
        "security": [],
        "tags": [
          "Project email templates"
        ]
      }
    },
    "/project_email_templates/{id}/preview": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project email template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The HTML of the compiled project email template",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Preview a project email template",
        "security": [],
        "tags": [
          "Project email templates"
        ]
      }
    },
    "/project_email_templates/{id}/copy": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project email template to copy",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "business": {
                    "type": "string",
                    "description": "The ID of the business to copy the project email template into"
                  }
                },
                "required": [
                  "business"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The `EmailTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Copy a project email template into a specific business",
        "tags": [
          "Project email templates"
        ]
      }
    },
    "/project_email_templates/{id}/copy_one_off": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project email template to copy",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "business": {
                    "type": "string",
                    "description": "The ID of the business to copy the project email template into"
                  }
                },
                "required": [
                  "business"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The `EmailTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          }
        },
        "summary": "Copy a project email template into a specific business as a one-off template",
        "tags": [
          "Project email templates"
        ]
      }
    },
    "/email_templates/{id}/send": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "description": "The ID of the email address from which to send the email"
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "content": {
                              "type": "string",
                              "description": "The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'"
                            },
                            "name": {
                              "type": "string",
                              "description": "The intended name of the attachment"
                            }
                          },
                          "required": [
                            "content",
                            "name"
                          ]
                        },
                        "description": "An array of attachments to include with the email"
                      },
                      "to": {
                        "type": "string",
                        "description": "The email address to send the email to"
                      },
                      "variables": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The variables to be injected into the email template"
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "description": "The ID of the email address from which to send the email"
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "content": {
                              "type": "string",
                              "description": "The content of the attachment as a data url, e.g. 'data:image/png;base64,abcd1234'"
                            },
                            "name": {
                              "type": "string",
                              "description": "The intended name of the attachment"
                            }
                          },
                          "required": [
                            "content",
                            "name"
                          ]
                        },
                        "description": "An array of attachments to include with the email"
                      },
                      "customer": {
                        "type": "string",
                        "description": "The ID of the customer to send the email to"
                      },
                      "variables": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The variables to be injected into the email template in addition to the variables already induced by the customer"
                      }
                    },
                    "required": [
                      "from",
                      "customer"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sent `SentEmail` object",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The ID of the campaign"
                    },
                    "created_at": {
                      "type": "string",
                      "description": "The time when the campaign was created in ISO 8601 format"
                    },
                    "customer": {
                      "type": "string",
                      "nullable": true,
                      "description": "The ID of the customer that was sent the email"
                    },
                    "subject": {
                      "type": "string",
                      "description": "The subject of the email"
                    },
                    "sent_at": {
                      "type": "string",
                      "nullable": true,
                      "description": "The time when the email was sent in ISO 8601 format"
                    },
                    "failed_at": {
                      "type": "string",
                      "nullable": true,
                      "description": "The time when the email failed to send in ISO 8601 format"
                    },
                    "failed_reason": {
                      "type": "string",
                      "nullable": true,
                      "description": "The reason the email failed to send"
                    },
                    "to_email_address": {
                      "type": "string",
                      "nullable": true,
                      "description": "The email address the email was sent to"
                    },
                    "sendgrid_message_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Sendgrid's returned message ID"
                    },
                    "paubox_message_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Paubox's returned message ID"
                    },
                    "postmark_message_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Postmark's returned message ID"
                    },
                    "ok": {
                      "type": "boolean",
                      "description": "Whether the email was sent successfully"
                    }
                  },
                  "required": [
                    "id",
                    "created_at",
                    "customer",
                    "subject",
                    "sent_at",
                    "failed_at",
                    "failed_reason",
                    "to_email_address",
                    "ok"
                  ]
                }
              }
            }
          }
        },
        "summary": "Send an email based off an email template",
        "tags": [
          "Emails"
        ]
      }
    },
    "/email_addresses/{id}/send": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "The email address to send the email to"
                  },
                  "subject": {
                    "type": "string",
                    "description": "The subject of the email"
                  },
                  "body": {
                    "type": "string",
                    "description": "The body of the email"
                  }
                },
                "required": [
                  "to",
                  "subject",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A confirmation that the email was sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "Whether the email was sent successfully"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          }
        },
        "summary": "Send an email",
        "tags": [
          "Emails"
        ]
      }
    },
    "/businesses/{id}/sent_email_ids": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "query",
            "name": "since",
            "schema": {
              "type": "string"
            },
            "description": "ISO 8601 timestamp for the start time (inclusive, max 60 days ago)",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_email_ids` property which is an array of IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_email_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of sent email IDs"
                    }
                  },
                  "required": [
                    "sent_email_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all the sent email IDs for a business",
        "tags": [
          "Sent emails"
        ]
      }
    },
    "/sent_emails/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the sent email",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `SentEmail` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SentEmail"
                }
              }
            }
          }
        },
        "summary": "Retrieve a sent email",
        "tags": [
          "Sent emails"
        ]
      }
    },
    "/campaigns/{id}/sent_email_ids": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_email_ids` property which is an array of IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_email_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of `SentEmail` objects"
                    }
                  },
                  "required": [
                    "sent_email_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all the sent email IDs for a campaign",
        "tags": [
          "Sent emails"
        ]
      }
    },
    "/campaigns/{id}/sent_emails": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_emails` property which is an array of `SentEmail` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_emails": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SentEmail"
                      },
                      "description": "An array of `SentEmail` objects"
                    }
                  },
                  "required": [
                    "sent_emails"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all the sent emails for a campaign",
        "tags": [
          "Sent emails"
        ]
      }
    },
    "/triggers/{id}/sent_email_ids": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_email_ids` property which is an array of IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_email_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of IDs"
                    }
                  },
                  "required": [
                    "sent_email_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all the sent email IDs for a trigger",
        "tags": [
          "Sent emails"
        ]
      }
    },
    "/triggers/{id}/sent_emails": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_emails` property which is an array of `SentEmail` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_emails": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SentEmail"
                      },
                      "description": "An array of `SentEmail` objects"
                    }
                  },
                  "required": [
                    "sent_emails"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all the sent emails for a trigger",
        "tags": [
          "Sent emails"
        ]
      }
    },
    "/sent_emails/{id}/sent_email_events": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the sent email",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_email_events` property which is an array of `SentEmailEvent` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_email_events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The ID of the sent email event"
                          },
                          "event_type": {
                            "type": "string",
                            "enum": [
                              "delivered",
                              "opened",
                              "clicked",
                              "soft_bounced",
                              "hard_bounced",
                              "spam_report",
                              "other"
                            ],
                            "description": "The type of the sent email event"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "The time when the sent email event was created in ISO 8601 format"
                          }
                        },
                        "required": [
                          "id",
                          "event_type",
                          "created_at"
                        ]
                      },
                      "description": "An array of sent email events"
                    }
                  },
                  "required": [
                    "sent_email_events"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all the sent email events for a sent email",
        "tags": [
          "Sent emails"
        ]
      }
    },
    "/sent_sms_messages/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the sent SMS message",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `SentSmsMessage` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SentSMSMessage"
                }
              }
            }
          }
        },
        "summary": "Retrieve a sent SMS message",
        "tags": [
          "Sent sms messages"
        ]
      }
    },
    "/campaigns/{id}/sent_sms_message_ids": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_sms_message_ids` property which is an array of sent SMS message IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_sms_message_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of sent SMS message IDs"
                    }
                  },
                  "required": [
                    "sent_sms_message_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all sent SMS message IDs for a campaign",
        "tags": [
          "Sent sms messages"
        ]
      }
    },
    "/campaigns/{id}/sent_sms_messages": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_sms_messages` property which is an array of `SentSmsMessage` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_sms_messages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SentSMSMessage"
                      },
                      "description": "An array of sent SMS messages"
                    }
                  },
                  "required": [
                    "sent_sms_messages"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all sent SMS messages for a campaign",
        "tags": [
          "Sent sms messages"
        ]
      }
    },
    "/triggers/{id}/sent_sms_message_ids": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_sms_message_ids` property which is an array of sent SMS message IDs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_sms_message_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of sent SMS message IDs"
                    }
                  },
                  "required": [
                    "sent_sms_message_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all sent SMS message IDs for a trigger",
        "tags": [
          "Sent sms messages"
        ]
      }
    },
    "/triggers/{id}/sent_sms_messages": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_sms_messages` property which is an array of `SentSmsMessage` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_sms_messages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SentSMSMessage"
                      },
                      "description": "An array of sent SMS messages"
                    }
                  },
                  "required": [
                    "sent_sms_messages"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all sent SMS messages for a trigger",
        "tags": [
          "Sent sms messages"
        ]
      }
    },
    "/sent_sms_messages/{id}/sent_sms_message_events": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the sent SMS message",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `sent_sms_message_events` property which is an array of `SentSmsMessageEvent` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent_sms_message_events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The ID of the sent SMS message event"
                          },
                          "event_type": {
                            "type": "string",
                            "enum": [
                              "clicked",
                              "queued",
                              "sent",
                              "delivered",
                              "failed",
                              "other"
                            ],
                            "description": "The type of the sent SMS message event"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "The time when the sent SMS message event was created in ISO 8601 format"
                          }
                        },
                        "required": [
                          "id",
                          "event_type",
                          "created_at"
                        ]
                      },
                      "description": "An array of sent SMS message events"
                    }
                  },
                  "required": [
                    "sent_sms_message_events"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all the sent SMS message events for a sent SMS message",
        "tags": [
          "Sent sms messages"
        ]
      }
    },
    "/businesses/{id}/email_addresses": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The email addresses belonging to the business",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "email_addresses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EmailAddress"
                      },
                      "description": "The business's email addresses"
                    }
                  },
                  "required": [
                    "email_addresses"
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve the email addresses for a business",
        "tags": [
          "Email addresses"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "email_address": {
                        "type": "string",
                        "description": "The full email address. Must have the same domain as an existing business email address."
                      },
                      "display_name": {
                        "type": "string",
                        "description": "The display name for the email address"
                      },
                      "one_off": {
                        "type": "boolean",
                        "description": "Whether this is a one-off email address"
                      },
                      "reply_to": {
                        "type": "string",
                        "description": "The reply-to address for the email address"
                      }
                    },
                    "required": [
                      "email_address",
                      "display_name"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "username": {
                        "type": "string",
                        "description": "The username (local part) of the email address"
                      },
                      "display_name": {
                        "type": "string",
                        "description": "The display name for the email address"
                      },
                      "custom_domain": {
                        "type": "string",
                        "description": "The ID of the custom domain to create the email address under"
                      },
                      "one_off": {
                        "type": "boolean",
                        "description": "Whether this is a one-off email address"
                      },
                      "reply_to": {
                        "type": "string",
                        "description": "The reply-to address for the email address"
                      }
                    },
                    "required": [
                      "username",
                      "display_name",
                      "custom_domain"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `EmailAddress` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailAddress"
                }
              }
            }
          }
        },
        "summary": "Create an email address for a business",
        "tags": [
          "Email addresses"
        ]
      }
    },
    "/email_addresses/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the connected email address",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An `EmailAddress` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailAddress"
                }
              }
            }
          }
        },
        "summary": "Retrieve a connected email address",
        "tags": [
          "Email addresses"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email address",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "display_name": {
                    "type": "string",
                    "description": "The display name of the email address"
                  },
                  "reply_to": {
                    "type": "string",
                    "nullable": true,
                    "description": "The reply-to address of the email address"
                  },
                  "username": {
                    "type": "string",
                    "description": "The username of the email address - the part that comes before the @"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `EmailAddress` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailAddress"
                }
              }
            }
          }
        },
        "summary": "Update an email address",
        "tags": [
          "Email addresses"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the connected email address",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `ConnectedEmailAddress` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailAddress"
                }
              }
            }
          }
        },
        "summary": "Delete a connected email address",
        "tags": [
          "Email addresses"
        ]
      }
    },
    "/email_addresses/{id}/references": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email address",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "IDs of all resources that reference this email address",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaign_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Campaign IDs using this email address"
                    },
                    "trigger_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Trigger IDs using this email address"
                    },
                    "email_blast_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Email blast IDs using this email address"
                    }
                  },
                  "required": [
                    "campaign_ids",
                    "trigger_ids",
                    "email_blast_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all resources referencing this email address",
        "tags": [
          "Email addresses"
        ]
      }
    },
    "/email_addresses/{id}/objects_preventing_deletion": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email address",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "IDs of resources that must be updated before this email address can be deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaign_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Campaign IDs preventing deletion"
                    },
                    "trigger_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Trigger IDs preventing deletion"
                    },
                    "email_blast_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Email blast IDs preventing deletion"
                    }
                  },
                  "required": [
                    "campaign_ids",
                    "trigger_ids",
                    "email_blast_ids"
                  ]
                }
              }
            }
          }
        },
        "summary": "List resources that prevent deletion of this email address",
        "tags": [
          "Email addresses"
        ]
      }
    },
    "/custom_domains/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the custom domain",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `Custom Domain` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomain"
                }
              }
            }
          }
        },
        "summary": "Retrieve a custom domain",
        "tags": [
          "Custom domains"
        ]
      }
    },
    "/businesses/{id}/custom_domains": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "query",
            "name": "domain",
            "schema": {
              "type": "string"
            },
            "description": "Filter by domain name",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `custom_domains` property which is an array of `CustomDomain` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "custom_domains": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomDomain"
                      },
                      "description": "An array of custom domains"
                    }
                  },
                  "required": [
                    "custom_domains"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all custom domains for a business",
        "tags": [
          "Custom domains"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "The domain name"
                  }
                },
                "required": [
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `CustomDomain` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomain"
                }
              }
            }
          }
        },
        "summary": "Create a custom domain",
        "tags": [
          "Custom domains"
        ]
      }
    },
    "/custom_domains/{id}/validate": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the custom domain",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `CustomDomain` object with updated validation status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomain"
                }
              }
            }
          }
        },
        "summary": "Validate a custom domain",
        "tags": [
          "Custom domains"
        ]
      }
    },
    "/custom_domains/{id}/reset_validation_status": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the custom domain",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `CustomDomain` object with pending Entri propagation status and nil validation status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomain"
                }
              }
            }
          }
        },
        "summary": "Reset a custom domain's validation status",
        "tags": [
          "Custom domains"
        ]
      }
    },
    "/businesses/{id}/sms_templates": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with an `sms_templates` property which is an array of `SMSTemplate` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sms_templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SMSTemplate"
                      },
                      "description": "An array of SMS templates"
                    }
                  },
                  "required": [
                    "sms_templates"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all SMS templates for a business",
        "tags": [
          "Sms templates"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the SMS template"
                  },
                  "message": {
                    "type": "string",
                    "description": "The message of the SMS template. Variables are supported via `{{ variableName }}`"
                  },
                  "one_off": {
                    "type": "boolean",
                    "description": "Whether the SMS template is one-off"
                  },
                  "image": {
                    "description": "The image associated with the SMS template"
                  },
                  "shorten_urls": {
                    "type": "boolean",
                    "description": "Whether to shorten URLs in the SMS template"
                  },
                  "image_uploads": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The image upload IDs you would like to associate with the SMS template"
                  }
                },
                "required": [
                  "name",
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `SMSTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplate"
                }
              }
            }
          }
        },
        "summary": "Create an SMS template",
        "tags": [
          "Sms templates"
        ]
      }
    },
    "/sms_templates/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An `SMSTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplate"
                }
              }
            }
          }
        },
        "summary": "Retrieve an SMS template",
        "tags": [
          "Sms templates"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the SMS template"
                  },
                  "message": {
                    "type": "string",
                    "description": "The message of the SMS template. Variables are supported via `{{ variableName }}`"
                  },
                  "image": {
                    "description": "The image associated with the SMS template"
                  },
                  "shorten_urls": {
                    "type": "boolean",
                    "description": "Whether to shorten URLs in the SMS template"
                  },
                  "image_uploads": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The image upload IDs you would like to associate with the SMS template"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `SMSTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplate"
                }
              }
            }
          }
        },
        "summary": "Update an SMS template",
        "tags": [
          "Sms templates"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `SMSTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplate"
                }
              }
            }
          }
        },
        "summary": "Delete an SMS template",
        "tags": [
          "Sms templates"
        ]
      }
    },
    "/sms_templates/{id}/preview.png": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The image of the compiled SMS template",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Preview an SMS template as an image",
        "security": [],
        "tags": [
          "Sms templates"
        ]
      }
    },
    "/sms_templates/{id}/preview": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An HTML preview of the SMS template",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Preview an SMS template",
        "security": [],
        "tags": [
          "Sms templates"
        ]
      }
    },
    "/sms_templates/{id}/copy": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `SmsTemplate` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplate"
                }
              }
            }
          }
        },
        "summary": "Create a copy of an existing SMS template",
        "tags": [
          "Sms templates"
        ]
      }
    },
    "/sms_templates/{id}/copy_one_off": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template to copy",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The copied `SmsTemplate` object. As a one-off, it will not be returned from `GET /businesses/:id/sms_templates`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplate"
                }
              }
            }
          }
        },
        "summary": "Copy an SMS template as a one-off",
        "tags": [
          "Sms templates"
        ]
      }
    },
    "/sms_templates/{id}/embeds": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expires_in": {
                    "type": "number",
                    "description": "The number of seconds until the embed will expire"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `SmsTemplateEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplateEmbed"
                }
              }
            }
          }
        },
        "summary": "Create an SMS template embed to edit an existing SMS template",
        "tags": [
          "Sms template embeds"
        ]
      }
    },
    "/businesses/{id}/sms_templates/embeds": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expires_in": {
                    "type": "number",
                    "description": "The number of seconds until the embed will expire"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `EmailTemplateEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplateEmbed"
                }
              }
            }
          }
        },
        "summary": "Create an SMS template embed to create a brand new SMS template",
        "tags": [
          "Sms template embeds"
        ]
      }
    },
    "/sms_template_embeds/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `SmsTemplateEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SMSTemplateEmbed"
                }
              }
            }
          }
        },
        "summary": "Retrieve an SMS template embed",
        "tags": [
          "Sms template embeds"
        ]
      }
    },
    "/sms_template_embeds/{id}/show": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template embed",
            "required": true
          },
          {
            "in": "query",
            "name": "hide_top_bar",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to hide the top bar when embedding the SMS template editor",
            "required": false
          },
          {
            "in": "query",
            "name": "hide_buttons",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to hide all buttons when embedding the SMS template editor",
            "required": false
          },
          {
            "in": "query",
            "name": "hide_save_button",
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to hide the \"Save\" button when embedding the SMS template editor",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "The embeddable HTML that will render a UI for editing the SMS template",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Embed the SMS template editor",
        "security": [],
        "tags": [
          "Sms template embeds"
        ]
      }
    },
    "/sms_templates/{id}/draft_send": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "description": "The ID of the phone number to send the SMS from"
                  },
                  "to": {
                    "type": "string",
                    "description": "The phone number to send the SMS to"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Variables to use in the email template"
                  }
                },
                "required": [
                  "from",
                  "to"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A `DraftSMSMessage` representing what would have been sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftSMSMessage"
                }
              }
            }
          }
        },
        "summary": "Draft send an SMS message from an SMS template",
        "tags": [
          "Sms messages"
        ]
      }
    },
    "/sms_templates/{id}/send": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the SMS template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "description": "The ID of the phone number from which to send the SMS"
                      },
                      "to": {
                        "type": "string",
                        "description": "The phone number to send the SMS to"
                      },
                      "variables": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The variables to be injected into the SMS template"
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "description": "The ID of the phone number from which to send the SMS"
                      },
                      "customer": {
                        "type": "string",
                        "description": "The ID of the customer to send the SMS to"
                      },
                      "variables": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The variables to be injected into the SMS template in addition to the variables already induced by the customer"
                      }
                    },
                    "required": [
                      "from",
                      "customer"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The resulting `SentSmsMessage` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SentSMSMessage"
                }
              }
            }
          }
        },
        "summary": "Send an SMS based off an SMS template",
        "tags": [
          "Sms messages"
        ]
      }
    },
    "/businesses/{id}/campaigns": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `campaigns` property which is an array of `Campaign` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaigns": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Campaign"
                      },
                      "description": "An array of campaigns"
                    }
                  },
                  "required": [
                    "campaigns"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all campaigns",
        "tags": [
          "Campaigns"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the campaign"
                  },
                  "enrolled_customers": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "all"
                        ]
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "The IDs of the customers enrolled in the campaign, or \"all\" to enroll every current customer of the business"
                  },
                  "excluded_customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The IDs of the customers excluded by the campaign"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "email"
                              ],
                              "description": "The step type. Always \"email\" for this step"
                            },
                            "custom_step_id": {
                              "type": "string",
                              "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                            },
                            "email_template_id": {
                              "type": "string",
                              "description": "The ID of the email template to use in this step"
                            }
                          },
                          "required": [
                            "type",
                            "email_template_id"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "email"
                              ],
                              "description": "The step type. Always \"email\" for this step"
                            },
                            "custom_step_id": {
                              "type": "string",
                              "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                            },
                            "subject": {
                              "type": "string",
                              "description": "The subject of the email template to use at this step"
                            },
                            "body": {
                              "type": "string",
                              "description": "The body of the email template to use at this step"
                            }
                          },
                          "required": [
                            "type",
                            "subject",
                            "body"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "sms"
                              ],
                              "description": "The step type. Always \"sms\" for this step"
                            },
                            "custom_step_id": {
                              "type": "string",
                              "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                            },
                            "sms_template_id": {
                              "type": "string",
                              "description": "The ID of the SMS template to use in this step"
                            }
                          },
                          "required": [
                            "type",
                            "sms_template_id"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "sms"
                              ],
                              "description": "The step type. Always \"sms\" for this step"
                            },
                            "custom_step_id": {
                              "type": "string",
                              "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                            },
                            "message": {
                              "type": "string",
                              "description": "The message to send in this step"
                            }
                          },
                          "required": [
                            "type",
                            "message"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "wait"
                              ],
                              "description": "The step type. Always \"wait\" for this step"
                            },
                            "duration": {
                              "type": "integer",
                              "description": "The number of seconds to wait"
                            }
                          },
                          "required": [
                            "type",
                            "duration"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "if"
                              ],
                              "description": "The step type. Always \"if\" for this step"
                            },
                            "filter": {
                              "type": "string",
                              "description": "The filter to use in this step"
                            }
                          },
                          "required": [
                            "type",
                            "filter"
                          ]
                        }
                      ]
                    },
                    "description": "The steps of the campaign"
                  },
                  "email_address": {
                    "type": "string",
                    "nullable": true,
                    "description": "The email address used to send emails in the campaign. Will be the ID of an email-like object"
                  },
                  "phone_number": {
                    "type": "string",
                    "nullable": true,
                    "description": "The phone number used to send SMS messages in the campaign. Will be the ID of a phone number-like object"
                  },
                  "scheduled_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "The scheduled time of the campaign in ISO 8601 format"
                  },
                  "segment": {
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the segment to attach to the campaign"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "nullable": true,
                    "description": "The metadata of the campaign"
                  }
                },
                "required": [
                  "name",
                  "enrolled_customers",
                  "steps"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Create a campaign",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Retrieve a campaign",
        "tags": [
          "Campaigns"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The updated name of the campaign. Can be omitted"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "email"
                              ],
                              "description": "The step type. Always \"email\" for this step"
                            },
                            "custom_step_id": {
                              "type": "string",
                              "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                            },
                            "email_template_id": {
                              "type": "string",
                              "description": "The ID of the email template to use in this step"
                            }
                          },
                          "required": [
                            "type",
                            "email_template_id"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "email"
                              ],
                              "description": "The step type. Always \"email\" for this step"
                            },
                            "custom_step_id": {
                              "type": "string",
                              "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                            },
                            "subject": {
                              "type": "string",
                              "description": "The subject of the email template to use at this step"
                            },
                            "body": {
                              "type": "string",
                              "description": "The body of the email template to use at this step"
                            }
                          },
                          "required": [
                            "type",
                            "subject",
                            "body"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "sms"
                              ],
                              "description": "The step type. Always \"sms\" for this step"
                            },
                            "custom_step_id": {
                              "type": "string",
                              "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                            },
                            "sms_template_id": {
                              "type": "string",
                              "description": "The ID of the SMS template to use in this step"
                            }
                          },
                          "required": [
                            "type",
                            "sms_template_id"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "sms"
                              ],
                              "description": "The step type. Always \"sms\" for this step"
                            },
                            "custom_step_id": {
                              "type": "string",
                              "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                            },
                            "message": {
                              "type": "string",
                              "description": "The message to send in this step"
                            }
                          },
                          "required": [
                            "type",
                            "message"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "wait"
                              ],
                              "description": "The step type. Always \"wait\" for this step"
                            },
                            "duration": {
                              "type": "integer",
                              "description": "The number of seconds to wait"
                            }
                          },
                          "required": [
                            "type",
                            "duration"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "if"
                              ],
                              "description": "The step type. Always \"if\" for this step"
                            },
                            "filter": {
                              "type": "string",
                              "description": "The filter to use in this step"
                            }
                          },
                          "required": [
                            "type",
                            "filter"
                          ]
                        }
                      ]
                    },
                    "description": "The updated steps of the campaign. Can be omitted"
                  },
                  "segment": {
                    "type": "string",
                    "nullable": true,
                    "description": "The updated segment of the campaign. Can be omitted"
                  },
                  "enrolled_customers": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "all"
                        ]
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "The updated enrolled customer IDs of the campaign, or \"all\" to enroll every current customer of the business. Can be omitted"
                  },
                  "excluded_customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The updated IDs of the customers excluded by the campaign"
                  },
                  "email_address": {
                    "type": "string",
                    "nullable": true,
                    "description": "The email address used to send emails in the campaign. Will be the ID of an email-like object"
                  },
                  "phone_number": {
                    "type": "string",
                    "nullable": true,
                    "description": "The phone number used to send SMS messages in the campaign. Will be the ID of a phone number-like object"
                  },
                  "scheduled_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "The scheduled time of the campaign in ISO 8601 format"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "nullable": true,
                    "description": "The metadata of the campaign"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Update a campaign",
        "tags": [
          "Campaigns"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Delete a campaign",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/start": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Start a campaign",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/stop": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Stop a campaign",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/copy": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The copied `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Create a copy of an existing campaign",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/schedule": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign to schedule",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduled_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "The scheduled time of the campaign in ISO 8601 format"
                  },
                  "scheduled_end_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "The scheduled end time of the campaign in ISO 8601 format"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The scheduled `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Schedule a campaign to begin",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/preview.png": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The preview image of the campaign",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Preview a campaign as an image",
        "security": [],
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/preview": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The HTML preview of the campaign",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Preview a campaign",
        "security": [],
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/view": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An interactable canvas with the campaign and its many steps",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "View a campaign interactively",
        "security": [],
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/test_send": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign to test-send",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer": {
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the customer to test-send the campaign to"
                  },
                  "to_email_address": {
                    "type": "string",
                    "nullable": true,
                    "description": "The email address to test-send the campaign to"
                  },
                  "to_phone_number": {
                    "type": "string",
                    "nullable": true,
                    "description": "The phone number to test-send the campaign to"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": true,
                    "nullable": true,
                    "description": "The variables to test-send the campaign with"
                  },
                  "email_address": {
                    "type": "string",
                    "description": "The ID of the email address to use as the sending address (overrides the campaign's configured email address)"
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "The ID of the phone number to use as the sending phone number (overrides the campaign's configured phone number)"
                  },
                  "step_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "nullable": true,
                    "description": "The IDs of the steps to test-send (if omitted, all steps are sent)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether the test-send was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "summary": "Test-send a campaign",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/check_sendability": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The sendability of the campaign",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sendable": {
                      "type": "boolean",
                      "description": "Whether the campaign is sendable"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "business_missing_variables": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The missing variables for the business"
                        },
                        "campaign_missing_variables": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The missing variables for the campaign"
                        },
                        "customers_missing_variables": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "The ID of the customer"
                              },
                              "missing_variables": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "The missing variables for the customer"
                              }
                            },
                            "required": [
                              "id",
                              "missing_variables"
                            ]
                          },
                          "description": "The missing variables for the customers"
                        },
                        "unknown_variables": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The unknown variables in the campaign"
                        }
                      },
                      "required": [
                        "business_missing_variables",
                        "campaign_missing_variables",
                        "customers_missing_variables",
                        "unknown_variables"
                      ],
                      "description": "The errors if the campaign is not sendable. Only returned if `sendable` is `false`"
                    }
                  },
                  "required": [
                    "sendable"
                  ]
                }
              }
            }
          }
        },
        "summary": "Check the sendability of a campaign",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/variables": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The variables associated with the campaign's steps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The variables for the campaign"
                    }
                  },
                  "required": [
                    "variables"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get all variables associated with a campaign's steps",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaigns/{id}/executions": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The executions of the campaign",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "executions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Execution"
                      },
                      "description": "The executions of the campaign"
                    }
                  },
                  "required": [
                    "executions"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get the executions of a campaign",
        "tags": [
          "Executions"
        ]
      }
    },
    "/campaign_steps/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign step",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign step — the same shape as the entries in a campaign's `steps` array",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "email"
                          ],
                          "description": "The step type. Always \"email\" for this step"
                        },
                        "custom_step_id": {
                          "type": "string",
                          "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                        },
                        "email_template_id": {
                          "type": "string",
                          "description": "The ID of the email template to use in this step"
                        }
                      },
                      "required": [
                        "type",
                        "email_template_id"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "email"
                          ],
                          "description": "The step type. Always \"email\" for this step"
                        },
                        "custom_step_id": {
                          "type": "string",
                          "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                        },
                        "subject": {
                          "type": "string",
                          "description": "The subject of the email template to use at this step"
                        },
                        "body": {
                          "type": "string",
                          "description": "The body of the email template to use at this step"
                        }
                      },
                      "required": [
                        "type",
                        "subject",
                        "body"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "sms"
                          ],
                          "description": "The step type. Always \"sms\" for this step"
                        },
                        "custom_step_id": {
                          "type": "string",
                          "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                        },
                        "sms_template_id": {
                          "type": "string",
                          "description": "The ID of the SMS template to use in this step"
                        }
                      },
                      "required": [
                        "type",
                        "sms_template_id"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "sms"
                          ],
                          "description": "The step type. Always \"sms\" for this step"
                        },
                        "custom_step_id": {
                          "type": "string",
                          "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                        },
                        "message": {
                          "type": "string",
                          "description": "The message to send in this step"
                        }
                      },
                      "required": [
                        "type",
                        "message"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "wait"
                          ],
                          "description": "The step type. Always \"wait\" for this step"
                        },
                        "duration": {
                          "type": "integer",
                          "description": "The number of seconds to wait"
                        }
                      },
                      "required": [
                        "type",
                        "duration"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "if"
                          ],
                          "description": "The step type. Always \"if\" for this step"
                        },
                        "filter": {
                          "type": "string",
                          "description": "The filter to use in this step"
                        }
                      },
                      "required": [
                        "type",
                        "filter"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve a campaign step",
        "tags": [
          "Campaign steps"
        ]
      }
    },
    "/campaigns/{id}/customer_metadatas": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An object with a `customer_metadatas` key containing an array of metadata objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customer_metadatas": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CampaignCustomerMetadata"
                      },
                      "description": "An array of campaign customer metadata objects"
                    }
                  },
                  "required": [
                    "customer_metadatas"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all campaign customer metadata for a campaign",
        "tags": [
          "Campaign customer metadatas"
        ]
      }
    },
    "/campaigns/{id}/customer_metadatas/{customer_id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          },
          {
            "in": "path",
            "name": "customer_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `CampaignCustomerMetadata` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignCustomerMetadata"
                }
              }
            }
          }
        },
        "summary": "Get campaign customer metadata for a specific customer",
        "tags": [
          "Campaign customer metadatas"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          },
          {
            "in": "path",
            "name": "customer_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "The metadata to associate with this campaign-customer pair"
                  }
                },
                "required": [
                  "metadata"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created or updated `CampaignCustomerMetadata` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignCustomerMetadata"
                }
              }
            }
          }
        },
        "summary": "Create or update campaign customer metadata",
        "tags": [
          "Campaign customer metadatas"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          },
          {
            "in": "path",
            "name": "customer_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `CampaignCustomerMetadata` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignCustomerMetadata"
                }
              }
            }
          }
        },
        "summary": "Delete campaign customer metadata",
        "tags": [
          "Campaign customer metadatas"
        ]
      }
    },
    "/campaign_templates/{id}/campaign_drafts": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "business": {
                    "type": "string",
                    "description": "The business ID"
                  }
                },
                "required": [
                  "business"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Create a campaign from a campaign template",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/campaign_templates/{id}/campaigns": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "business": {
                    "type": "string",
                    "description": "The business ID"
                  }
                },
                "required": [
                  "business"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Campaign` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          }
        },
        "summary": "Create a campaign from a campaign template",
        "tags": [
          "Campaigns"
        ]
      }
    },
    "/businesses/{id}/triggers": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "project_defined_event": {
                        "type": "string",
                        "description": "The ID of a project defined event that triggers the trigger"
                      },
                      "name": {
                        "type": "string",
                        "description": "The name of the trigger"
                      },
                      "filter": {
                        "type": "string",
                        "nullable": true,
                        "description": "A further filter on the trigger"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "nullable": true,
                        "description": "Metadata for the trigger"
                      },
                      "steps": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "email_template_id": {
                                  "type": "string",
                                  "description": "The ID of the email template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "email_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "subject": {
                                  "type": "string",
                                  "description": "The subject of the email template to use at this step"
                                },
                                "body": {
                                  "type": "string",
                                  "description": "The body of the email template to use at this step"
                                }
                              },
                              "required": [
                                "type",
                                "subject",
                                "body"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "sms_template_id": {
                                  "type": "string",
                                  "description": "The ID of the SMS template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "sms_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "message": {
                                  "type": "string",
                                  "description": "The message to send in this step"
                                }
                              },
                              "required": [
                                "type",
                                "message"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "wait"
                                  ],
                                  "description": "The step type. Always \"wait\" for this step"
                                },
                                "duration": {
                                  "type": "integer",
                                  "description": "The number of seconds to wait"
                                }
                              },
                              "required": [
                                "type",
                                "duration"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "if"
                                  ],
                                  "description": "The step type. Always \"if\" for this step"
                                },
                                "filter": {
                                  "type": "string",
                                  "description": "The filter to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "filter"
                              ]
                            }
                          ]
                        },
                        "description": "The steps of the trigger"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of an email address or project email address. Will be used to send emails as part of this trigger"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of a phone number or project phone number. Will be used to send SMS messages as part of this trigger"
                      },
                      "excluded_customers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The IDs of the customers excluded by the trigger"
                      }
                    },
                    "required": [
                      "project_defined_event",
                      "name",
                      "steps"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "internal_event_definition": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "customer_created",
                              "customer_joined_segment",
                              "customer_birthday"
                            ],
                            "description": "The type of internal event definition. Must be 'customer_created', 'customer_joined_segment', or 'customer_birthday'"
                          },
                          "segment": {
                            "type": "string",
                            "nullable": true,
                            "description": "The ID of the segment that the customer joined. Can only be provided with 'customer_joined_segment'"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "description": "The internal event definition that triggers the trigger"
                      },
                      "name": {
                        "type": "string",
                        "description": "The name of the trigger"
                      },
                      "filter": {
                        "type": "string",
                        "nullable": true,
                        "description": "A further filter on the trigger"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "nullable": true,
                        "description": "Metadata for the trigger"
                      },
                      "steps": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "email_template_id": {
                                  "type": "string",
                                  "description": "The ID of the email template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "email_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "subject": {
                                  "type": "string",
                                  "description": "The subject of the email template to use at this step"
                                },
                                "body": {
                                  "type": "string",
                                  "description": "The body of the email template to use at this step"
                                }
                              },
                              "required": [
                                "type",
                                "subject",
                                "body"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "sms_template_id": {
                                  "type": "string",
                                  "description": "The ID of the SMS template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "sms_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "message": {
                                  "type": "string",
                                  "description": "The message to send in this step"
                                }
                              },
                              "required": [
                                "type",
                                "message"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "wait"
                                  ],
                                  "description": "The step type. Always \"wait\" for this step"
                                },
                                "duration": {
                                  "type": "integer",
                                  "description": "The number of seconds to wait"
                                }
                              },
                              "required": [
                                "type",
                                "duration"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "if"
                                  ],
                                  "description": "The step type. Always \"if\" for this step"
                                },
                                "filter": {
                                  "type": "string",
                                  "description": "The filter to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "filter"
                              ]
                            }
                          ]
                        },
                        "description": "The steps of the trigger"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of an email address or project email address. Will be used to send emails as part of this trigger"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of a phone number or project phone number. Will be used to send SMS messages as part of this trigger"
                      },
                      "excluded_customers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The IDs of the customers excluded by the trigger"
                      }
                    },
                    "required": [
                      "internal_event_definition",
                      "name",
                      "steps"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Trigger` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          }
        },
        "summary": "Create a trigger",
        "tags": [
          "Triggers"
        ]
      },
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An object with a `triggers` key which contains an array of `Trigger` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "triggers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Trigger"
                      },
                      "description": "An array of triggers"
                    }
                  },
                  "required": [
                    "triggers"
                  ]
                }
              }
            }
          }
        },
        "summary": "List triggers for a business",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/triggers/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `Trigger` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          }
        },
        "summary": "Retrieve a trigger",
        "tags": [
          "Triggers"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "project_defined_event": {
                        "type": "string",
                        "description": "The ID of a project defined event"
                      },
                      "name": {
                        "type": "string",
                        "description": "The name of the trigger"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of an email address or project email address. Will be used to send emails as part of this trigger"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of a phone number or project phone number. Will be used to send SMS messages as part of this trigger"
                      },
                      "excluded_customers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The IDs of the customers excluded by the trigger"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "nullable": true,
                        "description": "Metadata for the trigger"
                      },
                      "steps": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "email_template_id": {
                                  "type": "string",
                                  "description": "The ID of the email template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "email_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "subject": {
                                  "type": "string",
                                  "description": "The subject of the email template to use at this step"
                                },
                                "body": {
                                  "type": "string",
                                  "description": "The body of the email template to use at this step"
                                }
                              },
                              "required": [
                                "type",
                                "subject",
                                "body"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "sms_template_id": {
                                  "type": "string",
                                  "description": "The ID of the SMS template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "sms_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "message": {
                                  "type": "string",
                                  "description": "The message to send in this step"
                                }
                              },
                              "required": [
                                "type",
                                "message"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "wait"
                                  ],
                                  "description": "The step type. Always \"wait\" for this step"
                                },
                                "duration": {
                                  "type": "integer",
                                  "description": "The number of seconds to wait"
                                }
                              },
                              "required": [
                                "type",
                                "duration"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "if"
                                  ],
                                  "description": "The step type. Always \"if\" for this step"
                                },
                                "filter": {
                                  "type": "string",
                                  "description": "The filter to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "filter"
                              ]
                            }
                          ]
                        },
                        "description": "The steps of the trigger"
                      }
                    },
                    "required": [
                      "project_defined_event"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "internal_event_definition": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "customer_created",
                              "customer_joined_segment",
                              "customer_birthday"
                            ],
                            "description": "The type of internal event definition. Must be 'customer_created', 'customer_joined_segment', or 'customer_birthday'"
                          },
                          "segment": {
                            "type": "string",
                            "nullable": true,
                            "description": "The ID of the segment that the customer joined. Can only be provided with 'customer_joined_segment'"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "description": "The internal event definition that triggers the trigger"
                      },
                      "name": {
                        "type": "string",
                        "description": "The name of the trigger"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of an email address or project email address. Will be used to send emails as part of this trigger"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of a phone number or project phone number. Will be used to send SMS messages as part of this trigger"
                      },
                      "excluded_customers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The IDs of the customers excluded by the trigger"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "nullable": true,
                        "description": "Metadata for the trigger"
                      },
                      "steps": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "email_template_id": {
                                  "type": "string",
                                  "description": "The ID of the email template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "email_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "subject": {
                                  "type": "string",
                                  "description": "The subject of the email template to use at this step"
                                },
                                "body": {
                                  "type": "string",
                                  "description": "The body of the email template to use at this step"
                                }
                              },
                              "required": [
                                "type",
                                "subject",
                                "body"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "sms_template_id": {
                                  "type": "string",
                                  "description": "The ID of the SMS template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "sms_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "message": {
                                  "type": "string",
                                  "description": "The message to send in this step"
                                }
                              },
                              "required": [
                                "type",
                                "message"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "wait"
                                  ],
                                  "description": "The step type. Always \"wait\" for this step"
                                },
                                "duration": {
                                  "type": "integer",
                                  "description": "The number of seconds to wait"
                                }
                              },
                              "required": [
                                "type",
                                "duration"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "if"
                                  ],
                                  "description": "The step type. Always \"if\" for this step"
                                },
                                "filter": {
                                  "type": "string",
                                  "description": "The filter to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "filter"
                              ]
                            }
                          ]
                        },
                        "description": "The steps of the trigger"
                      }
                    },
                    "required": [
                      "internal_event_definition"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the trigger"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of an email address or project email address. Will be used to send emails as part of this trigger"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The ID of a phone number or project phone number. Will be used to send SMS messages as part of this trigger"
                      },
                      "excluded_customers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The IDs of the customers excluded by the trigger"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "nullable": true,
                        "description": "Metadata for the trigger"
                      },
                      "steps": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "email_template_id": {
                                  "type": "string",
                                  "description": "The ID of the email template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "email_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ],
                                  "description": "The step type. Always \"email\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                                },
                                "subject": {
                                  "type": "string",
                                  "description": "The subject of the email template to use at this step"
                                },
                                "body": {
                                  "type": "string",
                                  "description": "The body of the email template to use at this step"
                                }
                              },
                              "required": [
                                "type",
                                "subject",
                                "body"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "sms_template_id": {
                                  "type": "string",
                                  "description": "The ID of the SMS template to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "sms_template_id"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "sms"
                                  ],
                                  "description": "The step type. Always \"sms\" for this step"
                                },
                                "custom_step_id": {
                                  "type": "string",
                                  "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                                },
                                "message": {
                                  "type": "string",
                                  "description": "The message to send in this step"
                                }
                              },
                              "required": [
                                "type",
                                "message"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "wait"
                                  ],
                                  "description": "The step type. Always \"wait\" for this step"
                                },
                                "duration": {
                                  "type": "integer",
                                  "description": "The number of seconds to wait"
                                }
                              },
                              "required": [
                                "type",
                                "duration"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "if"
                                  ],
                                  "description": "The step type. Always \"if\" for this step"
                                },
                                "filter": {
                                  "type": "string",
                                  "description": "The filter to use in this step"
                                }
                              },
                              "required": [
                                "type",
                                "filter"
                              ]
                            }
                          ]
                        },
                        "description": "The steps of the trigger"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Trigger` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          }
        },
        "summary": "Update a trigger",
        "tags": [
          "Triggers"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `Trigger` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          }
        },
        "summary": "Delete a trigger",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/triggers/{id}/view": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An interactable canvas with the trigger and its many steps",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "View a trigger interactively",
        "security": [],
        "tags": [
          "Triggers"
        ]
      }
    },
    "/triggers/{id}/activate": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `Trigger` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          }
        },
        "summary": "Activate a trigger",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/triggers/{id}/deactivate": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `Trigger` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          }
        },
        "summary": "Deactivate a trigger",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/triggers/{id}/copy": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The copied `Trigger` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          }
        },
        "summary": "Create a copy of an existing trigger",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/triggers/{id}/test_send": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger to test-send",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer": {
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the customer to test-send the trigger to"
                  },
                  "to_email_address": {
                    "type": "string",
                    "nullable": true,
                    "description": "The email address to test-send the trigger to"
                  },
                  "to_phone_number": {
                    "type": "string",
                    "nullable": true,
                    "description": "The phone number to test-send the trigger to"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": true,
                    "nullable": true,
                    "description": "The variables to test-send the trigger with"
                  },
                  "email_address": {
                    "type": "string",
                    "description": "The ID of the email address to use as the sending address (overrides the trigger's configured email address)"
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "The ID of the phone number to use as the sending phone number (overrides the trigger's configured phone number)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Whether the test send was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "summary": "Test-send a trigger",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/triggers/{id}/variables": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The variables associated with the trigger's steps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The variables for the trigger"
                    }
                  },
                  "required": [
                    "variables"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get all variables associated with a trigger's steps",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/triggers/{id}/executions": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The executions of the trigger",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "executions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TriggerExecution"
                      },
                      "description": "The executions of the trigger"
                    }
                  },
                  "required": [
                    "executions"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get the executions of a trigger",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/executions/{id}/execution_step_logs": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the execution",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with an `execution_step_logs` property",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "execution_step_logs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExecutionStepLog"
                      },
                      "description": "An array of execution step logs"
                    }
                  },
                  "required": [
                    "execution_step_logs"
                  ]
                }
              }
            }
          }
        },
        "summary": "List execution step logs for an execution",
        "tags": [
          "Execution step logs"
        ]
      }
    },
    "/trigger_executions/{id}/execution_step_logs": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger execution",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with an `execution_step_logs` property",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "execution_step_logs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ExecutionStepLog"
                      },
                      "description": "An array of execution step logs"
                    }
                  },
                  "required": [
                    "execution_step_logs"
                  ]
                }
              }
            }
          }
        },
        "summary": "List execution step logs for a trigger execution",
        "tags": [
          "Execution step logs"
        ]
      }
    },
    "/trigger_templates/{id}/trigger_drafts": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "business": {
                    "type": "string",
                    "description": "The business ID"
                  }
                },
                "required": [
                  "business"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Trigger` draft",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trigger"
                }
              }
            }
          }
        },
        "summary": "Create a trigger draft from a trigger template",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/businesses/{id}/email_blasts": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `email_blasts` property which is an array of `EmailBlast` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "email_blasts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EmailBlast"
                      },
                      "description": "An array of email blasts"
                    }
                  },
                  "required": [
                    "email_blasts"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all email blasts",
        "tags": [
          "Email blasts"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the email blast"
                  },
                  "email_template": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {}
                    ],
                    "description": "The ID of the email template or the content of the email template to create"
                  },
                  "enrolled_customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The ID of the customers enrolled in the email blast"
                  },
                  "excluded_customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The ID of the customers excluded from the email blast"
                  },
                  "email_address": {
                    "type": "string",
                    "nullable": true,
                    "description": "The email address used to send the email blast. Will be the ID of an email-address-like object"
                  },
                  "segment": {
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the segment to attach to the email blast"
                  }
                },
                "required": [
                  "name",
                  "email_template"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `EmailBlast` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBlast"
                }
              }
            }
          }
        },
        "summary": "Create an email blast",
        "tags": [
          "Email blasts"
        ]
      }
    },
    "/email_blasts/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email blast",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An `EmailBlast` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBlast"
                }
              }
            }
          }
        },
        "summary": "Retrieve an email blast",
        "tags": [
          "Email blasts"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email blast",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The updated name of the email blast. Can be omitted"
                  },
                  "segment": {
                    "type": "string",
                    "nullable": true,
                    "description": "The updated segment of the email blast. Can be omitted"
                  },
                  "enrolled_customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The updated enrolled customer IDs of the email blast. Can be omitted"
                  },
                  "excluded_customers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The updated excluded customer IDs of the email blast"
                  },
                  "email_address": {
                    "type": "string",
                    "nullable": true,
                    "description": "The email address used to send emails in the email blast. Will be the ID of an email-like object"
                  },
                  "scheduled_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "The scheduled time of the email blast in ISO 8601 format"
                  },
                  "email_template": {
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the email template to use for the email blast"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `EmailBlast` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBlast"
                }
              }
            }
          }
        },
        "summary": "Update an email blast",
        "tags": [
          "Email blasts"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email blast",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted email blast",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBlast"
                }
              }
            }
          }
        },
        "summary": "Delete an email blast",
        "tags": [
          "Email blasts"
        ]
      }
    },
    "/email_blasts/{id}/start": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email blast",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The started `EmailBlast` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBlast"
                }
              }
            }
          }
        },
        "summary": "Start an email blast",
        "tags": [
          "Email blasts"
        ]
      }
    },
    "/email_blasts/{id}/stop": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email blast",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The stopped `EmailBlast` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBlast"
                }
              }
            }
          }
        },
        "summary": "Stop an email blast",
        "tags": [
          "Email blasts"
        ]
      }
    },
    "/email_blasts/{id}/schedule": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email blast",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduled_at": {
                    "type": "string",
                    "description": "The scheduled time of the email blast in ISO 8601 format"
                  }
                },
                "required": [
                  "scheduled_at"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The scheduled `EmailBlast` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBlast"
                }
              }
            }
          }
        },
        "summary": "Schedule an email blast",
        "tags": [
          "Email blasts"
        ]
      }
    },
    "/email_blasts/{id}/executions": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email blast",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The executions of the email blast",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "executions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EmailBlastExecution"
                      },
                      "description": "The executions of the email blast"
                    }
                  },
                  "required": [
                    "executions"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get the executions of an email blast",
        "tags": [
          "Email blasts"
        ]
      }
    },
    "/email_blasts/{id}/customers": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the email blast",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `customers` property, which is an array of `Customer` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      },
                      "description": "The customers enrolled in the email blast"
                    }
                  },
                  "required": [
                    "customers"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get all the enrolled customers for an email blast",
        "tags": [
          "Email blasts"
        ]
      }
    },
    "/project_email_addresses": {
      "get": {
        "responses": {
          "200": {
            "description": "An object with key `project_email_addresses` which maps to an array of `EmailAddress` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "project_email_addresses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EmailAddress"
                      },
                      "description": "An array of project email addresses"
                    }
                  },
                  "required": [
                    "project_email_addresses"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all project email addresses",
        "tags": [
          "Project email addresses"
        ]
      }
    },
    "/project_email_addresses/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project email address",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The project-level `EmailAddress` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailAddress"
                }
              }
            }
          }
        },
        "summary": "Retrieve a project email address",
        "tags": [
          "Project email addresses"
        ]
      }
    },
    "/project_phone_numbers": {
      "get": {
        "responses": {
          "200": {
            "description": "A dictionary with a `project_phone_numbers` property which is an array of `ProjectPhoneNumber` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "project_phone_numbers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectPhoneNumber"
                      },
                      "description": "An array of project phone numbers"
                    }
                  },
                  "required": [
                    "project_phone_numbers"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all project phone numbers",
        "tags": [
          "Project phone numbers"
        ]
      }
    },
    "/project_phone_numbers/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the project phone number",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `ProjectPhoneNumber` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectPhoneNumber"
                }
              }
            }
          }
        },
        "summary": "Retrieve a project phone number",
        "tags": [
          "Project phone numbers"
        ]
      }
    },
    "/campaign_templates": {
      "get": {
        "responses": {
          "200": {
            "description": "A dictionary with a `campaign_templates` property that contains an array of `CampaignTemplate` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaign_templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CampaignTemplate"
                      },
                      "description": "The campaign templates associated with this project"
                    }
                  },
                  "required": [
                    "campaign_templates"
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve all campaign templates",
        "tags": [
          "Campaign templates"
        ]
      }
    },
    "/campaign_templates/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The retrieved `CampaignTemplate`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignTemplate"
                }
              }
            }
          }
        },
        "summary": "Retrieve a campaign template",
        "tags": [
          "Campaign templates"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "The title of the campaign template"
                  },
                  "description": {
                    "type": "string",
                    "description": "The description of the campaign template"
                  },
                  "campaign_name": {
                    "type": "string",
                    "description": "The name of the campaign that will be created when the campaign template is used as a base"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `CampaignTemplate`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignTemplate"
                }
              }
            }
          }
        },
        "summary": "Update a campaign template",
        "tags": [
          "Campaign templates"
        ]
      }
    },
    "/trigger_templates": {
      "get": {
        "responses": {
          "200": {
            "description": "A dictionary with a `trigger_templates` property that contains an array of `TriggerTemplate` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "trigger_templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TriggerTemplate"
                      },
                      "description": "The trigger templates associated with this project"
                    }
                  },
                  "required": [
                    "trigger_templates"
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve all trigger templates",
        "tags": [
          "Trigger templates"
        ]
      }
    },
    "/trigger_templates/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger template",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The retrieved `TriggerTemplate`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerTemplate"
                }
              }
            }
          }
        },
        "summary": "Retrieve a trigger template",
        "tags": [
          "Trigger templates"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the trigger template",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "The title of the trigger template"
                  },
                  "description": {
                    "type": "string",
                    "description": "The description of the trigger template"
                  },
                  "trigger_name": {
                    "type": "string",
                    "description": "The name of the trigger that will be created when the trigger template is used as a base"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `TriggerTemplate`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerTemplate"
                }
              }
            }
          }
        },
        "summary": "Update a trigger template",
        "tags": [
          "Trigger templates"
        ]
      }
    },
    "/businesses/{id}/phone_numbers": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The phone numbers associated with the business",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "phone_numbers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PhoneNumber"
                      },
                      "description": "The phone numbers for the business"
                    }
                  },
                  "required": [
                    "phone_numbers"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all phone numbers for a business",
        "tags": [
          "Phone numbers"
        ]
      }
    },
    "/phone_numbers/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the phone number",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `PhoneNumber` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneNumber"
                }
              }
            }
          }
        },
        "summary": "Retrieve a phone number",
        "tags": [
          "Phone numbers"
        ]
      }
    },
    "/businesses/{id}/filter_definitions": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `filter_definitions` property which is an array of `FilterDefinition` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "filter_definitions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FilterDefinition"
                      },
                      "description": "An array of filter definitions"
                    }
                  },
                  "required": [
                    "filter_definitions"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all filter definitions",
        "tags": [
          "Filter definitions"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "variable_name": {
                    "type": "string",
                    "description": "The variable name of the filter definition"
                  },
                  "label": {
                    "type": "string",
                    "description": "The label of the filter definition"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "select",
                      "text",
                      "number",
                      "boolean",
                      "datetime",
                      "currency",
                      "array_of_known"
                    ],
                    "description": "The type of the filter definition"
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FilterDefinitionOption"
                    },
                    "description": "The options for the select dropdown"
                  }
                },
                "required": [
                  "variable_name",
                  "label",
                  "type",
                  "options"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `FilterDefinition` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterDefinition"
                }
              }
            }
          }
        },
        "summary": "Create a filter definition",
        "tags": [
          "Filter definitions"
        ]
      }
    },
    "/filter_definitions/{id}": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the filter definition",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "variable_name": {
                    "type": "string",
                    "description": "The updated variable name of the filter definition. Can be omitted"
                  },
                  "label": {
                    "type": "string",
                    "description": "The updated label of the filter definition. Can be omitted"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "select",
                      "text",
                      "number",
                      "boolean",
                      "date",
                      "datetime",
                      "currency",
                      "array_of_known"
                    ],
                    "description": "The updated type of the filter definition. Can be omitted"
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FilterDefinitionOption"
                    },
                    "description": "The updated options of the filter definition. Can be omitted. Will wholly replace the existing options"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `FilterDefinition` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterDefinition"
                }
              }
            }
          }
        },
        "summary": "Update a filter definition",
        "tags": [
          "Filter definitions"
        ]
      },
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the filter definition",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `FilterDefinition` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterDefinition"
                }
              }
            }
          }
        },
        "summary": "Retrieve a filter definition",
        "tags": [
          "Filter definitions"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the filter definition",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The created `FilterDefinition` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterDefinition"
                }
              }
            }
          }
        },
        "summary": "Delete a filter definition",
        "tags": [
          "Filter definitions"
        ]
      }
    },
    "/filter_definitions/{id}/enable": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the filter definition",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The enabled `FilterDefinition`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterDefinition"
                }
              }
            }
          }
        },
        "summary": "Enable a filter definition",
        "tags": [
          "Filter definitions"
        ]
      }
    },
    "/filter_definitions/{id}/disable": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the filter definition",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The disabled `FilterDefinition`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterDefinition"
                }
              }
            }
          }
        },
        "summary": "Disable a filter definition",
        "tags": [
          "Filter definitions"
        ]
      }
    },
    "/sync/businesses": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "The ID of the business"
                      },
                      "external_id": {
                        "type": "string",
                        "nullable": true,
                        "description": "The external ID of the business"
                      },
                      "name": {
                        "type": "string",
                        "description": "The name of the business"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The metadata of the business"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "external_id": {
                        "type": "string",
                        "description": "The external ID of the business"
                      },
                      "name": {
                        "type": "string",
                        "description": "The name of the business"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The metadata of the business"
                      }
                    },
                    "required": [
                      "external_id",
                      "name"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The synced `Business` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Business"
                }
              }
            }
          }
        },
        "summary": "Sync a business",
        "tags": [
          "Sync"
        ]
      }
    },
    "/sync/businesses/batch": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "businesses": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The ID of the business"
                            },
                            "external_id": {
                              "type": "string",
                              "nullable": true,
                              "description": "The external ID of the business"
                            },
                            "name": {
                              "type": "string",
                              "description": "The name of the business"
                            },
                            "metadata": {
                              "type": "object",
                              "additionalProperties": true,
                              "description": "The metadata of the business"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "external_id": {
                              "type": "string",
                              "description": "The external ID of the business"
                            },
                            "name": {
                              "type": "string",
                              "description": "The name of the business"
                            },
                            "metadata": {
                              "type": "object",
                              "additionalProperties": true,
                              "description": "The metadata of the business"
                            }
                          },
                          "required": [
                            "external_id",
                            "name"
                          ]
                        }
                      ]
                    },
                    "description": "The businesses to sync"
                  }
                },
                "required": [
                  "businesses"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The synced `Business` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "businesses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Business",
                        "nullable": true
                      },
                      "description": "The businesses that were synced. Will be `null` for businesses that had errors"
                    }
                  },
                  "required": [
                    "businesses"
                  ]
                }
              }
            }
          }
        },
        "summary": "Sync a batch of businesses",
        "tags": [
          "Sync"
        ]
      }
    },
    "/sync/businesses/{business_id}/customers": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "business_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "The ID of the customer"
                      },
                      "external_id": {
                        "type": "string",
                        "nullable": true,
                        "description": "The external ID of the customer"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The phone number of the customer"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "The email address of the customer"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The metadata of the customer"
                      },
                      "full_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "The full name of the customer"
                      }
                    },
                    "required": [
                      "id"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "external_id": {
                        "type": "string",
                        "description": "The external ID of the customer"
                      },
                      "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The phone number of the customer"
                      },
                      "email_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "The email address of the customer"
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "The metadata of the customer"
                      },
                      "full_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "The full name of the customer"
                      }
                    },
                    "required": [
                      "external_id"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The synced `Customer` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          }
        },
        "summary": "Sync a customer",
        "tags": [
          "Sync"
        ]
      }
    },
    "/sync/businesses/{business_id}/customers/batch": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "business_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customers": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The ID of the customer"
                            },
                            "external_id": {
                              "type": "string",
                              "nullable": true,
                              "description": "The external ID of the customer"
                            },
                            "phone_number": {
                              "type": "string",
                              "nullable": true,
                              "description": "The phone number of the customer"
                            },
                            "email_address": {
                              "type": "string",
                              "nullable": true,
                              "description": "The email address of the customer"
                            },
                            "metadata": {
                              "type": "object",
                              "additionalProperties": true,
                              "description": "The metadata of the customer"
                            },
                            "full_name": {
                              "type": "string",
                              "nullable": true,
                              "description": "The full name of the customer"
                            }
                          },
                          "required": [
                            "id"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "external_id": {
                              "type": "string",
                              "description": "The external ID of the customer"
                            },
                            "phone_number": {
                              "type": "string",
                              "nullable": true,
                              "description": "The phone number of the customer"
                            },
                            "email_address": {
                              "type": "string",
                              "nullable": true,
                              "description": "The email address of the customer"
                            },
                            "metadata": {
                              "type": "object",
                              "additionalProperties": true,
                              "description": "The metadata of the customer"
                            },
                            "full_name": {
                              "type": "string",
                              "nullable": true,
                              "description": "The full name of the customer"
                            }
                          },
                          "required": [
                            "external_id"
                          ]
                        }
                      ]
                    },
                    "description": "The customers to sync"
                  }
                },
                "required": [
                  "customers"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The customers that were synced",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "customers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer",
                        "nullable": true
                      },
                      "description": "The customers that were synced. Will be `null` for customers that had errors"
                    },
                    "errors": {
                      "type": "array",
                      "items": {},
                      "description": "The errors that occurred during the sync"
                    }
                  },
                  "required": [
                    "customers",
                    "errors"
                  ]
                }
              }
            }
          }
        },
        "summary": "Sync a batch of customers",
        "tags": [
          "Sync"
        ]
      }
    },
    "/businesses/{id}/reviews": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `reviews` property that contains an array of `Review` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reviews": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Review"
                      },
                      "description": "The reviews for the business"
                    }
                  },
                  "required": [
                    "reviews"
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve the reviews for a business",
        "tags": [
          "Reviews"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer": {
                    "type": "string",
                    "nullable": true,
                    "description": "The ID of the customer who wrote the review"
                  },
                  "stars": {
                    "type": "integer",
                    "description": "The number of stars the review has"
                  },
                  "review_text": {
                    "type": "string",
                    "nullable": true,
                    "description": "The text of the review"
                  },
                  "created_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "The date and time the review was created in ISO 8601 format"
                  }
                },
                "required": [
                  "stars"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Review` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Review"
                }
              }
            }
          }
        },
        "summary": "Create a review for a business",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/reviews/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the review",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `Review` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Review"
                }
              }
            }
          }
        },
        "summary": "Retrieve a review",
        "tags": [
          "Reviews"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the review",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stars": {
                    "type": "integer",
                    "nullable": true,
                    "description": "The number of stars the review has"
                  },
                  "review_text": {
                    "type": "string",
                    "nullable": true,
                    "description": "The text of the review"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Review` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Review"
                }
              }
            }
          }
        },
        "summary": "Update a review",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/reviews/{id}/respond": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the review",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "response_text": {
                    "type": "string",
                    "description": "The response to the review"
                  }
                },
                "required": [
                  "response_text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The `Review` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Review"
                }
              }
            }
          }
        },
        "summary": "Respond to a review",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/businesses/{id}/reviews/embeds": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "review_embed_config": {
                    "type": "string",
                    "description": "The ID of the review embed config"
                  },
                  "customer": {
                    "type": "string",
                    "description": "The ID of the customer"
                  }
                },
                "required": [
                  "review_embed_config"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `ReviewEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewEmbed"
                }
              }
            }
          }
        },
        "summary": "Create a review embed",
        "tags": [
          "Review embeds"
        ]
      }
    },
    "/review_embeds/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the review embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `ReviewEmbed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewEmbed"
                }
              }
            }
          }
        },
        "summary": "Retrieve a review embed",
        "tags": [
          "Review embeds"
        ]
      }
    },
    "/review_embeds/{id}/show": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the review embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The rendered user experience of the review embed",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Render the user experience of a review embed",
        "tags": [
          "Review embeds"
        ]
      }
    },
    "/businesses/{id}/review_embed_configs": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `review_embed_configs` property that contains an array of `ReviewEmbedConfig` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "review_embed_configs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReviewEmbedConfig"
                      },
                      "description": "The review embed configs for the business"
                    }
                  },
                  "required": [
                    "review_embed_configs"
                  ]
                }
              }
            }
          }
        },
        "summary": "Retrieve the review embed configs for a business",
        "tags": [
          "Review embed configs"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "The title of the review embed"
                  },
                  "review_text_prompt": {
                    "type": "string",
                    "description": "The prompt for the review text"
                  },
                  "review_text_placeholder": {
                    "type": "string",
                    "description": "The placeholder for the review text"
                  },
                  "min_stars_to_prompt_review": {
                    "type": "integer",
                    "description": "The minimum number of stars to prompt for a review"
                  },
                  "google_request_review_url": {
                    "type": "string",
                    "nullable": true,
                    "description": "The URL to request a review from Google"
                  },
                  "submit_cta": {
                    "type": "string",
                    "description": "The text for the submit button"
                  },
                  "slug": {
                    "type": "string",
                    "description": "The slug for the review embed. If not provided, one will be auto-generated based on the business name."
                  },
                  "redirect_to_google_request_review_url": {
                    "type": "boolean",
                    "description": "Whether to redirect directly to the Google review link"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created review embed configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewEmbedConfig"
                }
              }
            }
          }
        },
        "summary": "Create a new review embed config for a business",
        "tags": [
          "Review embed configs"
        ]
      }
    },
    "/review_embed_configs/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the review embed config",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The review embed configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewEmbedConfig"
                }
              }
            }
          }
        },
        "summary": "Retrieve a review embed config by ID",
        "tags": [
          "Review embed configs"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the review embed config",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "The updated title of the review embed"
                  },
                  "review_text_prompt": {
                    "type": "string",
                    "description": "The updated prompt for the review text"
                  },
                  "review_text_placeholder": {
                    "type": "string",
                    "description": "The updated placeholder for the review text"
                  },
                  "min_stars_to_prompt_review": {
                    "type": "integer",
                    "description": "The updated minimum number of stars to prompt for a review"
                  },
                  "google_request_review_url": {
                    "type": "string",
                    "nullable": true,
                    "description": "The updated URL to request a review from Google"
                  },
                  "submit_cta": {
                    "type": "string",
                    "description": "The updated text for the submit button"
                  },
                  "slug": {
                    "type": "string",
                    "description": "The updated slug for the review embed"
                  },
                  "redirect_to_google_request_review_url": {
                    "type": "boolean",
                    "description": "Whether to redirect directly to the Google review link"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated review embed configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewEmbedConfig"
                }
              }
            }
          }
        },
        "summary": "Update a review embed config",
        "tags": [
          "Review embed configs"
        ]
      }
    },
    "/rewards_programs": {
      "get": {
        "responses": {
          "200": {
            "description": "A dictionary with a `rewards_programs` property which is an array of `RewardsProgram` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rewards_programs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RewardsProgram"
                      },
                      "description": "An array of rewards programs"
                    }
                  },
                  "required": [
                    "rewards_programs"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all rewards programs",
        "tags": [
          "Rewards programs"
        ]
      }
    },
    "/rewards_programs/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the rewards program",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `RewardsProgram` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RewardsProgram"
                }
              }
            }
          }
        },
        "summary": "Retrieve a rewards program",
        "tags": [
          "Rewards programs"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the rewards program",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "points_earned_per_dollar_spent": {
                    "type": "integer",
                    "description": "The number of points earned per dollar spent"
                  },
                  "point_redemption_value": {
                    "type": "string",
                    "description": "The value of a single point in dollars"
                  },
                  "points_for_member_class_attendance": {
                    "type": "integer",
                    "description": "The number of points earned for attending a class"
                  },
                  "points_for_referring_new_student": {
                    "type": "integer",
                    "description": "The number of points earned for referring a new student"
                  },
                  "points_for_referring_new_student_that_signs_up": {
                    "type": "integer",
                    "description": "The number of points earned for referring a new student that signs up"
                  },
                  "points_for_every_ten_classes_non_member": {
                    "type": "integer",
                    "description": "The number of points earned for every ten classes attended"
                  },
                  "points_for_first_visit_in_three_months": {
                    "type": "integer",
                    "description": "The number of points earned for first visit in three months"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `RewardsProgram` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RewardsProgram"
                }
              }
            }
          }
        },
        "summary": "Update a rewards program",
        "tags": [
          "Rewards programs"
        ]
      }
    },
    "/rewards_programs/{id}/publish": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the rewards program",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The published `RewardsProgram`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RewardsProgram"
                }
              }
            }
          }
        },
        "summary": "Publish a rewards program",
        "tags": [
          "Rewards programs"
        ]
      }
    },
    "/businesses/{id}/rewards_program": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The rewards program for the business",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RewardsProgram"
                }
              }
            }
          }
        },
        "summary": "Show a business's rewards program",
        "tags": [
          "Rewards programs"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "points_earned_per_dollar_spent": {
                    "type": "integer",
                    "description": "The number of points earned per dollar spent"
                  },
                  "point_redemption_value": {
                    "type": "string",
                    "description": "The value of a single point in dollars"
                  },
                  "points_for_member_class_attendance": {
                    "type": "integer",
                    "description": "The number of points earned for attending a class"
                  },
                  "points_for_referring_new_student": {
                    "type": "integer",
                    "description": "The number of points earned for referring a new student"
                  },
                  "points_for_referring_new_student_that_signs_up": {
                    "type": "integer",
                    "description": "The number of points earned for referring a new student that signs up"
                  },
                  "points_for_every_ten_classes_non_member": {
                    "type": "integer",
                    "description": "The number of points earned for every ten classes attended"
                  },
                  "points_for_first_visit_in_three_months": {
                    "type": "integer",
                    "description": "The number of points earned for first visit in three months"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `RewardsProgram` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RewardsProgram"
                }
              }
            }
          }
        },
        "summary": "Create a rewards program",
        "tags": [
          "Rewards programs"
        ]
      }
    },
    "/rewards_programs/{id}/tiers": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the rewards program",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An object with a `tiers` key which contains an array of `Tier` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tiers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tier"
                      },
                      "description": "An array of tiers"
                    }
                  },
                  "required": [
                    "tiers"
                  ]
                }
              }
            }
          }
        },
        "summary": "List all tiers",
        "tags": [
          "Tiers"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the rewards program",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the tier"
                  },
                  "minimum_points": {
                    "type": "integer",
                    "description": "The minimum number of points to qualify for the tier"
                  },
                  "perks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "perk_type": {
                          "type": "string",
                          "enum": [
                            "text"
                          ],
                          "description": "The type of perk. Must be 'text'"
                        },
                        "description": {
                          "type": "string",
                          "description": "The description of the perk"
                        },
                        "title": {
                          "type": "string",
                          "nullable": true,
                          "description": "The title of the perk"
                        }
                      },
                      "required": [
                        "perk_type",
                        "description"
                      ]
                    },
                    "description": "Descriptions of all the perks associated with the tier"
                  }
                },
                "required": [
                  "name",
                  "minimum_points"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Tier` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tier"
                }
              }
            }
          }
        },
        "summary": "Create a tier",
        "tags": [
          "Tiers"
        ]
      }
    },
    "/tiers/{id}": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the tier",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the tier"
                  },
                  "minimum_points": {
                    "type": "integer",
                    "description": "The minimum number of points to qualify for the tier"
                  },
                  "perks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": ""
                        },
                        "perk_type": {
                          "type": "string",
                          "enum": [
                            "text"
                          ],
                          "description": ""
                        },
                        "description": {
                          "type": "string",
                          "description": ""
                        },
                        "title": {
                          "type": "string",
                          "nullable": true,
                          "description": ""
                        }
                      }
                    },
                    "description": "The resulting perks we want to have as part of the tier"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Tier` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tier"
                }
              }
            }
          }
        },
        "summary": "Update a tier",
        "tags": [
          "Tiers"
        ]
      }
    },
    "/rewards_programs/{id}/promotions": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the rewards program",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `promotions` property which is an array of `Promotion` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "promotions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Promotion"
                      },
                      "description": "An array of promotions"
                    }
                  },
                  "required": [
                    "promotions"
                  ]
                }
              }
            }
          }
        },
        "summary": "List promotions for a rewards program",
        "tags": [
          "Promotions"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the rewards program",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the promotion"
                  },
                  "start_time": {
                    "type": "string",
                    "description": "The start time of the promotion"
                  },
                  "end_time": {
                    "type": "string",
                    "description": "The end time of the promotion"
                  },
                  "points_multiplier": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "The points multiplier of the promotion"
                  },
                  "description": {
                    "type": "string",
                    "description": "The description of the promotion"
                  },
                  "image": {
                    "description": "The cover image of the promotion used to display on the rewards program"
                  }
                },
                "required": [
                  "name",
                  "start_time",
                  "end_time",
                  "points_multiplier",
                  "description"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Promotion` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Promotion"
                }
              }
            }
          }
        },
        "summary": "Create a promotion",
        "tags": [
          "Promotions"
        ]
      }
    },
    "/promotions/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the promotion",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The retrieved `Promotion` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Promotion"
                }
              }
            }
          }
        },
        "summary": "Show a promotion",
        "tags": [
          "Promotions"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the promotion",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the promotion"
                  },
                  "start_time": {
                    "type": "string",
                    "description": "The start time of the promotion"
                  },
                  "end_time": {
                    "type": "string",
                    "description": "The end time of the promotion"
                  },
                  "points_multiplier": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "The points multiplier of the promotion"
                  },
                  "description": {
                    "type": "string",
                    "description": "The description of the promotion"
                  },
                  "image": {
                    "description": "The cover image of the promotion used to display on the rewards program"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated `Promotion` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Promotion"
                }
              }
            }
          }
        },
        "summary": "Update a promotion",
        "tags": [
          "Promotions"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the promotion",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `Promotion` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Promotion"
                }
              }
            }
          }
        },
        "summary": "Delete a promotion",
        "tags": [
          "Promotions"
        ]
      }
    },
    "/customers/{id}/rewards_profile": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the customer",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The rewards profile for the customer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RewardsProfile"
                }
              }
            }
          }
        },
        "summary": "Show a customer's rewards profile",
        "tags": [
          "Rewards profiles"
        ]
      }
    },
    "/businesses/{id}/rewards_profiles.csv": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The CSV file of rewards profiles",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Download a CSV of all rewards profiles",
        "tags": [
          "Rewards profiles"
        ]
      }
    },
    "/businesses/{id}/rewards_profiles": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The rewards profiles for all customers of the business",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rewards_profiles": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RewardsProfile"
                      },
                      "description": "The rewards profiles for all customers of the business"
                    }
                  },
                  "required": [
                    "rewards_profiles"
                  ]
                }
              }
            }
          }
        },
        "summary": "Show all rewards profiles",
        "tags": [
          "Rewards profiles"
        ]
      }
    },
    "/businesses/{id}/embeds": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plg": {
                    "type": "boolean",
                    "description": "Whether the embed is a PLG embed. If not provided, the embed will not be a PLG embed."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created `Embed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Embed"
                }
              }
            }
          }
        },
        "summary": "Create an embed",
        "tags": [
          "Embeds"
        ]
      }
    },
    "/embeds/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The `Embed` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Embed"
                }
              }
            }
          }
        },
        "summary": "Fetch information about an embed",
        "tags": [
          "Embeds"
        ]
      }
    },
    "/embeds/{id}/show": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The rendered user experience of the embed",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Render the user experience of the embed",
        "tags": [
          "Embeds"
        ]
      }
    },
    "/embeds/{id}/show/*rest": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the embed",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The rendered user experience of the embed",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "summary": "Render the user experience of the embed",
        "tags": [
          "Embeds"
        ]
      }
    },
    "/businesses/{id}/external_integrations": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `google_reviews` and `yelp_reviews` property indicating whether those integrations have been connected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "google_reviews": {
                      "type": "boolean",
                      "description": "Whether the business has connected to Google Reviews"
                    },
                    "yelp_reviews": {
                      "type": "boolean",
                      "description": "Whether the business has connected to Yelp Reviews"
                    }
                  },
                  "required": [
                    "google_reviews",
                    "yelp_reviews"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get the external integrations for a business",
        "tags": [
          "Businesses"
        ]
      }
    },
    "/google_ads_campaigns/{id}/attribution_results": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "type": "string"
            },
            "description": "Start of the attribution date range (ISO 8601 date, defaults to 30 days ago)",
            "required": false
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "type": "string"
            },
            "description": "End of the attribution date range (ISO 8601 date, defaults to today)",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Attribution results metrics for the campaign",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversions": {
                      "type": "integer",
                      "description": "Count of conversion events"
                    },
                    "revenue": {
                      "type": "number",
                      "description": "Total revenue from conversions"
                    }
                  },
                  "required": [
                    "conversions",
                    "revenue"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get attribution results metrics for a Google Ads campaign",
        "tags": [
          "Google ads campaigns"
        ]
      }
    },
    "/google_ads_campaigns/{id}/conversion_attributions": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "type": "string"
            },
            "description": "Start of the conversions date range (ISO 8601 date, defaults to 30 days ago)",
            "required": false
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "type": "string"
            },
            "description": "End of the conversions date range (ISO 8601 date, defaults to today)",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of conversion attributions for the campaign",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversion_attributions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversionAttribution"
                      },
                      "description": "List of conversion attributions"
                    }
                  },
                  "required": [
                    "conversion_attributions"
                  ]
                }
              }
            }
          }
        },
        "summary": "List conversion attributions for a Google Ads campaign",
        "tags": [
          "Google ads campaigns"
        ]
      }
    },
    "/facebook_ads_campaigns/{id}/attribution_results": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "type": "string"
            },
            "description": "Start of the attribution date range (ISO 8601 date, defaults to 30 days ago)",
            "required": false
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "type": "string"
            },
            "description": "End of the attribution date range (ISO 8601 date, defaults to today)",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Attribution results metrics for the campaign",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversions": {
                      "type": "integer",
                      "description": "Count of conversion events"
                    },
                    "revenue": {
                      "type": "number",
                      "description": "Total revenue from conversions"
                    }
                  },
                  "required": [
                    "conversions",
                    "revenue"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get attribution results metrics for a Facebook Ads campaign",
        "tags": [
          "Facebook ads campaigns"
        ]
      }
    },
    "/facebook_ads_campaigns/{id}/conversion_attributions": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the campaign",
            "required": true
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "type": "string"
            },
            "description": "Start of the conversions date range (ISO 8601 date, defaults to 30 days ago)",
            "required": false
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "type": "string"
            },
            "description": "End of the conversions date range (ISO 8601 date, defaults to today)",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "List of conversion attributions for the campaign",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversion_attributions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversionAttribution"
                      },
                      "description": "List of conversion attributions"
                    }
                  },
                  "required": [
                    "conversion_attributions"
                  ]
                }
              }
            }
          }
        },
        "summary": "List conversion attributions for a Facebook Ads campaign",
        "tags": [
          "Facebook ads campaigns"
        ]
      }
    },
    "/businesses/{business_id}/feature_flags/statuses": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "business_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "query",
            "name": "feature_flag_names",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "The names of the feature flags to check",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A dictionary with a `feature_flags` property which is an array of `FeatureFlag` objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "feature_flags": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FeatureFlag"
                      },
                      "description": "An array of `FeatureFlag` objects"
                    }
                  },
                  "required": [
                    "feature_flags"
                  ]
                }
              }
            }
          }
        },
        "summary": "Get the status of multiple feature flags for a business",
        "tags": [
          "Feature flags"
        ]
      }
    },
    "/businesses/{business_id}/feature_flags/{feature_flag_name}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "business_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "path",
            "name": "feature_flag_name",
            "schema": {
              "type": "string"
            },
            "description": "The name of the feature flag",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A `FeatureFlag` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlag"
                }
              }
            }
          }
        },
        "summary": "Check if a feature flag is enabled for a business",
        "tags": [
          "Feature flags"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "business_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "path",
            "name": "feature_flag_name",
            "schema": {
              "type": "string"
            },
            "description": "The name of the feature flag",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether the feature flag is enabled"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created or updated `FeatureFlagOverride` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlag"
                }
              }
            }
          }
        },
        "summary": "Create or update a feature flag override for a business",
        "tags": [
          "Feature flags"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "business_id",
            "schema": {
              "type": "string"
            },
            "description": "The ID of the business",
            "required": true
          },
          {
            "in": "path",
            "name": "feature_flag_name",
            "schema": {
              "type": "string"
            },
            "description": "The name of the feature flag",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `FeatureFlagOverride` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlag"
                }
              }
            }
          }
        },
        "summary": "Destroy a feature flag override for a business",
        "tags": [
          "Feature flags"
        ]
      }
    },
    "/project_feature_flags/{feature_flag_name}": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "feature_flag_name",
            "schema": {
              "type": "string"
            },
            "description": "The name of the feature flag",
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether the feature flag is enabled"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created or updated `FeatureFlagOverride` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlag"
                }
              }
            }
          }
        },
        "summary": "Create or update a feature flag override for a project",
        "tags": [
          "Feature flags"
        ]
      },
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "feature_flag_name",
            "schema": {
              "type": "string"
            },
            "description": "The name of the feature flag",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "The deleted `FeatureFlagOverride` object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlag"
                }
              }
            }
          }
        },
        "summary": "Destroy a feature flag override for a project",
        "tags": [
          "Feature flags"
        ]
      }
    }
  },
  "security": [
    {
      "HttpBasicAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "HttpBasicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "schemas": {
      "Business": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the business"
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "description": "The external ID of the business"
          },
          "name": {
            "type": "string",
            "description": "The name of the business"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Arbitrary metadata associated with this business"
          },
          "created_at": {
            "type": "string",
            "description": "The date and time the business was created"
          },
          "website": {
            "type": "string",
            "nullable": true,
            "description": "The website URL of the business"
          },
          "disabled_steps": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "email",
                "sms"
              ]
            },
            "nullable": true,
            "description": "Steps disabled for this business. If `null`, the business inherits the project's `disabled_steps`. If set (including `[]`), this list fully overrides the project's setting."
          }
        },
        "required": [
          "id",
          "external_id",
          "name",
          "metadata",
          "created_at",
          "website",
          "disabled_steps"
        ],
        "title": "The Business object"
      },
      "BusinessRegistrationInformation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the business registration information"
          },
          "business_name": {
            "type": "string",
            "nullable": true,
            "description": "The business's legal name"
          },
          "business_type": {
            "type": "string",
            "nullable": true,
            "description": "Business type"
          },
          "business_industry": {
            "type": "string",
            "nullable": true,
            "description": "Business industry"
          },
          "business_registration_identifier": {
            "type": "string",
            "nullable": true,
            "description": "Business registration identifier"
          },
          "business_registration_number": {
            "type": "string",
            "nullable": true,
            "description": "Business registration number"
          },
          "business_identity": {
            "type": "string",
            "nullable": true,
            "description": "Business identity"
          },
          "business_regime_of_operation": {
            "type": "string",
            "nullable": true,
            "description": "Business regime of operation"
          },
          "company_type": {
            "type": "string",
            "nullable": true,
            "description": "Company type"
          },
          "website_url": {
            "type": "string",
            "nullable": true,
            "description": "Website URL"
          },
          "social_media_profiles_urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Social media profile URLs"
          },
          "street_address": {
            "type": "string",
            "nullable": true,
            "description": "Street address"
          },
          "street_address_line_2": {
            "type": "string",
            "nullable": true,
            "description": "Street address line 2"
          },
          "city": {
            "type": "string",
            "nullable": true,
            "description": "City"
          },
          "region": {
            "type": "string",
            "nullable": true,
            "description": "Region/state"
          },
          "postal_code": {
            "type": "string",
            "nullable": true,
            "description": "Postal code"
          },
          "iso_country_code": {
            "type": "string",
            "nullable": true,
            "description": "ISO country code"
          },
          "contact": {
            "type": "object",
            "properties": {
              "first_name": {
                "type": "string",
                "nullable": true,
                "description": "Contact person's first name"
              },
              "last_name": {
                "type": "string",
                "nullable": true,
                "description": "Contact person's last name"
              },
              "title": {
                "type": "string",
                "nullable": true,
                "description": "Contact person's title"
              },
              "job_position": {
                "type": "string",
                "nullable": true,
                "description": "Contact person's job position"
              },
              "phone_number": {
                "type": "string",
                "nullable": true,
                "description": "Contact person's phone number"
              },
              "email_address": {
                "type": "string",
                "nullable": true,
                "description": "Contact person's email address"
              }
            },
            "required": [
              "first_name",
              "last_name",
              "title",
              "job_position",
              "phone_number",
              "email_address"
            ],
            "nullable": true,
            "description": "Contact person information"
          },
          "supplemental_links": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Supplemental links"
          },
          "privacy_policy_link": {
            "type": "string",
            "nullable": true,
            "description": "Privacy policy URL"
          },
          "preferred_phone_number_prefixes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Preferred phone number prefixes"
          }
        },
        "required": [
          "id",
          "business_name",
          "business_type",
          "business_industry",
          "business_registration_identifier",
          "business_registration_number",
          "business_identity",
          "business_regime_of_operation",
          "company_type",
          "website_url",
          "social_media_profiles_urls",
          "street_address",
          "street_address_line_2",
          "city",
          "region",
          "postal_code",
          "iso_country_code",
          "contact",
          "supplemental_links",
          "privacy_policy_link",
          "preferred_phone_number_prefixes"
        ],
        "title": "The Business Registration Information object"
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the campaign"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the campaign was created in ISO 8601 format"
          },
          "updated_at": {
            "type": "string",
            "description": "The time when the campaign was last updated in ISO 8601 format"
          },
          "business": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the business"
          },
          "name": {
            "type": "string",
            "description": "The name of the campaign"
          },
          "enrolled_customers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The customers enrolled in the campaign"
          },
          "enrolled_customer_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The IDs of the customers enrolled in the campaign"
          },
          "segment": {
            "type": "string",
            "nullable": true,
            "description": "The segment attached to the campaign"
          },
          "steps": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "email"
                      ],
                      "description": "The step type. Always \"email\" for this step"
                    },
                    "custom_step_id": {
                      "type": "string",
                      "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                    },
                    "email_template_id": {
                      "type": "string",
                      "description": "The ID of the email template to use in this step"
                    }
                  },
                  "required": [
                    "type",
                    "email_template_id"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "email"
                      ],
                      "description": "The step type. Always \"email\" for this step"
                    },
                    "custom_step_id": {
                      "type": "string",
                      "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                    },
                    "subject": {
                      "type": "string",
                      "description": "The subject of the email template to use at this step"
                    },
                    "body": {
                      "type": "string",
                      "description": "The body of the email template to use at this step"
                    }
                  },
                  "required": [
                    "type",
                    "subject",
                    "body"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ],
                      "description": "The step type. Always \"sms\" for this step"
                    },
                    "custom_step_id": {
                      "type": "string",
                      "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                    },
                    "sms_template_id": {
                      "type": "string",
                      "description": "The ID of the SMS template to use in this step"
                    }
                  },
                  "required": [
                    "type",
                    "sms_template_id"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ],
                      "description": "The step type. Always \"sms\" for this step"
                    },
                    "custom_step_id": {
                      "type": "string",
                      "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                    },
                    "message": {
                      "type": "string",
                      "description": "The message to send in this step"
                    }
                  },
                  "required": [
                    "type",
                    "message"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "wait"
                      ],
                      "description": "The step type. Always \"wait\" for this step"
                    },
                    "duration": {
                      "type": "integer",
                      "description": "The number of seconds to wait"
                    }
                  },
                  "required": [
                    "type",
                    "duration"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "if"
                      ],
                      "description": "The step type. Always \"if\" for this step"
                    },
                    "filter": {
                      "type": "string",
                      "description": "The filter to use in this step"
                    }
                  },
                  "required": [
                    "type",
                    "filter"
                  ]
                }
              ]
            },
            "description": "The steps of the campaign"
          },
          "email_address": {
            "type": "string",
            "nullable": true,
            "description": "The email address used to send emails in the campaign. Will be the ID of an email-like object"
          },
          "phone_number": {
            "type": "string",
            "nullable": true,
            "description": "The phone number used to send SMS messages in the campaign. Will be the ID of a phone number-like object"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "started",
              "stopped",
              "finished"
            ],
            "description": "The status of the campaign."
          },
          "scheduled_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the campaign is scheduled to start in ISO 8601 format"
          },
          "scheduled_end_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the campaign is scheduled to end in ISO 8601 format"
          },
          "statistics": {
            "type": "object",
            "properties": {
              "total_customers_enrolled": {
                "type": "integer",
                "description": "The number of customers enrolled in the campaign or trigger"
              },
              "total_customers_started": {
                "type": "integer",
                "description": "The number of customers who have started receiving messages"
              },
              "total_customers_finished": {
                "type": "integer",
                "description": "The number of customers who have finished receiving all the messages"
              },
              "emails": {
                "type": "object",
                "properties": {
                  "sent": {
                    "type": "integer",
                    "description": "The number of emails sent"
                  },
                  "delivered": {
                    "type": "integer",
                    "description": "The number of emails delivered"
                  },
                  "opened": {
                    "type": "integer",
                    "description": "The number of emails opened"
                  },
                  "soft_bounced": {
                    "type": "integer",
                    "description": "The number of emails that soft bounced"
                  },
                  "hard_bounced": {
                    "type": "integer",
                    "description": "The number of emails that hard bounced"
                  },
                  "spam_reported": {
                    "type": "integer",
                    "description": "The number of emails reported as spam"
                  },
                  "clicked": {
                    "type": "integer",
                    "nullable": true,
                    "description": "The number of emails clicked (null if tracking not enabled)"
                  }
                },
                "required": [
                  "sent",
                  "delivered",
                  "opened",
                  "soft_bounced",
                  "hard_bounced",
                  "spam_reported",
                  "clicked"
                ],
                "description": "Email statistics including sent, delivered, opened, bounced, and clicked counts"
              },
              "custom_steps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "custom_step": {
                      "type": "string",
                      "description": "The ID of the custom step"
                    },
                    "sent": {
                      "type": "integer",
                      "description": "The number of times this custom step was sent"
                    }
                  },
                  "required": [
                    "custom_step",
                    "sent"
                  ]
                },
                "description": "Statistics for custom steps"
              },
              "executions": {
                "type": "object",
                "properties": {
                  "total": {
                    "type": "integer",
                    "description": "Total number of executions"
                  },
                  "pending": {
                    "type": "integer",
                    "description": "Number of pending executions"
                  },
                  "started": {
                    "type": "integer",
                    "description": "Number of started executions"
                  },
                  "finished": {
                    "type": "integer",
                    "description": "Number of finished executions"
                  },
                  "errored": {
                    "type": "integer",
                    "description": "Number of errored executions"
                  }
                },
                "required": [
                  "total",
                  "pending",
                  "started",
                  "finished",
                  "errored"
                ],
                "description": "Execution statistics"
              },
              "sms": {
                "type": "object",
                "properties": {
                  "sms_sent_count": {
                    "type": "integer",
                    "description": "The number of SMS messages sent"
                  },
                  "sms_sent_segments_count": {
                    "type": "integer",
                    "description": "The number of SMS messages segments"
                  },
                  "mms_sent_count": {
                    "type": "integer",
                    "description": "The number of MMS messages sent"
                  },
                  "mms_sent_segments_count": {
                    "type": "integer",
                    "description": "The number of MMS messages segments"
                  }
                },
                "required": [
                  "sms_sent_count",
                  "sms_sent_segments_count",
                  "mms_sent_count",
                  "mms_sent_segments_count"
                ],
                "description": "SMS statistics"
              }
            },
            "required": [
              "emails",
              "custom_steps",
              "executions",
              "sms"
            ],
            "description": "The statistics of the campaign. Includes information about customers enrolled, email statistics, and custom step statistics"
          },
          "consumed_message_segments": {
            "type": "object",
            "properties": {
              "sms": {
                "type": "integer",
                "description": "The number of SMS segments"
              },
              "mms": {
                "type": "integer",
                "description": "The number of MMS segments"
              },
              "email": {
                "type": "integer",
                "description": "The number of email segments"
              }
            },
            "required": [
              "sms",
              "mms",
              "email"
            ],
            "description": "The number of message segments actually used by the campaign"
          },
          "estimated_message_segments": {
            "type": "object",
            "properties": {
              "sms": {
                "type": "integer",
                "description": "The number of SMS segments"
              },
              "mms": {
                "type": "integer",
                "description": "The number of MMS segments"
              },
              "email": {
                "type": "integer",
                "description": "The number of email segments"
              }
            },
            "required": [
              "sms",
              "mms",
              "email"
            ],
            "description": "The number of message segments estimated to be used by the campaign"
          },
          "attributed_revenue": {
            "type": "string",
            "nullable": true,
            "description": "The revenue attributed to the campaign"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Arbitrary metadata associated with this campaign"
          }
        },
        "required": [
          "id",
          "created_at",
          "updated_at",
          "business",
          "name",
          "segment",
          "steps",
          "email_address",
          "phone_number",
          "status",
          "scheduled_at",
          "scheduled_end_at",
          "statistics",
          "consumed_message_segments",
          "attributed_revenue",
          "metadata"
        ],
        "title": "The Campaign object"
      },
      "CampaignCustomerMetadata": {
        "type": "object",
        "properties": {
          "customer": {
            "type": "string",
            "description": "The ID of the customer"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Arbitrary metadata associated with this campaign-customer pair"
          },
          "created_at": {
            "type": "string",
            "description": "The creation timestamp"
          },
          "updated_at": {
            "type": "string",
            "description": "The last update timestamp"
          }
        },
        "required": [
          "customer",
          "metadata",
          "created_at",
          "updated_at"
        ],
        "title": "The Campaign Customer Metadata object"
      },
      "CampaignTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the campaign template"
          },
          "title": {
            "type": "string",
            "description": "The title of the campaign template"
          },
          "description": {
            "type": "string",
            "description": "The description of the campaign template"
          },
          "campaign": {
            "$ref": "#/components/schemas/Campaign",
            "description": "The campaign that will get created when the campaign template is used as a base"
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the campaign template is enabled"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "campaign",
          "enabled"
        ],
        "title": "The Campaign Template object"
      },
      "ConversionAttribution": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the conversion attribution"
          },
          "amount": {
            "type": "number",
            "description": "The conversion amount"
          },
          "currency": {
            "type": "string",
            "description": "The currency of the conversion amount"
          },
          "created_at": {
            "type": "string",
            "description": "When the conversion was recorded (ISO8601)"
          },
          "last_touch_source": {
            "type": "string",
            "enum": [
              "google",
              "facebook",
              "campaign",
              "trigger",
              "email_blast"
            ],
            "nullable": true,
            "description": "The source of the last marketing touch before the conversion"
          },
          "customer": {
            "type": "string",
            "nullable": true,
            "description": "The customer ID (expandable to the full customer object)"
          },
          "last_touch_google_ads_campaign": {
            "type": "string",
            "nullable": true,
            "description": "The last-touch Google Ads campaign ID (expandable to the campaign object)"
          },
          "last_touch_facebook_ads_campaign": {
            "type": "string",
            "nullable": true,
            "description": "The last-touch Facebook Ads campaign ID (expandable to the campaign object)"
          }
        },
        "required": [
          "id",
          "amount",
          "currency",
          "created_at",
          "last_touch_source",
          "customer",
          "last_touch_google_ads_campaign",
          "last_touch_facebook_ads_campaign"
        ],
        "title": "The Conversion Attribution object"
      },
      "CustomDomain": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the custom domain"
          },
          "business": {
            "type": "string",
            "description": "The ID of the business"
          },
          "domain": {
            "type": "string",
            "description": "The domain name"
          },
          "dns_records": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "nullable": true,
                  "description": "The DNS record host"
                },
                "type": {
                  "type": "string",
                  "nullable": true,
                  "description": "The DNS record type"
                },
                "value": {
                  "type": "string",
                  "nullable": true,
                  "description": "The DNS record value"
                }
              },
              "required": [
                "name",
                "type",
                "value"
              ]
            },
            "nullable": true,
            "description": "The DNS records for the domain"
          },
          "created_at": {
            "type": "string",
            "description": "The date and time the custom domain was created"
          },
          "validated": {
            "type": "boolean",
            "description": "Whether the domain is valid"
          },
          "setup_completed_at": {
            "type": "string",
            "nullable": true,
            "description": "The date and time setup was completed"
          },
          "setup_type": {
            "type": "string",
            "nullable": true,
            "description": "The type of setup (automatic or manual)"
          }
        },
        "required": [
          "id",
          "business",
          "domain",
          "dns_records",
          "created_at",
          "validated",
          "setup_completed_at",
          "setup_type"
        ],
        "title": "The Custom Domain object"
      },
      "Customer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the customer"
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "description": "The external ID of the customer"
          },
          "email_address": {
            "type": "string",
            "nullable": true,
            "description": "The email address of the customer"
          },
          "phone_number": {
            "type": "string",
            "nullable": true,
            "description": "The phone number of the customer"
          },
          "full_name": {
            "type": "string",
            "nullable": true,
            "description": "The full name of the customer"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "The metadata associated with this customer"
          },
          "unsubscribed": {
            "type": "string",
            "enum": [
              "future",
              "campaign"
            ],
            "nullable": true,
            "description": "The unsubscribe status of the customer"
          }
        },
        "required": [
          "id",
          "external_id",
          "email_address",
          "phone_number",
          "full_name",
          "metadata",
          "unsubscribed"
        ],
        "title": "The Customer object"
      },
      "DraftSMSMessage": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "The phone number the SMS message would be sent from"
          },
          "to": {
            "type": "string",
            "description": "The phone number the SMS message would be sent to"
          },
          "message": {
            "type": "string",
            "description": "The message that would be sent"
          }
        },
        "required": [
          "from",
          "to",
          "message"
        ],
        "title": "The Draft SMS Message object"
      },
      "EmailAddress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the email address"
          },
          "email_address": {
            "type": "string",
            "description": "The email address"
          },
          "display_name": {
            "type": "string",
            "description": "The display name of the email address"
          },
          "reply_to": {
            "type": "string",
            "nullable": true,
            "description": "The reply-to address"
          },
          "business": {
            "type": "string",
            "nullable": true,
            "description": "The business associated with this email address"
          },
          "one_off": {
            "type": "boolean",
            "description": "Whether the email address is one-off"
          },
          "custom_domain": {
            "type": "string",
            "nullable": true,
            "description": "The custom domain associated with this email address"
          }
        },
        "required": [
          "id",
          "email_address",
          "display_name",
          "reply_to",
          "business",
          "one_off",
          "custom_domain"
        ],
        "title": "The Email Address object"
      },
      "EmailBlast": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the email blast"
          },
          "name": {
            "type": "string",
            "description": "The name of the email blast"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the email blast was created in ISO 8601 format"
          },
          "email_template": {
            "type": "string",
            "nullable": true,
            "description": "The email template associated with the email blast"
          },
          "status": {
            "type": "string",
            "description": "The status of the email blast. One of \"draft\", \"scheduled\", \"started\", or \"stopped\""
          },
          "scheduled_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the email blast is scheduled to start in ISO 8601 format"
          },
          "segment": {
            "type": "string",
            "nullable": true,
            "description": "The segment attached to the email blast"
          },
          "email_address": {
            "type": "string",
            "nullable": true,
            "description": "The email address used to send the email blast. Will be the ID of an email-address-like object"
          },
          "statistics": {
            "type": "object",
            "properties": {
              "emails": {
                "type": "object",
                "properties": {
                  "sent": {
                    "type": "integer",
                    "description": "The number of emails sent"
                  },
                  "delivered": {
                    "type": "integer",
                    "description": "The number of emails delivered"
                  },
                  "opened": {
                    "type": "integer",
                    "description": "The number of emails opened"
                  },
                  "soft_bounced": {
                    "type": "integer",
                    "description": "The number of emails that soft bounced"
                  },
                  "hard_bounced": {
                    "type": "integer",
                    "description": "The number of emails that hard bounced"
                  },
                  "spam_reported": {
                    "type": "integer",
                    "description": "The number of emails reported as spam"
                  },
                  "clicked": {
                    "type": "integer",
                    "nullable": true,
                    "description": "The number of emails clicked (null if tracking not enabled)"
                  }
                },
                "required": [
                  "sent",
                  "delivered",
                  "opened",
                  "soft_bounced",
                  "hard_bounced",
                  "spam_reported",
                  "clicked"
                ],
                "description": "Email statistics including sent, delivered, opened, bounced, and clicked counts"
              },
              "executions": {
                "type": "object",
                "properties": {
                  "total": {
                    "type": "integer",
                    "description": "Total number of executions"
                  },
                  "pending": {
                    "type": "integer",
                    "description": "Number of pending executions"
                  },
                  "started": {
                    "type": "integer",
                    "description": "Number of started executions"
                  },
                  "finished": {
                    "type": "integer",
                    "description": "Number of finished executions"
                  },
                  "errored": {
                    "type": "integer",
                    "description": "Number of errored executions"
                  }
                },
                "required": [
                  "total",
                  "pending",
                  "started",
                  "finished",
                  "errored"
                ],
                "description": "Execution statistics"
              }
            },
            "required": [
              "emails",
              "executions"
            ],
            "description": "The statistics of the email blast including email delivery metrics"
          },
          "enrolled_customers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The customers enrolled in the email blast"
          },
          "excluded_customers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The customers excluded from the email blast"
          },
          "attributed_revenue": {
            "type": "string",
            "nullable": true,
            "description": "The revenue attributed to the email blast"
          }
        },
        "required": [
          "id",
          "name",
          "created_at",
          "email_template",
          "status",
          "scheduled_at",
          "segment",
          "email_address",
          "statistics",
          "attributed_revenue"
        ],
        "title": "The Email Blast object"
      },
      "EmailBlastExecution": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the email blast execution"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/Customer"
              }
            ],
            "description": "The customer executing through the email blast"
          },
          "to": {
            "type": "string",
            "description": "The email address the email blast was actually sent to"
          },
          "sent_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the email blast was sent in ISO 8601 format"
          },
          "finished_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution finished in ISO 8601 format"
          },
          "finished_reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason the execution finished"
          }
        },
        "required": [
          "id",
          "customer",
          "to",
          "sent_at",
          "finished_at",
          "finished_reason"
        ],
        "title": "The Email Blast Execution object"
      },
      "EmailTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the email template"
          },
          "name": {
            "type": "string",
            "description": "The name of the email template"
          },
          "subject": {
            "type": "string",
            "description": "The subject of the email template. Variables are supported via `{{ variableName }}`"
          },
          "body": {
            "type": "string",
            "nullable": true,
            "description": "(Deprecated) The body of the email template. Always `null` since there are no plaintext emails"
          },
          "kind": {
            "type": "string",
            "enum": [
              "html",
              "unlayer",
              "old_editor",
              "editor"
            ],
            "description": "The kind of the email template"
          },
          "template_html": {
            "type": "string",
            "nullable": true,
            "description": "The HTML representation of the rich text email. May be null"
          },
          "template_json": {
            "nullable": true,
            "description": "The JSON representing the rich text email template. May be null"
          },
          "new_template_json": {
            "nullable": true,
            "description": "The new unlayer JSON template. May be null"
          },
          "new_template_html": {
            "type": "string",
            "nullable": true,
            "description": "The new unlayer HTML template. May be null"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The ID of the attachment"
                },
                "name": {
                  "type": "string",
                  "description": "The name of the attachment"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "description": "An array of attachments associated with the email template"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Arbitrary metadata associated with this email template"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the email template was created in ISO 8601 format"
          },
          "enabled_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the email template was enabled in ISO 8601 format"
          }
        },
        "required": [
          "id",
          "name",
          "subject",
          "body",
          "kind",
          "template_html",
          "template_json",
          "new_template_json",
          "new_template_html",
          "attachments",
          "metadata",
          "created_at"
        ],
        "title": "The Email Template object"
      },
      "EmailTemplateEmbed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the email template embed"
          },
          "expires_at": {
            "type": "string",
            "description": "When the email template embed expires and needs to be regenerated"
          },
          "email_template": {
            "type": "string",
            "nullable": true,
            "description": "The email template associated with this embed"
          },
          "business": {
            "type": "string",
            "description": "The business associated with this embed"
          },
          "url": {
            "type": "string",
            "description": "The URL to embed the email template editor"
          }
        },
        "required": [
          "id",
          "expires_at",
          "email_template",
          "business",
          "url"
        ],
        "title": "The Email Template Embed object"
      },
      "Embed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the embed"
          },
          "business": {
            "type": "string",
            "description": "The ID of the business"
          },
          "expires_at": {
            "type": "string",
            "description": "The time when the embed will expire in ISO 8601 format"
          },
          "url": {
            "type": "string",
            "description": "The URL of the embed"
          },
          "plg": {
            "type": "boolean",
            "description": "Whether this is a PLG embed"
          },
          "admin": {
            "type": "boolean",
            "description": "Whether this is an admin embed"
          }
        },
        "required": [
          "id",
          "business",
          "expires_at",
          "url",
          "plg",
          "admin"
        ],
        "title": "The Embed object"
      },
      "Execution": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the execution"
          },
          "customer": {
            "type": "string",
            "description": "The customer executing through the campaign"
          },
          "scheduled_at": {
            "type": "string",
            "nullable": true,
            "description": "The scheduled time for the next step to execute"
          },
          "step_count": {
            "type": "integer",
            "description": "The index of the next step to execute"
          },
          "current_step_id": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the current step"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "in_progress",
              "retrying",
              "finished",
              "failed",
              "stopped"
            ],
            "description": "The status of the execution"
          },
          "failed_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution failed in ISO 8601 format"
          },
          "failed_reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason the execution failed"
          },
          "finished_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution finished in ISO 8601 format"
          },
          "finished_reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason the execution finished"
          },
          "stopped_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution was stopped in ISO 8601 format"
          },
          "started_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution started processing in ISO 8601 format"
          },
          "created_at": {
            "type": "string",
            "description": "The time the execution was created — i.e. when the customer was enrolled in the campaign — in ISO 8601 format"
          }
        },
        "required": [
          "id",
          "customer",
          "scheduled_at",
          "step_count",
          "current_step_id",
          "status",
          "failed_at",
          "failed_reason",
          "finished_at",
          "finished_reason",
          "stopped_at",
          "started_at",
          "created_at"
        ],
        "title": "The Execution object"
      },
      "ExecutionStepLog": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the execution step log"
          },
          "step": {
            "type": "string",
            "description": "The ID of the campaign step"
          },
          "outcome": {
            "type": "string",
            "description": "The outcome of the step execution"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason for the outcome"
          },
          "sent_email": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the sent email, if applicable"
          },
          "sent_sms_message": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the sent SMS message, if applicable"
          },
          "sent_custom_step": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the sent custom step, if applicable"
          },
          "created_at": {
            "type": "string",
            "description": "The time the step was logged in ISO 8601 format"
          }
        },
        "required": [
          "id",
          "step",
          "outcome",
          "reason",
          "sent_email",
          "sent_sms_message",
          "sent_custom_step",
          "created_at"
        ],
        "title": "The Execution Step Log object"
      },
      "FeatureFlag": {
        "type": "object",
        "properties": {
          "feature_flag_name": {
            "type": "string",
            "description": "The name of the feature flag"
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the feature flag is enabled"
          }
        },
        "required": [
          "feature_flag_name",
          "enabled"
        ],
        "title": "The Feature Flag object"
      },
      "FilterDefinition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the filter definition"
          },
          "label": {
            "type": "string",
            "description": "The label of the filter definition"
          },
          "variable_name": {
            "type": "string",
            "description": "The variable name of the filter definition"
          },
          "type": {
            "type": "string",
            "enum": [
              "select",
              "text",
              "number",
              "boolean",
              "datetime",
              "currency",
              "array_of_known"
            ],
            "description": "The type of the filter definition"
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the filter definition is enabled"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FilterDefinitionOption"
            },
            "description": "The options for the select dropdown"
          }
        },
        "required": [
          "id",
          "label",
          "variable_name",
          "type",
          "enabled"
        ],
        "title": "The Filter Definition object"
      },
      "FilterDefinitionOption": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "The label of the option"
          },
          "value": {
            "type": "string",
            "description": "The value of the option"
          }
        },
        "required": [
          "label",
          "value"
        ],
        "title": "The Filter Definition Option object"
      },
      "PhoneNumber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the phone number"
          },
          "phone_number": {
            "type": "string",
            "description": "The phone number"
          }
        },
        "required": [
          "id",
          "phone_number"
        ],
        "title": "The Phone Number object"
      },
      "Project": {
        "type": "object",
        "properties": {
          "mms_sms_template_embed": {
            "type": "boolean",
            "description": "Whether MMS SMS template embeds are enabled (always true)"
          },
          "account_slug": {
            "type": "string",
            "description": "The slug of the account"
          },
          "disabled_internal_events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The disabled internal events"
          }
        },
        "required": [
          "mms_sms_template_embed",
          "account_slug",
          "disabled_internal_events"
        ],
        "title": "The Project object"
      },
      "ProjectDefinedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the project defined event"
          },
          "event": {
            "type": "string",
            "description": "The event name. Likely takes the form `customer.created` or similar"
          },
          "display_text": {
            "type": "string",
            "description": "The human-readable text for this event. Should grammatically follow \"When...\" e.g. \"a customer is created\""
          },
          "purchase_amount_path": {
            "type": "string",
            "nullable": true,
            "description": "Path for extracting purchase amount from event data"
          }
        },
        "required": [
          "id",
          "event",
          "display_text",
          "purchase_amount_path"
        ],
        "title": "The ProjectDefinedEvent object"
      },
      "ProjectEmailTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the email template"
          },
          "name": {
            "type": "string",
            "description": "The name of the email template"
          },
          "subject": {
            "type": "string",
            "description": "The subject of the email template"
          },
          "body": {
            "type": "string",
            "nullable": true,
            "description": "The body of the email template. If present, `template_html` and `template_json` must be `null`"
          },
          "kind": {
            "type": "string",
            "enum": [
              "plaintext",
              "html",
              "unlayer",
              "old_editor",
              "editor"
            ],
            "description": "The kind of the email template"
          },
          "template_html": {
            "type": "string",
            "nullable": true,
            "description": "The HTML of the email template. If present, `body` and `template_json` must be `null`"
          },
          "template_json": {
            "nullable": true,
            "description": "The JSON of the email template. If present, `body` and `template_html` must be `null`"
          },
          "new_template_json": {
            "nullable": true,
            "description": "The new unlayer JSON template. May be null"
          },
          "new_template_html": {
            "type": "string",
            "nullable": true,
            "description": "The new unlayer HTML template. May be null"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The ID of the attachment"
                },
                "name": {
                  "type": "string",
                  "description": "The name of the attachment"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "description": "An array of attachments associated with the email template"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Arbitrary metadata associated with this email template"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the email template was created in ISO 8601 format"
          },
          "enabled_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the email template was enabled in ISO 8601 format"
          }
        },
        "required": [
          "id",
          "name",
          "subject",
          "body",
          "kind",
          "template_html",
          "template_json",
          "new_template_json",
          "new_template_html",
          "attachments",
          "metadata",
          "created_at",
          "enabled_at"
        ],
        "title": "The Project Email Template object"
      },
      "ProjectPhoneNumber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the phone number"
          },
          "phone_number": {
            "type": "string",
            "description": "The phone number"
          }
        },
        "required": [
          "id",
          "phone_number"
        ],
        "title": "The Project Phone Number object"
      },
      "Promotion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the promotion"
          },
          "name": {
            "type": "string",
            "description": "Name of the promotion"
          },
          "start_time": {
            "type": "string",
            "description": "Start time of the promotion"
          },
          "end_time": {
            "type": "string",
            "description": "End time of the promotion"
          },
          "points_multiplier": {
            "type": "integer",
            "description": "Multiplier applied to earned points"
          },
          "description": {
            "type": "string",
            "description": "Description of the promotion"
          },
          "image_url": {
            "type": "string",
            "nullable": true,
            "description": "URL of the promotion image"
          }
        },
        "required": [
          "id",
          "name",
          "start_time",
          "end_time",
          "points_multiplier",
          "description",
          "image_url"
        ],
        "title": "The Promotion object"
      },
      "Review": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the review"
          },
          "created_at": {
            "type": "string",
            "description": "The date and time the review was created"
          },
          "updated_at": {
            "type": "string",
            "description": "The date and time the review was last updated"
          },
          "source": {
            "type": "string",
            "enum": [
              "internal",
              "google",
              "yelp"
            ],
            "description": "The source of the review"
          },
          "stars": {
            "type": "integer",
            "description": "The number of stars the review has"
          },
          "review_text": {
            "type": "string",
            "nullable": true,
            "description": "The text of the review"
          },
          "customer": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the customer who wrote the review"
          },
          "business": {
            "type": "string",
            "description": "The ID of the business that the review is about"
          },
          "external_url": {
            "type": "string",
            "nullable": true,
            "description": "The URL of the review on the external site"
          }
        },
        "required": [
          "id",
          "created_at",
          "updated_at",
          "source",
          "stars",
          "review_text",
          "customer",
          "business",
          "external_url"
        ],
        "title": "The Review object"
      },
      "ReviewEmbed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the review embed"
          },
          "url": {
            "type": "string",
            "description": "The URL to embed the review request"
          },
          "business": {
            "type": "string",
            "description": "The ID of the business"
          },
          "customer": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the customer"
          },
          "review": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the review"
          },
          "review_embed_config": {
            "$ref": "#/components/schemas/ReviewEmbedConfig",
            "description": "The review embed config"
          }
        },
        "required": [
          "id",
          "url",
          "business",
          "customer",
          "review",
          "review_embed_config"
        ],
        "title": "The Review Embed object"
      },
      "ReviewEmbedConfig": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the review embed config"
          },
          "title": {
            "type": "string",
            "description": "The title of the review embed"
          },
          "review_text_prompt": {
            "type": "string",
            "description": "The prompt for the review text"
          },
          "review_text_placeholder": {
            "type": "string",
            "description": "The placeholder for the review text"
          },
          "min_stars_to_prompt_review": {
            "type": "integer",
            "description": "The minimum number of stars to prompt for a review"
          },
          "google_request_review_url": {
            "type": "string",
            "nullable": true,
            "description": "The URL to request a review from Google"
          },
          "submit_cta": {
            "type": "string",
            "description": "The text for the submit button"
          },
          "slug": {
            "type": "string",
            "description": "The unique identifier that appears in the public review URL"
          },
          "redirect_to_google_request_review_url": {
            "type": "boolean",
            "description": "Whether to redirect directly to the Google review link"
          },
          "permanent_review_page_url": {
            "type": "string",
            "description": "The permanent review page URL"
          }
        },
        "required": [
          "id",
          "title",
          "review_text_prompt",
          "review_text_placeholder",
          "min_stars_to_prompt_review",
          "google_request_review_url",
          "submit_cta",
          "slug",
          "redirect_to_google_request_review_url",
          "permanent_review_page_url"
        ],
        "title": "The Review Embed Config object"
      },
      "RewardsProfile": {
        "type": "object",
        "properties": {
          "points": {
            "type": "integer",
            "description": "The number of points the customer has"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/Customer"
              }
            ],
            "description": "The customer associated with the rewards profile"
          },
          "tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/Tier"
              }
            ],
            "nullable": true,
            "description": "The tier of the customer"
          }
        },
        "required": [
          "points",
          "customer",
          "tier"
        ],
        "title": "The Rewards Profile object"
      },
      "RewardsProgram": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the rewards program"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "The name of the rewards program"
          },
          "points_earned_per_dollar_spent": {
            "type": "integer",
            "description": "The number of points earned per dollar spent"
          },
          "point_redemption_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ],
            "description": "The value of a single point in dollars"
          },
          "points_for_member_class_attendance": {
            "type": "integer",
            "description": "The number of points earned for attending a class"
          },
          "points_for_referring_new_student": {
            "type": "integer",
            "description": "The number of points earned for referring a new student"
          },
          "points_for_referring_new_student_that_signs_up": {
            "type": "integer",
            "description": "The number of points earned for referring a new student that signs up"
          },
          "points_for_every_ten_classes_non_member": {
            "type": "integer",
            "description": "The number of points earned for every ten classes attended"
          },
          "points_for_first_visit_in_three_months": {
            "type": "integer",
            "description": "The number of points earned for first visit in three months"
          },
          "program_image_url": {
            "type": "string",
            "nullable": true,
            "description": "The URL of the program image"
          },
          "earning_cycle": {
            "type": "string",
            "nullable": true,
            "description": "The earning cycle of the program"
          },
          "published": {
            "type": "boolean",
            "description": "Whether the program is published"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "backfilling",
              "published"
            ],
            "description": "The status of the program"
          }
        },
        "required": [
          "id",
          "name",
          "points_earned_per_dollar_spent",
          "point_redemption_value",
          "points_for_member_class_attendance",
          "points_for_referring_new_student",
          "points_for_referring_new_student_that_signs_up",
          "points_for_every_ten_classes_non_member",
          "points_for_first_visit_in_three_months",
          "program_image_url",
          "earning_cycle",
          "published",
          "status"
        ],
        "title": "The Rewards Program object"
      },
      "SMSTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the SMS template"
          },
          "name": {
            "type": "string",
            "description": "The name of the SMS template"
          },
          "message": {
            "type": "string",
            "description": "The message of the SMS template. Variables are supported via `{{ variableName }}`"
          },
          "estimated_sms_segments": {
            "type": "integer",
            "description": "The estimated number of SMS segments"
          },
          "estimated_segments": {
            "type": "object",
            "properties": {
              "sms": {
                "type": "integer",
                "description": "The number of SMS segments"
              },
              "mms": {
                "type": "integer",
                "description": "The number of MMS segments"
              }
            },
            "required": [
              "sms",
              "mms"
            ],
            "description": "The estimated number of segments of each type. Has keys `sms` and `mms`"
          },
          "image": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the image upload"
          },
          "shorten_urls": {
            "type": "boolean",
            "description": "Whether to shorten URLs in the message"
          }
        },
        "required": [
          "id",
          "name",
          "message",
          "estimated_sms_segments",
          "estimated_segments",
          "image",
          "shorten_urls"
        ],
        "title": "The SMS Template object"
      },
      "SMSTemplateEmbed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the SMS template embed"
          },
          "sms_template": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the SMS template"
          },
          "business": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the business"
          },
          "url": {
            "type": "string",
            "description": "The URL to embed the SMS template editor"
          },
          "expires_at": {
            "type": "string",
            "description": "When the SMS template embed expires and needs to be regenerated"
          }
        },
        "required": [
          "id",
          "sms_template",
          "business",
          "url",
          "expires_at"
        ],
        "title": "The SMS Template Embed object"
      },
      "Segment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the segment"
          },
          "name": {
            "type": "string",
            "description": "The name of the segment"
          },
          "filter": {
            "type": "string",
            "nullable": true,
            "description": "The filter for this segment"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "A Markdown description of the filter"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Metadata attached to this segment"
          },
          "static_customers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The customers that are always included in this segment"
          }
        },
        "required": [
          "id",
          "name",
          "filter",
          "description"
        ],
        "title": "The Segment object"
      },
      "SentEmail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the campaign"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the campaign was created in ISO 8601 format"
          },
          "customer": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the customer that was sent the email"
          },
          "subject": {
            "type": "string",
            "description": "The subject of the email"
          },
          "sent_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the email was sent in ISO 8601 format"
          },
          "failed_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the email failed to send in ISO 8601 format"
          },
          "failed_reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason the email failed to send"
          },
          "to_email_address": {
            "type": "string",
            "nullable": true,
            "description": "The email address the email was sent to"
          },
          "sendgrid_message_id": {
            "type": "string",
            "nullable": true,
            "description": "Sendgrid's returned message ID"
          },
          "paubox_message_id": {
            "type": "string",
            "nullable": true,
            "description": "Paubox's returned message ID"
          },
          "postmark_message_id": {
            "type": "string",
            "nullable": true,
            "description": "Postmark's returned message ID"
          }
        },
        "required": [
          "id",
          "created_at",
          "customer",
          "subject",
          "sent_at",
          "failed_at",
          "failed_reason",
          "to_email_address"
        ],
        "title": "The Sent Email object"
      },
      "SentSMSMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the sent SMS message"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the SMS was created in ISO 8601 format"
          },
          "customer": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the customer that was sent the SMS message"
          },
          "business": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the business that sent the text message"
          },
          "to_phone_number": {
            "type": "string",
            "description": "The phone number the SMS was sent to"
          },
          "message": {
            "type": "string",
            "description": "The content of the SMS message"
          },
          "mms": {
            "type": "boolean",
            "description": "Whether the text message went over MMS, e.g. included an image"
          },
          "num_segments": {
            "type": "number",
            "description": "The number of text segments used"
          },
          "sent_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the SMS was sent in ISO 8601 format"
          },
          "twilio_message_sid": {
            "type": "string",
            "description": "Twilio's returned message SID"
          },
          "telgorithm_message_sid": {
            "type": "string",
            "description": "Telgorithm's returned message SID"
          },
          "campaign": {
            "type": "string",
            "description": "The ID of the campaign that sent the SMS message. Only present if the SMS message was sent as part of a campaign"
          },
          "trigger": {
            "type": "string",
            "description": "The ID of the trigger that sent the SMS message. Only present if the SMS message was sent as part of a trigger"
          }
        },
        "required": [
          "id",
          "created_at",
          "customer",
          "business",
          "to_phone_number",
          "message",
          "mms",
          "num_segments",
          "sent_at"
        ],
        "title": "The Sent SMS Message object"
      },
      "Tier": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the tier"
          },
          "name": {
            "type": "string",
            "description": "The tier's name"
          },
          "minimum_points": {
            "type": "integer",
            "description": "The minimum number of points to reach this tier"
          },
          "associated_color": {
            "type": "string",
            "nullable": true,
            "description": "The color associated with this tier"
          },
          "perks": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The ID of the perk"
                    },
                    "perk_type": {
                      "type": "string",
                      "description": "The type of the perk"
                    },
                    "description": {
                      "type": "string",
                      "nullable": true,
                      "description": "The description of the perk"
                    },
                    "title": {
                      "type": "string",
                      "nullable": true,
                      "description": "The title of the perk"
                    },
                    "mariana_tek_icon": {
                      "type": "string",
                      "nullable": true,
                      "description": "The MarianaTek icon for the perk"
                    }
                  },
                  "required": [
                    "id",
                    "perk_type",
                    "description",
                    "title",
                    "mariana_tek_icon"
                  ]
                },
                {
                  "type": "string"
                }
              ]
            },
            "description": "The perks associated with reaching this tier"
          }
        },
        "required": [
          "id",
          "name",
          "minimum_points",
          "associated_color",
          "perks"
        ],
        "title": "The Tier object"
      },
      "Trigger": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the trigger"
          },
          "created_at": {
            "type": "string",
            "description": "The time when the trigger was created in ISO 8601 format"
          },
          "updated_at": {
            "type": "string",
            "description": "The time when the trigger was last updated in ISO 8601 format"
          },
          "name": {
            "type": "string",
            "description": "The name of the trigger"
          },
          "project_defined_event": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the project-defined event that triggers the trigger"
          },
          "internal_event_definition": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "customer_created",
                  "customer_joined_segment",
                  "customer_birthday"
                ],
                "description": "The type of internal event definition. Must be 'customer_created', 'customer_joined_segment', or 'customer_birthday'"
              },
              "segment": {
                "type": "string",
                "nullable": true,
                "description": "The ID of the segment that the customer joined. Can only be provided with 'customer_joined_segment'"
              }
            },
            "required": [
              "type"
            ],
            "nullable": true,
            "description": "The internal event definition that triggers the trigger"
          },
          "trigger": {
            "type": "string",
            "nullable": true,
            "description": "Deprecated. Will always be null"
          },
          "steps": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "email"
                      ],
                      "description": "The step type. Always \"email\" for this step"
                    },
                    "custom_step_id": {
                      "type": "string",
                      "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                    },
                    "email_template_id": {
                      "type": "string",
                      "description": "The ID of the email template to use in this step"
                    }
                  },
                  "required": [
                    "type",
                    "email_template_id"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "email"
                      ],
                      "description": "The step type. Always \"email\" for this step"
                    },
                    "custom_step_id": {
                      "type": "string",
                      "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"email\" as well"
                    },
                    "subject": {
                      "type": "string",
                      "description": "The subject of the email template to use at this step"
                    },
                    "body": {
                      "type": "string",
                      "description": "The body of the email template to use at this step"
                    }
                  },
                  "required": [
                    "type",
                    "subject",
                    "body"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ],
                      "description": "The step type. Always \"sms\" for this step"
                    },
                    "custom_step_id": {
                      "type": "string",
                      "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                    },
                    "sms_template_id": {
                      "type": "string",
                      "description": "The ID of the SMS template to use in this step"
                    }
                  },
                  "required": [
                    "type",
                    "sms_template_id"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ],
                      "description": "The step type. Always \"sms\" for this step"
                    },
                    "custom_step_id": {
                      "type": "string",
                      "description": "Optional. The ID of the custom step to use in this step. The type of the custom step must be \"sms\" as well"
                    },
                    "message": {
                      "type": "string",
                      "description": "The message to send in this step"
                    }
                  },
                  "required": [
                    "type",
                    "message"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "wait"
                      ],
                      "description": "The step type. Always \"wait\" for this step"
                    },
                    "duration": {
                      "type": "integer",
                      "description": "The number of seconds to wait"
                    }
                  },
                  "required": [
                    "type",
                    "duration"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "if"
                      ],
                      "description": "The step type. Always \"if\" for this step"
                    },
                    "filter": {
                      "type": "string",
                      "description": "The filter to use in this step"
                    }
                  },
                  "required": [
                    "type",
                    "filter"
                  ]
                }
              ]
            },
            "description": "The steps of the trigger"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "inactive"
            ],
            "description": "The status of the trigger. One of \"draft\", \"active\", or \"inactive\""
          },
          "filter": {
            "type": "string",
            "nullable": true,
            "description": "An additional filter that determines if the trigger should be run"
          },
          "email_address": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the email address or project email address associated with the trigger. Will be used to send emails as part of this trigger"
          },
          "phone_number": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the phone number or project phone number associated with the trigger. Will be used to send SMS messages as part of this trigger"
          },
          "attributed_revenue": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "nullable": true,
            "description": "The revenue attributed to the trigger"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Arbitrary metadata associated with this trigger"
          },
          "statistics": {
            "type": "object",
            "properties": {
              "total_customers_enrolled": {
                "type": "integer",
                "description": "The number of customers enrolled in the campaign or trigger"
              },
              "total_customers_started": {
                "type": "integer",
                "description": "The number of customers who have started receiving messages"
              },
              "total_customers_finished": {
                "type": "integer",
                "description": "The number of customers who have finished receiving all the messages"
              },
              "emails": {
                "type": "object",
                "properties": {
                  "sent": {
                    "type": "integer",
                    "description": "The number of emails sent"
                  },
                  "delivered": {
                    "type": "integer",
                    "description": "The number of emails delivered"
                  },
                  "opened": {
                    "type": "integer",
                    "description": "The number of emails opened"
                  },
                  "soft_bounced": {
                    "type": "integer",
                    "description": "The number of emails that soft bounced"
                  },
                  "hard_bounced": {
                    "type": "integer",
                    "description": "The number of emails that hard bounced"
                  },
                  "spam_reported": {
                    "type": "integer",
                    "description": "The number of emails reported as spam"
                  },
                  "clicked": {
                    "type": "integer",
                    "nullable": true,
                    "description": "The number of emails clicked (null if tracking not enabled)"
                  }
                },
                "required": [
                  "sent",
                  "delivered",
                  "opened",
                  "soft_bounced",
                  "hard_bounced",
                  "spam_reported",
                  "clicked"
                ],
                "description": "Email statistics including sent, delivered, opened, bounced, and clicked counts"
              },
              "custom_steps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "custom_step": {
                      "type": "string",
                      "description": "The ID of the custom step"
                    },
                    "sent": {
                      "type": "integer",
                      "description": "The number of times this custom step was sent"
                    }
                  },
                  "required": [
                    "custom_step",
                    "sent"
                  ]
                },
                "description": "Statistics for custom steps"
              },
              "executions": {
                "type": "object",
                "properties": {
                  "total": {
                    "type": "integer",
                    "description": "Total number of executions"
                  },
                  "pending": {
                    "type": "integer",
                    "description": "Number of pending executions"
                  },
                  "started": {
                    "type": "integer",
                    "description": "Number of started executions"
                  },
                  "finished": {
                    "type": "integer",
                    "description": "Number of finished executions"
                  },
                  "errored": {
                    "type": "integer",
                    "description": "Number of errored executions"
                  }
                },
                "required": [
                  "total",
                  "pending",
                  "started",
                  "finished",
                  "errored"
                ],
                "description": "Execution statistics"
              },
              "sms": {
                "type": "object",
                "properties": {
                  "sms_sent_count": {
                    "type": "integer",
                    "description": "The number of SMS messages sent"
                  },
                  "sms_sent_segments_count": {
                    "type": "integer",
                    "description": "The number of SMS messages segments"
                  },
                  "mms_sent_count": {
                    "type": "integer",
                    "description": "The number of MMS messages sent"
                  },
                  "mms_sent_segments_count": {
                    "type": "integer",
                    "description": "The number of MMS messages segments"
                  }
                },
                "required": [
                  "sms_sent_count",
                  "sms_sent_segments_count",
                  "mms_sent_count",
                  "mms_sent_segments_count"
                ],
                "description": "SMS statistics"
              }
            },
            "required": [
              "emails",
              "custom_steps",
              "executions",
              "sms"
            ],
            "description": "The statistics of the trigger. Includes information about customers enrolled, email statistics, and custom step statistics"
          }
        },
        "required": [
          "id",
          "created_at",
          "updated_at",
          "name",
          "project_defined_event",
          "internal_event_definition",
          "steps",
          "status",
          "filter",
          "email_address",
          "phone_number",
          "attributed_revenue",
          "metadata",
          "statistics"
        ],
        "title": "The Trigger object"
      },
      "TriggerExecution": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the trigger execution"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/Customer"
              }
            ],
            "description": "The customer executing through the trigger"
          },
          "scheduled_at": {
            "type": "string",
            "nullable": true,
            "description": "The scheduled time for the next step of the trigger execution"
          },
          "step_count": {
            "type": "integer",
            "description": "The index of the next step of the trigger to execute"
          },
          "current_step_id": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the current step"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "in_progress",
              "retrying",
              "finished",
              "failed",
              "stopped"
            ],
            "description": "The status of the execution"
          },
          "failed_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution failed"
          },
          "failed_reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason for failure"
          },
          "finished_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution finished"
          },
          "finished_reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason for finishing"
          },
          "stopped_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution was stopped"
          },
          "started_at": {
            "type": "string",
            "nullable": true,
            "description": "The time when the execution started processing in ISO 8601 format"
          },
          "created_at": {
            "type": "string",
            "description": "The time the execution was created — i.e. when the customer was enrolled in the trigger — in ISO 8601 format"
          }
        },
        "required": [
          "id",
          "customer",
          "scheduled_at",
          "step_count",
          "current_step_id",
          "status",
          "failed_at",
          "failed_reason",
          "finished_at",
          "finished_reason",
          "stopped_at",
          "started_at",
          "created_at"
        ],
        "title": "The Trigger Execution object"
      },
      "TriggerTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the trigger template"
          },
          "title": {
            "type": "string",
            "description": "The title of the trigger template"
          },
          "description": {
            "type": "string",
            "description": "The description of the trigger template"
          },
          "trigger": {
            "$ref": "#/components/schemas/Trigger",
            "description": "The trigger that will get created when the trigger template is used as a base"
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the trigger template is enabled"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "trigger",
          "enabled"
        ],
        "title": "The Trigger Template object"
      },
      "UnsubscribeEmbed": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the unsubscribe embed"
          },
          "url": {
            "type": "string",
            "description": "The URL to embed the unsubscribe form"
          },
          "customer": {
            "type": "string",
            "description": "The ID of the customer that's unsubscribing"
          }
        },
        "required": [
          "id",
          "url",
          "customer"
        ],
        "title": "The Unsubscribe Embed object"
      }
    }
  }
}