openapi: 3.0.3
info:
  title: Meshes API
  description: >-
    Meshes API for event ingestion, connections, rules, and workspace
    management.
  version: 1.0.0
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Machine / server-side authentication using a Bearer token (JWT).
    publishableKey:
      type: apiKey
      in: header
      name: X-Meshes-Publishable-Key
      description: >-
        Publishable workspace key for client-side event ingestion. Safe to
        expose in frontend code. Used only for emitting /events endpoints and
        does not grant access to management APIs.
  schemas: {}
paths:
  /api/v1/connections:
    get:
      operationId: getConnections
      summary: Get Connections
      tags:
        - Connections
      description: Get all connections for the organization
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  limit:
                    type: integer
                    exclusiveMinimum: true
                    minimum: 0
                  next_cursor:
                    type: string
                    nullable: true
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        workspace:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - activecampaign
                            - aweber
                            - hubspot
                            - intercom
                            - mailchimp
                            - mailerlite
                            - resend
                            - salesforce
                            - slack
                            - webhook
                            - zoom
                        name:
                          type: string
                        metadata:
                          type: object
                          additionalProperties: {}
                        action_data:
                          type: object
                          additionalProperties: {}
                        hidden:
                          type: boolean
                          default: false
                        created_by:
                          type: string
                        created_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        updated_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                      required:
                        - id
                        - workspace
                        - type
                        - name
                        - metadata
                        - created_by
                        - created_at
                        - updated_at
                      additionalProperties: false
                required:
                  - count
                  - limit
                  - records
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    post:
      operationId: createConnection
      summary: Create Connection
      tags:
        - Connections
      description: Create a New Connection
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  type: string
                  format: uuid
                type:
                  type: string
                  enum:
                    - activecampaign
                    - aweber
                    - hubspot
                    - intercom
                    - mailchimp
                    - mailerlite
                    - resend
                    - salesforce
                    - slack
                    - webhook
                    - zoom
                name:
                  type: string
                  minLength: 1
                  maxLength: 128
                  pattern: ^[a-zA-Z0-9 _-]+$
                metadata:
                  type: object
                  additionalProperties: {}
                  description: arbitrary connector metadata
                hidden:
                  type: boolean
                  default: false
              required:
                - workspace
                - type
                - name
                - metadata
              additionalProperties: false
        required: true
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  connection:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      workspace:
                        type: string
                        format: uuid
                      type:
                        type: string
                        enum:
                          - activecampaign
                          - aweber
                          - hubspot
                          - intercom
                          - mailchimp
                          - mailerlite
                          - resend
                          - salesforce
                          - slack
                          - webhook
                          - zoom
                      name:
                        type: string
                      metadata:
                        type: object
                        additionalProperties: {}
                      action_data:
                        type: object
                        additionalProperties: {}
                      hidden:
                        type: boolean
                        default: false
                      created_by:
                        type: string
                      created_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                      updated_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                    required:
                      - id
                      - workspace
                      - type
                      - name
                      - metadata
                      - created_by
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - connection
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/connections/{connection_id}:
    get:
      operationId: getConnection
      summary: Get Connection
      tags:
        - Connections
      description: Get Connection by ID
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: connection_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  workspace:
                    type: string
                    format: uuid
                  type:
                    type: string
                    enum:
                      - activecampaign
                      - aweber
                      - hubspot
                      - intercom
                      - mailchimp
                      - mailerlite
                      - resend
                      - salesforce
                      - slack
                      - webhook
                      - zoom
                  name:
                    type: string
                  metadata:
                    type: object
                    additionalProperties: {}
                  action_data:
                    type: object
                    additionalProperties: {}
                  hidden:
                    type: boolean
                    default: false
                  created_by:
                    type: string
                  created_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  updated_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                required:
                  - id
                  - workspace
                  - type
                  - name
                  - metadata
                  - created_by
                  - created_at
                  - updated_at
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    put:
      operationId: updateConnection
      summary: Update Connection
      tags:
        - Connections
      description: Update Connection by ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 128
                  pattern: ^[a-zA-Z0-9 _-]+$
                metadata:
                  type: object
                  additionalProperties: {}
                  description: arbitrary connector metadata
                hidden:
                  type: boolean
              required:
                - name
                - metadata
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: connection_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  workspace:
                    type: string
                    format: uuid
                  type:
                    type: string
                    enum:
                      - activecampaign
                      - aweber
                      - hubspot
                      - intercom
                      - mailchimp
                      - mailerlite
                      - resend
                      - salesforce
                      - slack
                      - webhook
                      - zoom
                  name:
                    type: string
                  metadata:
                    type: object
                    additionalProperties: {}
                  action_data:
                    type: object
                    additionalProperties: {}
                  hidden:
                    type: boolean
                    default: false
                  created_by:
                    type: string
                  created_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  updated_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                required:
                  - id
                  - workspace
                  - type
                  - name
                  - metadata
                  - created_by
                  - created_at
                  - updated_at
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    delete:
      operationId: deleteConnection
      summary: Delete Connection
      tags:
        - Connections
      description: Delete Connection by ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                force_delete:
                  type: boolean
              additionalProperties: false
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: connection_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                    enum:
                      - activecampaign
                      - aweber
                      - hubspot
                      - intercom
                      - mailchimp
                      - mailerlite
                      - resend
                      - salesforce
                      - slack
                      - webhook
                      - zoom
                required:
                  - id
                  - type
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/connections/{connection_id}/actions:
    get:
      operationId: getConnectionActions
      summary: Get Connection Actions
      tags:
        - Connections
      description: Get Connection Actions by ID
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: connection_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema: {}
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/connections/{connection_id}/fields:
    get:
      operationId: getConnectionFields
      summary: Get Connection Fields
      tags:
        - Connections
      description: Get Connection Fields by Connection ID
      parameters:
        - schema:
            anyOf:
              - type: string
                enum:
                  - 'true'
                  - 'false'
              - type: boolean
          in: query
          name: refresh
          required: false
        - schema:
            type: string
            format: uuid
          in: path
          name: connection_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  workspace_id:
                    type: string
                    format: uuid
                  connection_id:
                    type: string
                    format: uuid
                  integration_type:
                    type: string
                    enum:
                      - activecampaign
                      - aweber
                      - hubspot
                      - intercom
                      - mailchimp
                      - mailerlite
                      - resend
                      - salesforce
                      - slack
                      - webhook
                      - zoom
                  catalog_version:
                    type: string
                    minLength: 1
                    maxLength: 512
                    description: Catalog version (e.g. hash of normalized schema)
                  refreshed_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  created_by:
                    type: string
                    minLength: 1
                  created_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  updated_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          minLength: 1
                        label:
                          type: string
                          minLength: 1
                        type:
                          type: string
                          enum:
                            - string
                            - number
                            - boolean
                            - date
                            - datetime
                            - enum
                            - multi_enum
                            - json
                            - object
                            - array
                            - unknown
                        description:
                          type: string
                          minLength: 1
                        constraints:
                          type: object
                          properties:
                            format:
                              type: string
                              enum:
                                - email
                                - phone
                                - url
                                - uuid
                                - date
                                - datetime
                                - unknown
                            required:
                              type: boolean
                            read_only:
                              type: boolean
                            max_length:
                              type: integer
                              minimum: 0
                            min_length:
                              type: integer
                              minimum: 0
                            pattern:
                              type: string
                              minLength: 1
                            min:
                              type: number
                            max:
                              type: number
                            allowed_values:
                              type: array
                              items:
                                type: string
                                minLength: 1
                          additionalProperties: false
                        provider_meta:
                          type: object
                          additionalProperties: {}
                      required:
                        - key
                        - type
                      additionalProperties: false
                required:
                  - id
                  - workspace_id
                  - connection_id
                  - integration_type
                  - catalog_version
                  - refreshed_at
                  - created_by
                  - created_at
                  - updated_at
                  - fields
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/connections/{connection_id}/mappings/default:
    get:
      operationId: getConnectionDefaultMappings
      summary: Get Connection Default Mappings
      tags:
        - Connections
      description: Get Connection Default Mappings by Connection ID
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: connection_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - stored
                      - generated
                  mapping:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      mapping_id:
                        type: string
                        format: uuid
                      version:
                        type: integer
                        exclusiveMinimum: true
                        minimum: 0
                      workspace_id:
                        type: string
                        format: uuid
                      connection_id:
                        type: string
                        format: uuid
                      integration_type:
                        type: string
                        enum:
                          - activecampaign
                          - aweber
                          - hubspot
                          - intercom
                          - mailchimp
                          - mailerlite
                          - resend
                          - salesforce
                          - slack
                          - webhook
                          - zoom
                      name:
                        type: string
                        minLength: 1
                        maxLength: 64
                      schema:
                        type: object
                        properties:
                          schema_version:
                            type: number
                            enum:
                              - 1
                          fields:
                            type: array
                            items:
                              type: object
                              properties:
                                dest:
                                  type: string
                                  minLength: 1
                                  maxLength: 128
                                source:
                                  anyOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - literal
                                        value:
                                          anyOf:
                                            - type: string
                                              minLength: 1
                                              maxLength: 256
                                            - type: number
                                            - type: boolean
                                            - enum:
                                                - 'null'
                                              nullable: true
                                      required:
                                        - type
                                        - value
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - path
                                        value:
                                          type: string
                                          minLength: 1
                                          maxLength: 128
                                          pattern: >-
                                            ^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)*$
                                          description: >-
                                            Restricted payload-relative selector
                                            (e.g. "email", "user.email")
                                      required:
                                        - type
                                        - value
                                      additionalProperties: false
                                transforms:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_string
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_number
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_boolean
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_date
                                          timezone:
                                            type: string
                                            minLength: 1
                                            maxLength: 64
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_datetime
                                          timezone:
                                            type: string
                                            minLength: 1
                                            maxLength: 64
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - default
                                          value:
                                            anyOf:
                                              - type: string
                                                minLength: 1
                                                maxLength: 128
                                              - type: number
                                              - type: boolean
                                              - enum:
                                                  - 'null'
                                                nullable: true
                                        required:
                                          - type
                                          - value
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - trim
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - lower
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - upper
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - substring
                                          start:
                                            type: integer
                                            minimum: 0
                                          length:
                                            type: integer
                                            exclusiveMinimum: true
                                            minimum: 0
                                        required:
                                          - type
                                          - start
                                        additionalProperties: false
                                  maxItems: 10
                                on_error:
                                  type: string
                                  enum:
                                    - skip_field
                                    - warn_action
                                    - fail_action
                                notes:
                                  type: string
                                  minLength: 1
                                  maxLength: 1024
                              required:
                                - dest
                                - source
                              additionalProperties: false
                            maxItems: 250
                          meta:
                            type: object
                            properties:
                              name:
                                type: string
                                minLength: 1
                                maxLength: 64
                              notes:
                                type: string
                                minLength: 1
                                maxLength: 1024
                            additionalProperties: false
                        required:
                          - schema_version
                          - fields
                        additionalProperties: false
                      catalog_version:
                        type: string
                        minLength: 1
                        maxLength: 512
                        description: Catalog version (e.g. hash of normalized schema)
                      created_by:
                        type: string
                        minLength: 1
                      created_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                      updated_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                    required:
                      - id
                      - mapping_id
                      - version
                      - workspace_id
                      - connection_id
                      - integration_type
                      - name
                      - schema
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - status
                  - mapping
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    put:
      operationId: updateConnectionDefaultMappings
      summary: Update Connection Default Mappings
      tags:
        - Connections
      description: Update Connection Default Mappings by Connection ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  format: uuid
                mapping_id:
                  type: string
                  format: uuid
                expected_version:
                  type: integer
                  exclusiveMinimum: true
                  minimum: 0
                name:
                  type: string
                  minLength: 1
                  maxLength: 64
                schema:
                  type: object
                  properties:
                    schema_version:
                      type: number
                      enum:
                        - 1
                    fields:
                      type: array
                      items:
                        type: object
                        properties:
                          dest:
                            type: string
                            minLength: 1
                            maxLength: 128
                          source:
                            anyOf:
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - literal
                                  value:
                                    anyOf:
                                      - type: string
                                        minLength: 1
                                        maxLength: 256
                                      - type: number
                                      - type: boolean
                                      - enum:
                                          - 'null'
                                        nullable: true
                                required:
                                  - type
                                  - value
                                additionalProperties: false
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - path
                                  value:
                                    type: string
                                    minLength: 1
                                    maxLength: 128
                                    pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)*$
                                    description: >-
                                      Restricted payload-relative selector (e.g.
                                      "email", "user.email")
                                required:
                                  - type
                                  - value
                                additionalProperties: false
                          transforms:
                            type: array
                            items:
                              anyOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - to_string
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - to_number
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - to_boolean
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - to_date
                                    timezone:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - to_datetime
                                    timezone:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - default
                                    value:
                                      anyOf:
                                        - type: string
                                          minLength: 1
                                          maxLength: 128
                                        - type: number
                                        - type: boolean
                                        - enum:
                                            - 'null'
                                          nullable: true
                                  required:
                                    - type
                                    - value
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - trim
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - lower
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - upper
                                  required:
                                    - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - substring
                                    start:
                                      type: integer
                                      minimum: 0
                                    length:
                                      type: integer
                                      exclusiveMinimum: true
                                      minimum: 0
                                  required:
                                    - type
                                    - start
                                  additionalProperties: false
                            maxItems: 10
                          on_error:
                            type: string
                            enum:
                              - skip_field
                              - warn_action
                              - fail_action
                          notes:
                            type: string
                            minLength: 1
                            maxLength: 1024
                        required:
                          - dest
                          - source
                        additionalProperties: false
                      maxItems: 250
                    meta:
                      type: object
                      properties:
                        name:
                          type: string
                          minLength: 1
                          maxLength: 64
                        notes:
                          type: string
                          minLength: 1
                          maxLength: 1024
                      additionalProperties: false
                  required:
                    - schema_version
                    - fields
                  additionalProperties: false
              required:
                - schema
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: connection_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - stored
                      - generated
                  mapping:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      mapping_id:
                        type: string
                        format: uuid
                      version:
                        type: integer
                        exclusiveMinimum: true
                        minimum: 0
                      workspace_id:
                        type: string
                        format: uuid
                      connection_id:
                        type: string
                        format: uuid
                      integration_type:
                        type: string
                        enum:
                          - activecampaign
                          - aweber
                          - hubspot
                          - intercom
                          - mailchimp
                          - mailerlite
                          - resend
                          - salesforce
                          - slack
                          - webhook
                          - zoom
                      name:
                        type: string
                        minLength: 1
                        maxLength: 64
                      schema:
                        type: object
                        properties:
                          schema_version:
                            type: number
                            enum:
                              - 1
                          fields:
                            type: array
                            items:
                              type: object
                              properties:
                                dest:
                                  type: string
                                  minLength: 1
                                  maxLength: 128
                                source:
                                  anyOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - literal
                                        value:
                                          anyOf:
                                            - type: string
                                              minLength: 1
                                              maxLength: 256
                                            - type: number
                                            - type: boolean
                                            - enum:
                                                - 'null'
                                              nullable: true
                                      required:
                                        - type
                                        - value
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - path
                                        value:
                                          type: string
                                          minLength: 1
                                          maxLength: 128
                                          pattern: >-
                                            ^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)*$
                                          description: >-
                                            Restricted payload-relative selector
                                            (e.g. "email", "user.email")
                                      required:
                                        - type
                                        - value
                                      additionalProperties: false
                                transforms:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_string
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_number
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_boolean
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_date
                                          timezone:
                                            type: string
                                            minLength: 1
                                            maxLength: 64
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - to_datetime
                                          timezone:
                                            type: string
                                            minLength: 1
                                            maxLength: 64
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - default
                                          value:
                                            anyOf:
                                              - type: string
                                                minLength: 1
                                                maxLength: 128
                                              - type: number
                                              - type: boolean
                                              - enum:
                                                  - 'null'
                                                nullable: true
                                        required:
                                          - type
                                          - value
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - trim
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - lower
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - upper
                                        required:
                                          - type
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - substring
                                          start:
                                            type: integer
                                            minimum: 0
                                          length:
                                            type: integer
                                            exclusiveMinimum: true
                                            minimum: 0
                                        required:
                                          - type
                                          - start
                                        additionalProperties: false
                                  maxItems: 10
                                on_error:
                                  type: string
                                  enum:
                                    - skip_field
                                    - warn_action
                                    - fail_action
                                notes:
                                  type: string
                                  minLength: 1
                                  maxLength: 1024
                              required:
                                - dest
                                - source
                              additionalProperties: false
                            maxItems: 250
                          meta:
                            type: object
                            properties:
                              name:
                                type: string
                                minLength: 1
                                maxLength: 64
                              notes:
                                type: string
                                minLength: 1
                                maxLength: 1024
                            additionalProperties: false
                        required:
                          - schema_version
                          - fields
                        additionalProperties: false
                      catalog_version:
                        type: string
                        minLength: 1
                        maxLength: 512
                        description: Catalog version (e.g. hash of normalized schema)
                      created_by:
                        type: string
                        minLength: 1
                      created_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                      updated_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                    required:
                      - id
                      - mapping_id
                      - version
                      - workspace_id
                      - connection_id
                      - integration_type
                      - name
                      - schema
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - status
                  - mapping
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/events:
    get:
      operationId: getEvents
      summary: Get Events
      tags:
        - Events
      description: Get all events for the organization
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          in: query
          name: limit
          required: false
        - schema:
            type: string
            pattern: ^[A-Za-z0-9_-]+$
            nullable: true
          in: query
          name: cursor
          required: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  limit:
                    type: integer
                    exclusiveMinimum: true
                    minimum: 0
                  next_cursor:
                    type: string
                    nullable: true
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - event
                          default: event
                        workspace:
                          type: string
                          format: uuid
                        event:
                          type: string
                        resource:
                          type: string
                          minLength: 1
                        resource_id:
                          type: string
                          minLength: 1
                        status:
                          type: string
                          enum:
                            - pending
                            - processing
                            - completed
                            - failed
                        total_rules:
                          type: integer
                          minimum: 0
                          default: 0
                        completed_count:
                          type: integer
                          minimum: 0
                          default: 0
                        failed_count:
                          type: integer
                          minimum: 0
                          default: 0
                        started_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        completed_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        created_by:
                          type: string
                        created_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        rule_events:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                              type:
                                type: string
                                enum:
                                  - rule
                              workspace:
                                type: string
                                format: uuid
                              event:
                                type: string
                              event_id:
                                type: string
                                format: uuid
                              resource:
                                type: string
                                minLength: 1
                              resource_id:
                                type: string
                                minLength: 1
                              connection:
                                type: string
                                format: uuid
                              rule:
                                type: string
                                format: uuid
                              integration_type:
                                type: string
                                enum:
                                  - activecampaign
                                  - aweber
                                  - hubspot
                                  - intercom
                                  - mailchimp
                                  - mailerlite
                                  - resend
                                  - salesforce
                                  - slack
                                  - webhook
                                  - zoom
                              status:
                                type: string
                                enum:
                                  - pending
                                  - processing
                                  - completed
                                  - failed
                              attempt_count:
                                type: integer
                                minimum: 0
                              started_at:
                                anyOf:
                                  - type: string
                                    format: date-time
                                  - type: string
                                    format: date-time
                              completed_at:
                                anyOf:
                                  - type: string
                                    format: date-time
                                  - type: string
                                    format: date-time
                              last_error:
                                type: string
                              created_by:
                                type: string
                              created_at:
                                anyOf:
                                  - type: string
                                    format: date-time
                                  - type: string
                                    format: date-time
                            required:
                              - id
                              - type
                              - workspace
                              - event
                              - event_id
                              - connection
                              - rule
                              - integration_type
                              - status
                              - attempt_count
                              - created_by
                              - created_at
                            additionalProperties: false
                      required:
                        - id
                        - workspace
                        - event
                        - status
                        - created_by
                        - created_at
                      additionalProperties: false
                required:
                  - count
                  - limit
                  - records
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    post:
      operationId: createEvent
      summary: Create Event
      tags:
        - Events
      description: Create (emit) a single event
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                event:
                  type: string
                  minLength: 1
                payload:
                  type: object
                  properties:
                    email:
                      type: string
                      minLength: 1
                      format: email
                    id:
                      type: string
                    ip_address:
                      type: string
                    name:
                      type: string
                    first_name:
                      type: string
                    last_name:
                      type: string
                    phone:
                      type: string
                    resource_url:
                      type: string
                  additionalProperties: {}
                resource:
                  type: string
                  minLength: 1
                resource_id:
                  type: string
                  minLength: 1
                type:
                  type: string
                  enum:
                    - event
                  default: event
                workspace:
                  type: string
                  format: uuid
              required:
                - event
                - payload
              additionalProperties: false
        required: true
      security:
        - bearerAuth: []
        - publishableKey: []
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  event:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      event:
                        type: string
                        minLength: 1
                      resource:
                        type: string
                        minLength: 1
                      resource_id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - event
                        default: event
                      workspace:
                        type: string
                        format: uuid
                      created_by:
                        type: string
                      created_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                    required:
                      - id
                      - event
                      - workspace
                      - created_by
                      - created_at
                    additionalProperties: false
                required:
                  - event
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/events/bulk:
    post:
      operationId: createBulkEvent
      summary: Create Bulk Events
      tags:
        - Events
      description: Create (emit) multiple events up to 100 at a time
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  event:
                    type: string
                    minLength: 1
                  payload:
                    type: object
                    properties:
                      email:
                        type: string
                        minLength: 1
                        format: email
                      id:
                        type: string
                      ip_address:
                        type: string
                      name:
                        type: string
                      first_name:
                        type: string
                      last_name:
                        type: string
                      phone:
                        type: string
                      resource_url:
                        type: string
                    additionalProperties: {}
                  resource:
                    type: string
                    minLength: 1
                  resource_id:
                    type: string
                    minLength: 1
                  type:
                    type: string
                    enum:
                      - event
                    default: event
                  workspace:
                    type: string
                    format: uuid
                required:
                  - event
                  - payload
                additionalProperties: false
              minItems: 1
              maxItems: 100
      security:
        - bearerAuth: []
        - publishableKey: []
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  error_count:
                    type: integer
                    minimum: 0
                  records:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                            event:
                              type: string
                              minLength: 1
                            resource:
                              type: string
                              minLength: 1
                            resource_id:
                              type: string
                              minLength: 1
                            type:
                              type: string
                              enum:
                                - event
                              default: event
                            workspace:
                              type: string
                              format: uuid
                            created_by:
                              type: string
                            created_at:
                              anyOf:
                                - type: string
                                  format: date-time
                                - type: string
                                  format: date-time
                          required:
                            - id
                            - event
                            - workspace
                            - created_by
                            - created_at
                          additionalProperties: false
                        - type: object
                          properties:
                            message:
                              type: string
                            error: {}
                          required:
                            - message
                          additionalProperties: false
                required:
                  - count
                  - records
                additionalProperties: false
        '207':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  error_count:
                    type: integer
                    minimum: 0
                  records:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                            event:
                              type: string
                              minLength: 1
                            resource:
                              type: string
                              minLength: 1
                            resource_id:
                              type: string
                              minLength: 1
                            type:
                              type: string
                              enum:
                                - event
                              default: event
                            workspace:
                              type: string
                              format: uuid
                            created_by:
                              type: string
                            created_at:
                              anyOf:
                                - type: string
                                  format: date-time
                                - type: string
                                  format: date-time
                          required:
                            - id
                            - event
                            - workspace
                            - created_by
                            - created_at
                          additionalProperties: false
                        - type: object
                          properties:
                            message:
                              type: string
                            error: {}
                          required:
                            - message
                          additionalProperties: false
                required:
                  - count
                  - records
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/events/{event_id}:
    get:
      operationId: getEvent
      summary: Get Event
      tags:
        - Events
      description: Get Event by ID
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: event_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  type:
                    type: string
                    enum:
                      - event
                    default: event
                  workspace:
                    type: string
                    format: uuid
                  event:
                    type: string
                  resource:
                    type: string
                    minLength: 1
                  resource_id:
                    type: string
                    minLength: 1
                  status:
                    type: string
                    enum:
                      - pending
                      - processing
                      - completed
                      - failed
                  total_rules:
                    type: integer
                    minimum: 0
                    default: 0
                  completed_count:
                    type: integer
                    minimum: 0
                    default: 0
                  failed_count:
                    type: integer
                    minimum: 0
                    default: 0
                  started_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  completed_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  created_by:
                    type: string
                  created_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  rule_events:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - rule
                        workspace:
                          type: string
                          format: uuid
                        event:
                          type: string
                        event_id:
                          type: string
                          format: uuid
                        resource:
                          type: string
                          minLength: 1
                        resource_id:
                          type: string
                          minLength: 1
                        connection:
                          type: string
                          format: uuid
                        rule:
                          type: string
                          format: uuid
                        integration_type:
                          type: string
                          enum:
                            - activecampaign
                            - aweber
                            - hubspot
                            - intercom
                            - mailchimp
                            - mailerlite
                            - resend
                            - salesforce
                            - slack
                            - webhook
                            - zoom
                        status:
                          type: string
                          enum:
                            - pending
                            - processing
                            - completed
                            - failed
                        attempt_count:
                          type: integer
                          minimum: 0
                        started_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        completed_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        last_error:
                          type: string
                        created_by:
                          type: string
                        created_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                      required:
                        - id
                        - type
                        - workspace
                        - event
                        - event_id
                        - connection
                        - rule
                        - integration_type
                        - status
                        - attempt_count
                        - created_by
                        - created_at
                      additionalProperties: false
                required:
                  - id
                  - workspace
                  - event
                  - status
                  - created_by
                  - created_at
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/events/{event_id}/payload:
    get:
      operationId: getEventPayload
      summary: Get Event with Payload
      tags:
        - Events
      description: Get Event by ID and include the payload
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: event_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  type:
                    type: string
                    enum:
                      - event
                    default: event
                  workspace:
                    type: string
                    format: uuid
                  event:
                    type: string
                  resource:
                    type: string
                    minLength: 1
                  resource_id:
                    type: string
                    minLength: 1
                  status:
                    type: string
                    enum:
                      - pending
                      - processing
                      - completed
                      - failed
                  total_rules:
                    type: integer
                    minimum: 0
                    default: 0
                  completed_count:
                    type: integer
                    minimum: 0
                    default: 0
                  failed_count:
                    type: integer
                    minimum: 0
                    default: 0
                  started_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  completed_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  created_by:
                    type: string
                  created_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  rule_events:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - rule
                        workspace:
                          type: string
                          format: uuid
                        event:
                          type: string
                        event_id:
                          type: string
                          format: uuid
                        resource:
                          type: string
                          minLength: 1
                        resource_id:
                          type: string
                          minLength: 1
                        connection:
                          type: string
                          format: uuid
                        rule:
                          type: string
                          format: uuid
                        integration_type:
                          type: string
                          enum:
                            - activecampaign
                            - aweber
                            - hubspot
                            - intercom
                            - mailchimp
                            - mailerlite
                            - resend
                            - salesforce
                            - slack
                            - webhook
                            - zoom
                        status:
                          type: string
                          enum:
                            - pending
                            - processing
                            - completed
                            - failed
                        attempt_count:
                          type: integer
                          minimum: 0
                        started_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        completed_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        last_error:
                          type: string
                        created_by:
                          type: string
                        created_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                      required:
                        - id
                        - type
                        - workspace
                        - event
                        - event_id
                        - connection
                        - rule
                        - integration_type
                        - status
                        - attempt_count
                        - created_by
                        - created_at
                      additionalProperties: false
                  payload:
                    type: object
                    properties:
                      email:
                        type: string
                        minLength: 1
                        format: email
                      id:
                        type: string
                      ip_address:
                        type: string
                      name:
                        type: string
                      first_name:
                        type: string
                      last_name:
                        type: string
                      phone:
                        type: string
                      resource_url:
                        type: string
                    additionalProperties: {}
                required:
                  - id
                  - workspace
                  - event
                  - status
                  - created_by
                  - created_at
                  - payload
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/events/{event_id}/rules/{rule_id}/retry:
    post:
      operationId: retryEventRule
      summary: Retry Event
      tags:
        - Events
      description: Retry a single event rule
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: event_id
          required: true
        - schema:
            type: string
            format: uuid
          in: path
          name: rule_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  type:
                    type: string
                    enum:
                      - rule
                  workspace:
                    type: string
                    format: uuid
                  event:
                    type: string
                  event_id:
                    type: string
                    format: uuid
                  resource:
                    type: string
                    minLength: 1
                  resource_id:
                    type: string
                    minLength: 1
                  connection:
                    type: string
                    format: uuid
                  rule:
                    type: string
                    format: uuid
                  integration_type:
                    type: string
                    enum:
                      - activecampaign
                      - aweber
                      - hubspot
                      - intercom
                      - mailchimp
                      - mailerlite
                      - resend
                      - salesforce
                      - slack
                      - webhook
                      - zoom
                  status:
                    type: string
                    enum:
                      - pending
                      - processing
                      - completed
                      - failed
                  attempt_count:
                    type: integer
                    minimum: 0
                  started_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  completed_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  last_error:
                    type: string
                  created_by:
                    type: string
                  created_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                required:
                  - id
                  - type
                  - workspace
                  - event
                  - event_id
                  - connection
                  - rule
                  - integration_type
                  - status
                  - attempt_count
                  - created_by
                  - created_at
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '425':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/integrations:
    get:
      operationId: getIntegrations
      summary: Get Integrations
      tags:
        - Integrations
      description: Get the possible integrations metadata
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  limit:
                    type: integer
                    exclusiveMinimum: true
                    minimum: 0
                  next_cursor:
                    type: string
                    nullable: true
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        type:
                          type: string
                          enum:
                            - activecampaign
                            - aweber
                            - hubspot
                            - intercom
                            - mailchimp
                            - mailerlite
                            - resend
                            - salesforce
                            - slack
                            - webhook
                            - zoom
                        authentication:
                          anyOf:
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - api_key
                                fields:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      label:
                                        type: string
                                      key:
                                        type: string
                                      type:
                                        type: string
                                        enum:
                                          - text
                                          - password
                                      helpText:
                                        type: string
                                      required:
                                        type: boolean
                                      validate:
                                        type: string
                                        enum:
                                          - url
                                    required:
                                      - label
                                      - key
                                      - type
                                    additionalProperties: false
                              required:
                                - type
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - basic
                                fields:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      label:
                                        type: string
                                      key:
                                        type: string
                                      type:
                                        type: string
                                        enum:
                                          - text
                                          - password
                                      helpText:
                                        type: string
                                      required:
                                        type: boolean
                                      validate:
                                        type: string
                                        enum:
                                          - url
                                    required:
                                      - label
                                      - key
                                      - type
                                    additionalProperties: false
                              required:
                                - type
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - none
                                fields:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      label:
                                        type: string
                                      key:
                                        type: string
                                      type:
                                        type: string
                                        enum:
                                          - text
                                          - password
                                      helpText:
                                        type: string
                                      required:
                                        type: boolean
                                      validate:
                                        type: string
                                        enum:
                                          - url
                                    required:
                                      - label
                                      - key
                                      - type
                                    additionalProperties: false
                              required:
                                - type
                              additionalProperties: false
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - oauth
                                oauth:
                                  type: object
                                  properties:
                                    version:
                                      allOf:
                                        - type: number
                                        - anyOf:
                                            - type: number
                                              enum:
                                                - 1
                                            - type: number
                                              enum:
                                                - 2
                                  required:
                                    - version
                                  additionalProperties: false
                                fields:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      label:
                                        type: string
                                      key:
                                        type: string
                                      type:
                                        type: string
                                        enum:
                                          - text
                                          - password
                                      helpText:
                                        type: string
                                      required:
                                        type: boolean
                                      validate:
                                        type: string
                                        enum:
                                          - url
                                    required:
                                      - label
                                      - key
                                      - type
                                    additionalProperties: false
                              required:
                                - type
                                - oauth
                              additionalProperties: false
                        actions:
                          type: object
                          additionalProperties:
                            type: object
                            properties:
                              key:
                                type: string
                              label:
                                type: string
                              noun:
                                type: string
                              data:
                                type: array
                                items:
                                  anyOf:
                                    - type: object
                                      properties:
                                        key:
                                          type: string
                                        field:
                                          type: string
                                        kind:
                                          type: string
                                          enum:
                                            - simple
                                        label:
                                          type: string
                                        noun:
                                          type: string
                                        target:
                                          type: string
                                        from:
                                          type: string
                                        required:
                                          type: boolean
                                      required:
                                        - key
                                        - field
                                        - kind
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        key:
                                          type: string
                                        field:
                                          type: string
                                        kind:
                                          type: string
                                          enum:
                                            - field
                                        label:
                                          type: string
                                        type:
                                          type: string
                                          enum:
                                            - text
                                            - password
                                            - textarea
                                        noun:
                                          type: string
                                        description:
                                          type: string
                                        placeholder:
                                          type: string
                                        regex:
                                          type: string
                                        regexMessage:
                                          type: string
                                        required:
                                          type: boolean
                                      required:
                                        - key
                                        - field
                                        - kind
                                        - label
                                        - type
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        key:
                                          type: string
                                        field:
                                          type: string
                                        kind:
                                          type: string
                                          enum:
                                            - advanced
                                        options:
                                          anyOf:
                                            - type: object
                                              properties:
                                                key:
                                                  type: string
                                                field:
                                                  type: string
                                                length:
                                                  type: integer
                                                  minimum: 0
                                                display:
                                                  type: object
                                                  properties:
                                                    label:
                                                      type: string
                                                    button:
                                                      type: string
                                                    description:
                                                      type: string
                                                  required:
                                                    - label
                                                    - button
                                                    - description
                                                  additionalProperties: false
                                                type:
                                                  type: string
                                                  enum:
                                                    - array
                                                entity:
                                                  type: string
                                                  enum:
                                                    - string
                                              required:
                                                - key
                                                - field
                                                - length
                                                - display
                                                - type
                                                - entity
                                              additionalProperties: false
                                            - type: object
                                              properties:
                                                key:
                                                  type: string
                                                field:
                                                  type: string
                                                length:
                                                  type: integer
                                                  minimum: 0
                                                display:
                                                  type: object
                                                  properties:
                                                    label:
                                                      type: string
                                                    button:
                                                      type: string
                                                    description:
                                                      type: string
                                                  required:
                                                    - label
                                                    - button
                                                    - description
                                                  additionalProperties: false
                                                type:
                                                  type: string
                                                  enum:
                                                    - select
                                                entity:
                                                  type: string
                                                  enum:
                                                    - option
                                              required:
                                                - key
                                                - field
                                                - length
                                                - display
                                                - type
                                                - entity
                                              additionalProperties: false
                                        label:
                                          type: string
                                        noun:
                                          type: string
                                        target:
                                          type: string
                                        from:
                                          type: string
                                        required:
                                          type: boolean
                                      required:
                                        - key
                                        - field
                                        - kind
                                        - options
                                      additionalProperties: false
                              fields:
                                type: array
                                items:
                                  type: string
                              display:
                                type: object
                                properties:
                                  label:
                                    type: string
                                  description:
                                    type: string
                                required:
                                  - label
                                  - description
                                additionalProperties: false
                            required:
                              - key
                              - label
                              - noun
                            additionalProperties: false
                      required:
                        - name
                        - type
                        - authentication
                        - actions
                      additionalProperties: false
                required:
                  - count
                  - limit
                  - records
                additionalProperties: false
  /api/v1/rules:
    get:
      operationId: getRules
      summary: Get Rules
      tags:
        - Rules
      description: Get all rules for the organization
      parameters:
        - schema:
            type: string
          in: query
          name: event
          required: false
        - schema:
            type: string
          in: query
          name: resource
          required: false
        - schema:
            type: string
          in: query
          name: resource_id
          required: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  limit:
                    type: integer
                    exclusiveMinimum: true
                    minimum: 0
                  next_cursor:
                    type: string
                    nullable: true
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        connection:
                          type: string
                          format: uuid
                        workspace:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - activecampaign
                            - aweber
                            - hubspot
                            - intercom
                            - mailchimp
                            - mailerlite
                            - resend
                            - salesforce
                            - slack
                            - webhook
                            - zoom
                        resource:
                          type: string
                          minLength: 1
                        resource_id:
                          type: string
                          minLength: 1
                        event:
                          type: string
                          minLength: 1
                        metadata:
                          type: object
                          properties:
                            action:
                              type: string
                              minLength: 1
                            id:
                              type: string
                            name:
                              type: string
                            value:
                              type: string
                            key:
                              type: string
                            data:
                              type: string
                            option:
                              type: string
                            option_value:
                              type: string
                          required:
                            - action
                          additionalProperties:
                            anyOf:
                              - not: {}
                              - type: string
                        active:
                          type: boolean
                          default: true
                        hidden:
                          type: boolean
                          default: false
                        created_by:
                          type: string
                        created_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        updated_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                      required:
                        - id
                        - connection
                        - workspace
                        - type
                        - event
                        - metadata
                        - created_by
                        - created_at
                        - updated_at
                      additionalProperties: false
                required:
                  - count
                  - limit
                  - records
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    post:
      operationId: createRule
      summary: Create Rule
      tags:
        - Rules
      description: Create a new rule
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  type: string
                  format: uuid
                connection:
                  type: string
                  format: uuid
                event:
                  type: string
                  minLength: 1
                resource:
                  type: string
                  minLength: 1
                resource_id:
                  type: string
                  pattern: ^[A-Za-z0-9._:-]{1,64}$
                metadata:
                  type: object
                  properties:
                    action:
                      type: string
                      minLength: 1
                    id:
                      type: string
                    name:
                      type: string
                    value:
                      type: string
                    key:
                      type: string
                    data:
                      type: string
                    option:
                      type: string
                    option_value:
                      type: string
                  required:
                    - action
                  additionalProperties:
                    anyOf:
                      - not: {}
                      - type: string
                hidden:
                  type: boolean
                  default: false
                active:
                  type: boolean
                  default: true
              required:
                - workspace
                - connection
                - event
                - metadata
              additionalProperties: false
        required: true
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  rule:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      connection:
                        type: string
                        format: uuid
                      workspace:
                        type: string
                        format: uuid
                      type:
                        type: string
                        enum:
                          - activecampaign
                          - aweber
                          - hubspot
                          - intercom
                          - mailchimp
                          - mailerlite
                          - resend
                          - salesforce
                          - slack
                          - webhook
                          - zoom
                      resource:
                        type: string
                        minLength: 1
                      resource_id:
                        type: string
                        minLength: 1
                      event:
                        type: string
                        minLength: 1
                      metadata:
                        type: object
                        properties:
                          action:
                            type: string
                            minLength: 1
                          id:
                            type: string
                          name:
                            type: string
                          value:
                            type: string
                          key:
                            type: string
                          data:
                            type: string
                          option:
                            type: string
                          option_value:
                            type: string
                        required:
                          - action
                        additionalProperties:
                          anyOf:
                            - not: {}
                            - type: string
                      active:
                        type: boolean
                        default: true
                      hidden:
                        type: boolean
                        default: false
                      created_by:
                        type: string
                      created_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                      updated_at:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: string
                            format: date-time
                    required:
                      - id
                      - connection
                      - workspace
                      - type
                      - event
                      - metadata
                      - created_by
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - rule
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/rules/{rule_id}:
    get:
      operationId: getRule
      summary: Get Rule
      tags:
        - Rules
      description: Get Rule by ID
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: rule_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  connection:
                    type: string
                    format: uuid
                  workspace:
                    type: string
                    format: uuid
                  type:
                    type: string
                    enum:
                      - activecampaign
                      - aweber
                      - hubspot
                      - intercom
                      - mailchimp
                      - mailerlite
                      - resend
                      - salesforce
                      - slack
                      - webhook
                      - zoom
                  resource:
                    type: string
                    minLength: 1
                  resource_id:
                    type: string
                    minLength: 1
                  event:
                    type: string
                    minLength: 1
                  metadata:
                    type: object
                    properties:
                      action:
                        type: string
                        minLength: 1
                      id:
                        type: string
                      name:
                        type: string
                      value:
                        type: string
                      key:
                        type: string
                      data:
                        type: string
                      option:
                        type: string
                      option_value:
                        type: string
                    required:
                      - action
                    additionalProperties:
                      anyOf:
                        - not: {}
                        - type: string
                  active:
                    type: boolean
                    default: true
                  hidden:
                    type: boolean
                    default: false
                  created_by:
                    type: string
                  created_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                  updated_at:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: string
                        format: date-time
                required:
                  - id
                  - connection
                  - workspace
                  - type
                  - event
                  - metadata
                  - created_by
                  - created_at
                  - updated_at
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    delete:
      operationId: deleteRule
      summary: Delete Rule
      tags:
        - Rules
      description: Delete Rule by ID
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: rule_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  connection:
                    type: string
                    minLength: 1
                  type:
                    type: string
                    enum:
                      - activecampaign
                      - aweber
                      - hubspot
                      - intercom
                      - mailchimp
                      - mailerlite
                      - resend
                      - salesforce
                      - slack
                      - webhook
                      - zoom
                  event:
                    type: string
                    minLength: 1
                  resource:
                    type: string
                    minLength: 1
                  resource_id:
                    type: string
                    minLength: 1
                required:
                  - id
                  - connection
                  - type
                  - event
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/workspaces:
    get:
      operationId: getWorkspaces
      summary: Get Workspaces
      tags:
        - Workspaces
      description: Get all workspaces for the organization
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  limit:
                    type: integer
                    exclusiveMinimum: true
                    minimum: 0
                  next_cursor:
                    type: string
                    nullable: true
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        name:
                          type: string
                        description:
                          type: string
                          nullable: true
                        created_at:
                          type: string
                          format: date-time
                        updated_at:
                          type: string
                          format: date-time
                      required:
                        - id
                        - name
                        - description
                        - created_at
                        - updated_at
                      additionalProperties: false
                required:
                  - count
                  - limit
                  - records
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    post:
      operationId: createWorkspace
      summary: Create Workspace
      tags:
        - Workspaces
      description: Create a New Workspace
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 3
                  maxLength: 50
                  pattern: ^[a-zA-Z0-9 _-]+$
                description:
                  type: string
                  maxLength: 1024
              required:
                - name
              additionalProperties: false
        required: true
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  workspace:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                    required:
                      - id
                      - name
                      - description
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - workspace
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/workspaces/{workspace_id}:
    get:
      operationId: getWorkspace
      summary: Get Workspace
      tags:
        - Workspaces
      description: Get Workspace by ID
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: workspace_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  description:
                    type: string
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                  publishable_key:
                    type: object
                    properties:
                      public_key:
                        type: string
                        minLength: 1
                      name:
                        type: string
                        minLength: 1
                    required:
                      - public_key
                      - name
                    additionalProperties: false
                required:
                  - id
                  - name
                  - description
                  - created_at
                  - updated_at
                  - publishable_key
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
    put:
      operationId: updateWorkspace
      summary: Update Workspace
      tags:
        - Workspaces
      description: Update Workspace by ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 3
                  maxLength: 50
                  pattern: ^[a-zA-Z0-9 _-]+$
                description:
                  type: string
                  maxLength: 1024
                  nullable: true
              required:
                - name
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: workspace_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  description:
                    type: string
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                required:
                  - id
                  - name
                  - description
                  - created_at
                  - updated_at
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/workspaces/{workspace_id}/connections:
    get:
      operationId: getWorkspaceConnections
      summary: Get Workspace Connections
      tags:
        - Workspaces
      description: Get all connections for the workspace
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: workspace_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  limit:
                    type: integer
                    exclusiveMinimum: true
                    minimum: 0
                  next_cursor:
                    type: string
                    nullable: true
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        workspace:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - activecampaign
                            - aweber
                            - hubspot
                            - intercom
                            - mailchimp
                            - mailerlite
                            - resend
                            - salesforce
                            - slack
                            - webhook
                            - zoom
                        name:
                          type: string
                        metadata:
                          type: object
                          additionalProperties: {}
                        action_data:
                          type: object
                          additionalProperties: {}
                        hidden:
                          type: boolean
                          default: false
                        created_by:
                          type: string
                        created_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        updated_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                      required:
                        - id
                        - workspace
                        - type
                        - name
                        - metadata
                        - created_by
                        - created_at
                        - updated_at
                      additionalProperties: false
                required:
                  - count
                  - limit
                  - records
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/workspaces/{workspace_id}/rules:
    get:
      operationId: getWorkspaceRules
      summary: Get Workspace Rules
      tags:
        - Workspaces
      description: Get all rules for the workspace
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: workspace_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  limit:
                    type: integer
                    exclusiveMinimum: true
                    minimum: 0
                  next_cursor:
                    type: string
                    nullable: true
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        connection:
                          type: string
                          format: uuid
                        workspace:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - activecampaign
                            - aweber
                            - hubspot
                            - intercom
                            - mailchimp
                            - mailerlite
                            - resend
                            - salesforce
                            - slack
                            - webhook
                            - zoom
                        resource:
                          type: string
                          minLength: 1
                        resource_id:
                          type: string
                          minLength: 1
                        event:
                          type: string
                          minLength: 1
                        metadata:
                          type: object
                          properties:
                            action:
                              type: string
                              minLength: 1
                            id:
                              type: string
                            name:
                              type: string
                            value:
                              type: string
                            key:
                              type: string
                            data:
                              type: string
                            option:
                              type: string
                            option_value:
                              type: string
                          required:
                            - action
                          additionalProperties:
                            anyOf:
                              - not: {}
                              - type: string
                        active:
                          type: boolean
                          default: true
                        hidden:
                          type: boolean
                          default: false
                        created_by:
                          type: string
                        created_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        updated_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                      required:
                        - id
                        - connection
                        - workspace
                        - type
                        - event
                        - metadata
                        - created_by
                        - created_at
                        - updated_at
                      additionalProperties: false
                required:
                  - count
                  - limit
                  - records
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
  /api/v1/workspaces/{workspace_id}/events:
    get:
      operationId: getWorkspaceEvents
      summary: Get Workspace Events
      tags:
        - Workspaces
      description: Get all events for the workspace
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          in: query
          name: limit
          required: false
        - schema:
            type: string
            pattern: ^[A-Za-z0-9_-]+$
            nullable: true
          in: query
          name: cursor
          required: false
        - schema:
            type: string
          in: query
          name: event
          required: false
        - schema:
            type: string
          in: query
          name: resource
          required: false
        - schema:
            type: string
          in: query
          name: resource_id
          required: false
        - schema:
            type: string
            enum:
              - pending
              - processing
              - completed
              - failed
          in: query
          name: status
          required: false
        - schema:
            type: string
            format: uuid
          in: path
          name: workspace_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
                  limit:
                    type: integer
                    exclusiveMinimum: true
                    minimum: 0
                  next_cursor:
                    type: string
                    nullable: true
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        type:
                          type: string
                          enum:
                            - event
                          default: event
                        workspace:
                          type: string
                          format: uuid
                        event:
                          type: string
                        resource:
                          type: string
                          minLength: 1
                        resource_id:
                          type: string
                          minLength: 1
                        status:
                          type: string
                          enum:
                            - pending
                            - processing
                            - completed
                            - failed
                        total_rules:
                          type: integer
                          minimum: 0
                          default: 0
                        completed_count:
                          type: integer
                          minimum: 0
                          default: 0
                        failed_count:
                          type: integer
                          minimum: 0
                          default: 0
                        started_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        completed_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        created_by:
                          type: string
                        created_at:
                          anyOf:
                            - type: string
                              format: date-time
                            - type: string
                              format: date-time
                        rule_events:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                              type:
                                type: string
                                enum:
                                  - rule
                              workspace:
                                type: string
                                format: uuid
                              event:
                                type: string
                              event_id:
                                type: string
                                format: uuid
                              resource:
                                type: string
                                minLength: 1
                              resource_id:
                                type: string
                                minLength: 1
                              connection:
                                type: string
                                format: uuid
                              rule:
                                type: string
                                format: uuid
                              integration_type:
                                type: string
                                enum:
                                  - activecampaign
                                  - aweber
                                  - hubspot
                                  - intercom
                                  - mailchimp
                                  - mailerlite
                                  - resend
                                  - salesforce
                                  - slack
                                  - webhook
                                  - zoom
                              status:
                                type: string
                                enum:
                                  - pending
                                  - processing
                                  - completed
                                  - failed
                              attempt_count:
                                type: integer
                                minimum: 0
                              started_at:
                                anyOf:
                                  - type: string
                                    format: date-time
                                  - type: string
                                    format: date-time
                              completed_at:
                                anyOf:
                                  - type: string
                                    format: date-time
                                  - type: string
                                    format: date-time
                              last_error:
                                type: string
                              created_by:
                                type: string
                              created_at:
                                anyOf:
                                  - type: string
                                    format: date-time
                                  - type: string
                                    format: date-time
                            required:
                              - id
                              - type
                              - workspace
                              - event
                              - event_id
                              - connection
                              - rule
                              - integration_type
                              - status
                              - attempt_count
                              - created_by
                              - created_at
                            additionalProperties: false
                      required:
                        - id
                        - workspace
                        - event
                        - status
                        - created_by
                        - created_at
                      additionalProperties: false
                required:
                  - count
                  - limit
                  - records
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error: {}
                required:
                  - message
                additionalProperties: false
servers:
  - url: https://api.meshes.io
security:
  - bearerAuth: []
tags:
  - name: Connections
    description: Connection related end-points
  - name: Events
    description: Event related end-points
  - name: Integrations
    description: Integration related end-points
  - name: Rules
    description: Rule related end-points
  - name: Workspaces
    description: Workspace related end-points
externalDocs:
  url: https://meshes.io/docs
  description: Main Meshes documentation can be found here
