openapi: 3.0.1
info:
  title: Courier
  description: The Courier REST API.
  version: ''
paths:
  /send:
    post:
      description: Send a message to one or more recipients.
      operationId: send
      tags:
        - Send
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
              examples:
                Example1:
                  value:
                    requestId: 1-65f240a0-47a6a120c8374de9bcf9f22a
      summary: Send a message
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  $ref: '#/components/schemas/Message'
                  description: Defines the message to be delivered
              required:
                - message
            examples:
              Example1:
                summary: Send message with UserRecipient
                description: Default example using UserRecipient type
                value:
                  message:
                    to:
                      user_id: user_id
                    template: template_id
                    data:
                      foo: bar
              Example2:
                value:
                  message:
                    to:
                      email: user@example.com
                    template: template_id
                    data:
                      foo: bar
              Example3:
                value:
                  message:
                    to:
                      phone_number: '+1234567890'
                    template: template_id
                    data:
                      foo: bar
              Example4:
                value:
                  message:
                    to:
                      list_id: example_list
                    template: template_id
                    data:
                      foo: bar
              Example5:
                value:
                  message:
                    to:
                      user_id: example_user
                    content:
                      title: Hello {name}
                      body: How are you?
                    data:
                      name: Ben
                    routing:
                      method: single
                      channels:
                        - email
  /profiles/{user_id}:
    get:
      description: Returns the specified user profile.
      operationId: profiles_get
      tags:
        - User Profiles
      parameters:
        - name: user_id
          in: path
          description: A unique identifier representing the user associated with the requested profile.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileGetResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get a profile
      security:
        - BearerAuth: []
    post:
      description: >-
        Merge the supplied values with an existing profile or create a new profile if one doesn't already
        exist.
      operationId: profiles_create
      tags:
        - User Profiles
      parameters:
        - name: user_id
          in: path
          description: A unique identifier representing the user associated with the requested profile.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MergeProfileResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Create a profile
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                profile:
                  type: object
                  additionalProperties: true
              required:
                - profile
    put:
      description: >-
        When using `PUT`, be sure to include all the key-value pairs required by the recipient's profile. 

        Any key-value pairs that exist in the profile but fail to be included in the `PUT` request will be 

        removed from the profile. Remember, a `PUT` update is a full replacement of the data. For partial
        updates, 

        use the [Patch](https://www.courier.com/docs/reference/profiles/patch/) request.
      operationId: profiles_replace
      tags:
        - User Profiles
      parameters:
        - name: user_id
          in: path
          description: A unique identifier representing the user associated with the requested user profile.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplaceProfileResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Replace a profile
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                profile:
                  type: object
                  additionalProperties: true
              required:
                - profile
    patch:
      operationId: profiles_mergeProfile
      tags:
        - User Profiles
      parameters:
        - name: user_id
          in: path
          description: A unique identifier representing the user associated with the requested user profile.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Update a profile
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfileUpdateRequest'
    delete:
      description: Deletes the specified user profile.
      operationId: profiles_delete
      tags:
        - User Profiles
      parameters:
        - name: user_id
          in: path
          description: A unique identifier representing the user associated with the requested user profile.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Delete a profile
      security:
        - BearerAuth: []
  /profiles/{user_id}/lists:
    get:
      description: Returns the subscribed lists for a specified user.
      operationId: profiles_getListSubscriptions
      tags:
        - User Profiles
      parameters:
        - name: user_id
          in: path
          description: A unique identifier representing the user associated with the requested user profile.
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next set of message statuses.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetListSubscriptionsResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get list subscriptions
      security:
        - BearerAuth: []
    post:
      description: Subscribes the given user to one or more lists. If the list does not exist, it will be created.
      operationId: profiles_subscribeToList
      tags:
        - User Profiles
      parameters:
        - name: user_id
          in: path
          description: A unique identifier representing the user associated with the requested user profile.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscribeToListsResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Subscribe to one or more lists
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscribeToListsRequest'
    delete:
      description: Removes all list subscriptions for given user.
      operationId: profiles_deleteListSubscription
      tags:
        - User Profiles
      parameters:
        - name: user_id
          in: path
          description: A unique identifier representing the user associated with the requested profile.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteListSubscriptionResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Delete list subscriptions
      security:
        - BearerAuth: []
  /lists:
    get:
      description: Returns all of the lists, with the ability to filter based on a pattern.
      operationId: lists_list
      tags:
        - Lists
      parameters:
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next page of lists.
          required: false
          schema:
            type: string
            nullable: true
        - name: pattern
          in: query
          description: >-
            "A pattern used to filter the list items returned. Pattern types supported: exact match on
            `list_id` or a pattern of one or more pattern parts. you may replace a part with either: `*` to
            match all parts in that position, or `**` to signify a wildcard `endsWith` pattern match."
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListGetAllResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get all lists
      security:
        - BearerAuth: []
  /lists/{list_id}:
    get:
      description: Returns a list based on the list ID provided.
      operationId: lists_get
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionList'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Get a list
      security:
        - BearerAuth: []
    put:
      description: Create or replace an existing list with the supplied values.
      operationId: lists_update
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Update a list
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListPutParams'
    delete:
      description: Delete a list by list ID.
      operationId: lists_delete
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Delete a list
      security:
        - BearerAuth: []
  /lists/{list_id}/restore:
    put:
      description: Restore a previously deleted list.
      operationId: lists_restore
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Restore a list
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: {}
  /lists/{list_id}/subscriptions:
    get:
      description: Get the list's subscriptions.
      operationId: lists_getSubscribers
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next set of list subscriptions
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListGetSubscriptionsResponse'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Get the subscriptions for a list
      security:
        - BearerAuth: []
    post:
      description: >-
        Subscribes additional users to the list, without modifying existing subscriptions. If the list does
        not exist, it will be automatically created.
      operationId: lists_addSubscribers
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
      responses:
        '202':
          description: ''
        '204':
          description: ''
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Add subscribers to a list
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                recipients:
                  type: array
                  items:
                    $ref: '#/components/schemas/PutSubscriptionsRecipient'
              required:
                - recipients
    put:
      description: >-
        Subscribes the users to the list, overwriting existing subscriptions. If the list does not exist, it
        will be automatically created.
      operationId: lists_updateSubscribers
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
      responses:
        '202':
          description: ''
        '204':
          description: ''
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Subscribe users to a list
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                recipients:
                  type: array
                  items:
                    $ref: '#/components/schemas/PutSubscriptionsRecipient'
              required:
                - recipients
  /lists/{list_id}/subscriptions/{user_id}:
    put:
      description: >-
        Subscribe a user to an existing list (note: if the List does not exist, it will be automatically
        created).
      operationId: lists_subscribe
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
        - name: user_id
          in: path
          description: A unique identifier representing the recipient associated with the list
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Subscribe a single user profile to a list
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                preferences:
                  $ref: '#/components/schemas/RecipientPreferences'
                  nullable: true
    delete:
      description: Delete a subscription to a list by list ID and user ID.
      operationId: lists_unsubscribe
      tags:
        - Lists
      parameters:
        - name: list_id
          in: path
          description: A unique identifier representing the list you wish to retrieve.
          required: true
          schema:
            type: string
        - name: user_id
          in: path
          description: A unique identifier representing the recipient associated with the list
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Unsubscribe a user profile from a list
      security:
        - BearerAuth: []
  /audiences/{audience_id}:
    get:
      description: Returns the specified audience by id.
      operationId: audiences_get
      tags:
        - Audiences
      parameters:
        - name: audience_id
          in: path
          description: A unique identifier representing the audience_id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Audience'
      summary: Get an audience
      security:
        - BearerAuth: []
    put:
      description: Creates or updates audience.
      operationId: audiences_update
      tags:
        - Audiences
      parameters:
        - name: audience_id
          in: path
          description: A unique identifier representing the audience id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudienceUpdateResponse'
      summary: Update an audience
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  nullable: true
                  description: The name of the audience
                description:
                  type: string
                  nullable: true
                  description: A description of the audience
                operator:
                  $ref: '#/components/schemas/LogicalOperator'
                  nullable: true
                  description: The logical operator (AND/OR) for the top-level filter
                filter:
                  $ref: '#/components/schemas/AudienceFilterConfig'
                  nullable: true
    delete:
      description: Deletes the specified audience.
      operationId: audiences_delete
      tags:
        - Audiences
      parameters:
        - name: audience_id
          in: path
          description: A unique identifier representing the audience id
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Delete an audience
      security:
        - BearerAuth: []
  /audiences/{audience_id}/members:
    get:
      description: Get list of members of an audience.
      operationId: audiences_listMembers
      tags:
        - Audiences
      parameters:
        - name: audience_id
          in: path
          description: A unique identifier representing the audience id
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next set of members
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudienceMemberListResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: List audience members
      security:
        - BearerAuth: []
  /audiences:
    get:
      description: Get the audiences associated with the authorization token.
      operationId: audiences_listAudiences
      tags:
        - Audiences
      parameters:
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next set of audiences
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudienceListResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: List all audiences
      security:
        - BearerAuth: []
  /messages:
    get:
      description: Fetch the statuses of messages you've previously sent.
      operationId: messages_list
      tags:
        - Sent Messages
      parameters:
        - name: archived
          in: query
          description: A boolean value that indicates whether archived messages should be included in the response.
          required: false
          schema:
            type: boolean
            nullable: true
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next set of messages.
          required: false
          schema:
            type: string
            nullable: true
        - name: event
          in: query
          description: A unique identifier representing the event that was used to send the event.
          required: false
          schema:
            type: string
            nullable: true
        - name: list
          in: query
          description: A unique identifier representing the list the message was sent to.
          required: false
          schema:
            type: string
            nullable: true
        - name: messageId
          in: query
          description: A unique identifier representing the message_id returned from either /send or /send/list.
          required: false
          schema:
            type: string
            nullable: true
        - name: notification
          in: query
          description: A unique identifier representing the notification that was used to send the event.
          required: false
          schema:
            type: string
            nullable: true
        - name: provider
          in: query
          description: >-
            The key assocated to the provider you want to filter on. E.g., sendgrid, inbox, twilio, slack,
            msteams, etc. Allows multiple values to be set in query parameters.
          required: false
          schema:
            type: array
            items:
              type: string
              nullable: true
        - name: recipient
          in: query
          description: A unique identifier representing the recipient associated with the requested profile.
          required: false
          schema:
            type: string
            nullable: true
        - name: status
          in: query
          description: >-
            An indicator of the current status of the message. Allows multiple values to be set in query
            parameters.
          required: false
          schema:
            type: array
            items:
              type: string
              nullable: true
        - name: tag
          in: query
          description: >-
            A tag placed in the metadata.tags during a notification send. Allows multiple values to be set in
            query parameters.
          required: false
          schema:
            type: array
            items:
              type: string
              nullable: true
        - name: tags
          in: query
          description: >-
            A comma delimited list of 'tags'. Messages will be returned if they match any of the tags passed
            in.
          required: false
          schema:
            type: string
            nullable: true
        - name: tenant_id
          in: query
          description: Messages sent with the context of a Tenant
          required: false
          schema:
            type: string
            nullable: true
        - name: enqueued_after
          in: query
          description: The enqueued datetime of a message to filter out messages received before.
          required: false
          schema:
            type: string
            nullable: true
        - name: traceId
          in: query
          description: The unique identifier used to trace the requests
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListMessagesResponse'
      summary: List messages
      security:
        - BearerAuth: []
  /messages/{message_id}:
    get:
      description: Fetch the status of a message you've previously sent.
      operationId: messages_get
      tags:
        - Sent Messages
      parameters:
        - name: message_id
          in: path
          description: A unique identifier associated with the message you wish to retrieve (results from a send).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageDetailsExtended'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageNotFound'
      summary: Get message
      security:
        - BearerAuth: []
  /messages/{message_id}/cancel:
    post:
      description: >-
        Cancel a message that is currently in the process of being delivered. A well-formatted API call to the
        cancel message API will return either `200` status code for a successful cancellation or `409` status
        code for an unsuccessful cancellation. Both cases will include the actual message record in the
        response body (see details below).
      operationId: messages_cancel
      tags:
        - Sent Messages
      parameters:
        - name: message_id
          in: path
          description: A unique identifier representing the message ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageDetails'
      summary: Cancel message
      security:
        - BearerAuth: []
  /messages/{message_id}/history:
    get:
      description: Fetch the array of events of a message you've previously sent.
      operationId: messages_getHistory
      tags:
        - Sent Messages
      parameters:
        - name: message_id
          in: path
          description: A unique identifier representing the message ID
          required: true
          schema:
            type: string
        - name: type
          in: query
          description: A supported Message History type that will filter the events returned.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageHistoryResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageNotFound'
      summary: Get message history
      security:
        - BearerAuth: []
  /messages/{message_id}/output:
    get:
      operationId: messages_getContent
      tags:
        - Sent Messages
      parameters:
        - name: message_id
          in: path
          description: A unique identifier associated with the message you wish to retrieve (results from a send).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RenderOutputResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageNotFound'
      summary: Get message content
      security:
        - BearerAuth: []
  /requests/{request_id}/archive:
    put:
      operationId: messages_archive
      tags:
        - Sent Messages
      parameters:
        - name: request_id
          in: path
          description: A unique identifier representing the request ID
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Archive message
      security:
        - BearerAuth: []
  /notifications:
    get:
      description: List notification templates in your workspace.
      operationId: notifications_list
      tags:
        - Notification Templates
      parameters:
        - name: cursor
          in: query
          description: Opaque pagination cursor from a previous response. Omit for the first page.
          required: false
          schema:
            type: string
            nullable: true
        - name: notes
          in: query
          description: Include template notes in the response. Only applies to legacy templates.
          required: false
          schema:
            type: boolean
            nullable: true
        - name: event_id
          in: query
          description: Filter to templates linked to this event map ID.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationListResponse'
      summary: List Notification Templates
      security:
        - BearerAuth: []
    post:
      description: >-
        Create a notification template. Requires all fields in the notification object. Templates are created
        in draft state by default.
      operationId: notifications_create
      tags:
        - Notification Templates
      parameters: []
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationTemplateResponse'
              examples:
                DraftCreated:
                  value:
                    id: nt_01abc123
                    name: Welcome Email
                    tags:
                      - onboarding
                      - welcome
                    brand:
                      id: brand_abc
                    subscription:
                      topic_id: marketing
                    routing:
                      strategy_id: rs_123
                    content:
                      version: '2022-01-01'
                      elements:
                        - type: channel
                          channel: email
                          elements:
                            - type: meta
                              title: Welcome!
                            - type: text
                              content: Hello {{data.name}}.
                    state: DRAFT
                    created: 1710000000000
                    creator: user_abc
                    updated: 1710000000000
                    updater: user_abc
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                ValidationError:
                  value:
                    type: invalid_request_error
                    message: 'notification.name: Required; notification.content: Required'
                RoutingStrategyNotFound:
                  value:
                    type: invalid_request_error
                    message: Routing strategy rs_nonexistent not found
      summary: Create Notification Template
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationTemplateCreateRequest'
            examples:
              DraftWithAllFields:
                summary: Create a draft template with all fields populated
                value:
                  notification:
                    name: Welcome Email
                    tags:
                      - onboarding
                      - welcome
                    brand:
                      id: brand_abc
                    subscription:
                      topic_id: marketing
                    routing:
                      strategy_id: rs_123
                    content:
                      version: '2022-01-01'
                      elements:
                        - type: channel
                          channel: email
                          elements:
                            - type: meta
                              title: Welcome!
                            - type: text
                              content: Hello {{data.name}}.
                  state: DRAFT
              MinimalDraft:
                summary: Create a minimal draft template
                value:
                  notification:
                    name: Bare Minimum
                    tags: []
                    brand: null
                    subscription: null
                    routing: null
                    content:
                      version: '2022-01-01'
                      elements: []
              AutoPublish:
                summary: Create and immediately publish
                value:
                  notification:
                    name: Auto-Published Template
                    tags:
                      - alerts
                    brand: null
                    subscription: null
                    routing: null
                    content:
                      version: '2022-01-01'
                      elements:
                        - type: channel
                          channel: email
                          elements:
                            - type: meta
                              title: Alert
                            - type: text
                              content: You have a new alert.
                  state: PUBLISHED
  /notifications/{id}:
    get:
      description: >-
        Retrieve a notification template by ID. Returns the published version by default. Pass version=draft
        to retrieve an unpublished template.
      operationId: notifications_retrieve
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Template ID (nt_ prefix).
          required: true
          schema:
            type: string
        - name: version
          in: query
          description: >-
            Version to retrieve. One of "draft", "published", or a version string like "v001". Defaults to
            "published".
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationTemplateResponse'
              examples:
                PublishedTemplate:
                  value:
                    id: nt_01abc123
                    name: Welcome Email
                    tags:
                      - onboarding
                    brand:
                      id: brand_abc
                    subscription:
                      topic_id: marketing
                    routing: null
                    content:
                      version: '2022-01-01'
                      elements:
                        - type: channel
                          channel: email
                          elements:
                            - type: meta
                              title: Welcome!
                            - type: text
                              content: Hello {{data.name}}.
                    state: PUBLISHED
                    created: 1710000000000
                    creator: user_abc
                    updated: 1710000001000
                    updater: user_def
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      summary: Get Notification Template
      security:
        - BearerAuth: []
    put:
      description: Replace a notification template. All fields are required.
      operationId: notifications_replace
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Template ID (nt_ prefix).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationTemplateResponse'
              examples:
                Replaced:
                  value:
                    id: nt_01abc123
                    name: Updated Name
                    tags:
                      - updated
                    brand: null
                    subscription: null
                    routing: null
                    content:
                      version: '2022-01-01'
                      elements:
                        - type: channel
                          channel: email
                          elements:
                            - type: meta
                              title: Updated
                            - type: text
                              content: Updated content.
                    state: PUBLISHED
                    created: 1710000000000
                    creator: user_abc
                    updated: 1710000001000
                    updater: user_def
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                ValidationError:
                  value:
                    type: invalid_request_error
                    message: 'notification.name: Required; notification.content: Required'
                RoutingStrategyNotFound:
                  value:
                    type: invalid_request_error
                    message: Routing strategy rs_nonexistent not found
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      summary: Replace Notification Template
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationTemplateUpdateRequest'
            examples:
              FullReplace:
                summary: Replace all fields
                value:
                  notification:
                    name: Updated Name
                    tags:
                      - updated
                    brand: null
                    subscription: null
                    routing: null
                    content:
                      version: '2022-01-01'
                      elements:
                        - type: channel
                          channel: email
                          elements:
                            - type: meta
                              title: Updated
                            - type: text
                              content: Updated content.
                  state: PUBLISHED
    delete:
      description: Archive a notification template.
      operationId: notifications_archive
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Template ID (nt_ prefix).
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Successfully archived.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      summary: Archive Notification Template
      security:
        - BearerAuth: []
  /notifications/{id}/versions:
    get:
      description: List versions of a notification template.
      operationId: notifications_listVersions
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Template ID (nt_ prefix).
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          description: Opaque pagination cursor from a previous response. Omit for the first page.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Maximum number of versions to return per page. Default 10, max 10.
          required: false
          schema:
            type: integer
            default: 10
            maximum: 10
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationTemplateVersionListResponse'
              examples:
                VersionHistory:
                  value:
                    versions:
                      - version: draft
                        created: 1774037925522
                        creator: user_abc
                        has_changes: true
                      - version: published:v003
                        created: 1774037924446
                        creator: user_abc
                      - version: v002
                        created: 1774037923967
                        creator: user_def
                      - version: v001
                        created: 1774037922000
                        creator: user_def
                    paging:
                      cursor: null
                      more: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                InvalidCursor:
                  value:
                    type: invalid_request_error
                    message: Invalid cursor format
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      summary: List Notification Template Versions
      security:
        - BearerAuth: []
  /notifications/{id}/publish:
    post:
      description: >-
        Publish a notification template. Publishes the current draft by default. Pass a version in the request
        body to publish a specific historical version.
      operationId: notifications_publish
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Template ID (nt_ prefix).
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Successfully published, or already published with no changes (idempotent).
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                InvalidVersion:
                  value:
                    type: invalid_request_error
                    message: 'version: Expected format: v001, v002, etc.'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
                VersionNotFound:
                  value:
                    type: invalid_request_error
                    message: Version not found for template nt_123
      summary: Publish Notification Template
      security:
        - BearerAuth: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationTemplatePublishRequest'
            examples:
              PublishDraft:
                summary: Publish the current draft (default)
                value: {}
              PublishSpecificVersion:
                summary: Publish a specific historical version (rollback)
                value:
                  version: v001
  /notifications/{id}/content:
    get:
      description: >-
        Retrieve the content of a notification template. The response shape depends on whether the template
        uses V1 (blocks/channels) or V2 (elemental) content. Use the `version` query parameter to select
        draft, published, or a specific historical version.
      operationId: notifications_getContent
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Notification template ID (`nt_` prefix).
          required: true
          schema:
            type: string
        - name: version
          in: query
          description: Accepts `draft`, `published`, or a version string (e.g., `v001`). Defaults to `published`.
          required: false
          schema:
            type: string
          examples:
            published:
              value: published
              summary: Current published version (default)
            draft:
              value: draft
              summary: Current draft version
            historical:
              value: v001
              summary: Specific historical version
      responses:
        '200':
          description: Template content retrieved.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/NotificationContentGetResponse'
                  - $ref: '#/components/schemas/NotificationGetContentResponse'
              examples:
                V2Content:
                  summary: V2 elemental content response
                  value:
                    version: '2022-01-01'
                    elements:
                      - id: elem_channel_1
                        type: channel
                        checksum: abc123def456
                        locales:
                          es:
                            checksum: es_abc123
                          fr:
                            checksum: fr_abc123
                        elements:
                          - id: elem_meta_1
                            type: meta
                            checksum: meta_abc123
                          - id: elem_text_1
                            type: text
                            checksum: text_abc123
                V1Content:
                  summary: V1 blocks/channels content response (legacy)
                  value:
                    blocks:
                      - id: block_1
                        type: text
                        content: Hello
                    channels:
                      - id: channel_1
                        type: email
                    checksum: legacy_checksum
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      summary: Get Notification Content
      security:
        - BearerAuth: []
    put:
      description: >-
        Replace the elemental content of a notification template. Overwrites all elements in the template with
        the provided content. Only supported for V2 (elemental) templates.
      operationId: notifications_putContent
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Notification template ID (`nt_` prefix).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Content replaced.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationContentMutationResponse'
              examples:
                ContentUpdated:
                  summary: Content replaced successfully
                  value:
                    id: nt_01abc123
                    version: '2022-01-01'
                    elements:
                      - id: elem_1
                        checksum: abc123
                      - id: elem_2
                        checksum: def456
                    state: DRAFT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                ValidationError:
                  value:
                    type: invalid_request_error
                    message: 'content: Required'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      summary: Put Notification Content
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationContentPutRequest'
            examples:
              ReplaceContent:
                summary: Replace all content elements
                value:
                  content:
                    version: '2022-01-01'
                    elements:
                      - type: channel
                        channel: email
                        elements:
                          - type: meta
                            title: Welcome!
                          - type: text
                            content: Hello {{data.name}}.
                  state: DRAFT
  /notifications/{id}/elements/{elementId}:
    put:
      description: Update a single element within a notification template. Only supported for V2 (elemental) templates.
      operationId: notifications_putElement
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Notification template ID (`nt_` prefix).
          required: true
          schema:
            type: string
        - name: elementId
          in: path
          description: Element ID within the template.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Element updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationContentMutationResponse'
              examples:
                ElementUpdated:
                  summary: Element updated successfully
                  value:
                    id: nt_01abc123
                    version: '2022-01-01'
                    elements:
                      - id: elem_1
                        checksum: abc123
                      - id: elem_2
                        checksum: def456
                    state: DRAFT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                ValidationError:
                  value:
                    type: invalid_request_error
                    message: 'type: Required'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
                ElementNotFound:
                  value:
                    type: invalid_request_error
                    message: Element elem_nonexistent not found in template nt_01abc123
      summary: Put Notification Element
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationElementPutRequest'
            examples:
              UpdateTextElement:
                summary: Update a text element
                value:
                  type: text
                  data:
                    content: Updated text content
                  state: DRAFT
  /notifications/{id}/locales/{localeId}:
    put:
      description: >-
        Set locale-specific content overrides for a notification template. Each element override must
        reference an existing element by ID. Only supported for V2 (elemental) templates.
      operationId: notifications_putLocale
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Notification template ID (`nt_` prefix).
          required: true
          schema:
            type: string
        - name: localeId
          in: path
          description: Locale code (e.g., `es`, `fr`, `pt-BR`).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Locale overrides applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationContentMutationResponse'
              examples:
                LocaleUpdated:
                  summary: Locale content set successfully
                  value:
                    id: nt_01abc123
                    version: '2022-01-01'
                    elements:
                      - id: elem_1
                        checksum: abc123
                      - id: elem_2
                        checksum: def456
                    state: DRAFT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                ValidationError:
                  value:
                    type: invalid_request_error
                    message: 'elements: Required'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Notification template nt_nonexistent not found
      summary: Put Notification Locale
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationLocalePutRequest'
            examples:
              SetSpanishLocale:
                summary: Set Spanish locale overrides
                value:
                  elements:
                    - id: elem_1
                      content: Hola {{data.name}}.
                    - id: elem_2
                      title: Bienvenido!
                  state: DRAFT
  /notifications/{id}/{submissionId}/checks:
    get:
      description: Retrieve the checks for a notification template submission.
      operationId: notifications_getSubmissionChecks
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Notification template ID.
          required: true
          schema:
            type: string
        - name: submissionId
          in: path
          description: Submission ID.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Submission checks retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmissionChecksGetResponse'
      summary: Get Submission Checks
      security:
        - BearerAuth: []
    put:
      description: Replace the checks for a notification template submission.
      operationId: notifications_replaceSubmissionChecks
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Notification template ID.
          required: true
          schema:
            type: string
        - name: submissionId
          in: path
          description: Submission ID.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Submission checks replaced.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmissionChecksReplaceResponse'
      summary: Replace Submission Checks
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                checks:
                  type: array
                  items:
                    $ref: '#/components/schemas/BaseCheck'
              required:
                - checks
    delete:
      description: Cancel a notification template submission.
      operationId: notifications_cancelSubmission
      tags:
        - Notification Templates
      parameters:
        - name: id
          in: path
          description: Notification template ID.
          required: true
          schema:
            type: string
        - name: submissionId
          in: path
          description: Submission ID.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Submission cancelled.
      summary: Cancel Submission
      security:
        - BearerAuth: []
  /auth/issue-token:
    post:
      description: Returns a new access token.
      operationId: authTokens_issueToken
      tags:
        - Authentication
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IssueTokenResponse'
      summary: Create a JWT
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                scope:
                  type: string
                  description: >-
                    Available scopes:

                    - `user_id:<user-id>` - Defines which user the token will be scoped to. Multiple can be
                    listed if needed. Ex `user_id:pigeon user_id:bluebird`.

                    - `read:messages` - Read messages.

                    - `read:user-tokens` - Read user push tokens.

                    - `write:user-tokens` - Write user push tokens.

                    - `read:brands[:<brand_id>]` - Read brands, optionally restricted to a specific brand_id.
                    Examples `read:brands`, `read:brands:my_brand`.

                    - `write:brands[:<brand_id>]` - Write brands, optionally restricted to a specific
                    brand_id. Examples `write:brands`, `write:brands:my_brand`.

                    - `inbox:read:messages` - Read inbox messages.

                    - `inbox:write:events` - Write inbox events, such as mark message as read.

                    - `read:preferences` - Read user preferences.

                    - `write:preferences` - Write user preferences.

                    Example: `user_id:user123 write:user-tokens inbox:read:messages inbox:write:events
                    read:preferences write:preferences read:brands`
                expires_in:
                  type: string
                  description: |-
                    Duration for token expiration. Accepts various time formats:
                    - "2 hours" - 2 hours from now
                    - "1d" - 1 day
                    - "3 days" - 3 days
                    - "10h" - 10 hours
                    - "2.5 hrs" - 2.5 hours
                    - "1m" - 1 minute
                    - "5s" - 5 seconds
                    - "1y" - 1 year
              required:
                - scope
                - expires_in
            examples:
              InboxExample:
                value:
                  scope: >-
                    user_id:$YOUR_USER_ID write:user-tokens inbox:read:messages inbox:write:events
                    read:preferences write:preferences read:brands
                  expires_in: $YOUR_NUMBER days
  /tenants/{tenant_id}:
    get:
      operationId: tenants_get
      tags:
        - Tenants
      parameters:
        - name: tenant_id
          in: path
          description: A unique identifier representing the tenant to be returned.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tenant'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get a Tenant
      security:
        - BearerAuth: []
    put:
      operationId: tenants_createOrReplace
      tags:
        - Tenants
      parameters:
        - name: tenant_id
          in: path
          description: A unique identifier representing the tenant to be returned.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tenant'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Create or Replace a Tenant
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the tenant.
                parent_tenant_id:
                  type: string
                  nullable: true
                  description: Tenant's parent id (if any).
                default_preferences:
                  $ref: '#/components/schemas/DefaultPreferences'
                  nullable: true
                  description: Defines the preferences used for the tenant when the user hasn't specified their own.
                properties:
                  type: object
                  additionalProperties: true
                  nullable: true
                  description: Arbitrary properties accessible to a template.
                user_profile:
                  type: object
                  additionalProperties: true
                  nullable: true
                  description: A user profile object merged with user profile on send.
                brand_id:
                  type: string
                  nullable: true
                  description: Brand to be used for the account when one is not specified by the send call.
              required:
                - name
    delete:
      operationId: tenants_delete
      tags:
        - Tenants
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant to be deleted.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Delete a Tenant
      security:
        - BearerAuth: []
  /tenants:
    get:
      operationId: tenants_list
      tags:
        - Tenants
      parameters:
        - name: parent_tenant_id
          in: query
          description: Filter the list of tenants by parent_id
          required: false
          schema:
            type: string
            nullable: true
        - name: limit
          in: query
          description: |-
            The number of tenants to return 
            (defaults to 20, maximum value of 100)
          required: false
          schema:
            type: integer
            nullable: true
        - name: cursor
          in: query
          description: Continue the pagination with the next cursor
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantListResponse'
      summary: Get a List of Tenants
      security:
        - BearerAuth: []
  /tenants/{tenant_id}/users:
    get:
      operationId: tenants_getUsersByTenant
      tags:
        - Tenants
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant for user membership.
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: |-
            The number of accounts to return 
            (defaults to 20, maximum value of 100)
          required: false
          schema:
            type: integer
            nullable: true
        - name: cursor
          in: query
          description: Continue the pagination with the next cursor
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListUsersForTenantResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get Users in Tenant
      security:
        - BearerAuth: []
  /tenants/{tenant_id}/default_preferences/items/{topic_id}:
    put:
      operationId: tenants_createOrReplaceDefaultPreferencesForTopic
      tags:
        - Tenants
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant to update the default preferences for.
          required: true
          schema:
            type: string
          examples:
            Example1:
              value: tenantABC
        - name: topic_id
          in: path
          description: Id of the subscription topic you want to have a default preference for.
          required: true
          schema:
            type: string
          examples:
            Example1:
              value: HB529N49MD4D5PMX9WR5P4JH78NA
      responses:
        '204':
          description: ''
      summary: Create or Replace Default Preferences For Topic
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionTopicNew'
            examples:
              Example1:
                value:
                  status: OPTED_IN
                  has_custom_routing: true
                  custom_routing:
                    - inbox
    delete:
      operationId: tenants_removeDefaultPreferencesForTopic
      tags:
        - Tenants
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant to update the default preferences for.
          required: true
          schema:
            type: string
        - name: topic_id
          in: path
          description: Id of the subscription topic you want to have a default preference for.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Remove Default Preferences For Topic
      security:
        - BearerAuth: []
  /users/{user_id}/tenants:
    get:
      description: Returns a paginated list of user tenant associations.
      operationId: users_tenants_list
      tags:
        - User Tenants
      parameters:
        - name: user_id
          in: path
          description: Id of the user to retrieve all associated tenants for.
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: |-
            The number of accounts to return 
            (defaults to 20, maximum value of 100)
          required: false
          schema:
            type: integer
            nullable: true
        - name: cursor
          in: query
          description: Continue the pagination with the next cursor
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersListTenantsForUserResponse'
      summary: Get tenants associated with a given user
      security:
        - BearerAuth: []
    put:
      description: |-
        This endpoint is used to add a user to
        multiple tenants in one call.
        A custom profile can also be supplied for each tenant. 
        This profile will be merged with the user's main 
        profile when sending to the user with that tenant.
      operationId: users_tenants_addMultiple
      tags:
        - User Tenants
      parameters:
        - name: user_id
          in: path
          description: The user's ID. This can be any uniquely identifiable string.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Add a User to Multiple Tenants
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tenants:
                  type: array
                  items:
                    $ref: '#/components/schemas/UserTenantAssociation'
              required:
                - tenants
    delete:
      description: Removes a user from any tenants they may have been associated with.
      operationId: users_tenants_removeAll
      tags:
        - User Tenants
      parameters:
        - name: user_id
          in: path
          description: Id of the user to be removed from the supplied tenant.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Remove User From All Associated Tenants
      security:
        - BearerAuth: []
  /users/{user_id}/tenants/{tenant_id}:
    put:
      description: |-
        This endpoint is used to add a single tenant.

        A custom profile can also be supplied with the tenant. 
        This profile will be merged with the user's main profile 
        when sending to the user with that tenant.
      operationId: users_tenants_add
      tags:
        - User Tenants
      parameters:
        - name: user_id
          in: path
          description: Id of the user to be added to the supplied tenant.
          required: true
          schema:
            type: string
        - name: tenant_id
          in: path
          description: Id of the tenant the user should be added to.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Add a User to a Single Tenant
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                profile:
                  type: object
                  additionalProperties: true
                  nullable: true
    delete:
      description: Removes a user from the supplied tenant.
      operationId: users_tenants_remove
      tags:
        - User Tenants
      parameters:
        - name: user_id
          in: path
          description: Id of the user to be removed from the supplied tenant.
          required: true
          schema:
            type: string
        - name: tenant_id
          in: path
          description: Id of the tenant the user should be removed from.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Remove User from a Tenant
      security:
        - BearerAuth: []
  /users/{user_id}/preferences:
    get:
      description: Fetch all user preferences.
      operationId: users_preferences_list
      tags:
        - User Preferences
      parameters:
        - name: user_id
          in: path
          description: A unique identifier associated with the user whose preferences you wish to retrieve.
          required: true
          schema:
            type: string
        - name: tenant_id
          in: query
          description: Query the preferences of a user for this specific tenant context.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersUserPreferencesListResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get user's preferences
      security:
        - BearerAuth: []
  /users/{user_id}/preferences/{topic_id}:
    get:
      description: Fetch user preferences for a specific subscription topic.
      operationId: users_preferences_get
      tags:
        - User Preferences
      parameters:
        - name: user_id
          in: path
          description: A unique identifier associated with the user whose preferences you wish to retrieve.
          required: true
          schema:
            type: string
        - name: topic_id
          in: path
          description: A unique identifier associated with a subscription topic.
          required: true
          schema:
            type: string
        - name: tenant_id
          in: query
          description: Query the preferences of a user for this specific tenant context.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersUserPreferencesGetResponse'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Get user subscription topic
      security:
        - BearerAuth: []
    put:
      description: Update or Create user preferences for a specific subscription topic.
      operationId: users_preferences_update
      tags:
        - User Preferences
      parameters:
        - name: user_id
          in: path
          description: A unique identifier associated with the user whose preferences you wish to retrieve.
          required: true
          schema:
            type: string
          examples:
            Example1:
              value: abc-123
        - name: topic_id
          in: path
          description: A unique identifier associated with a subscription topic.
          required: true
          schema:
            type: string
          examples:
            Example1:
              value: 74Q4QGFBEX481DP6JRPMV751H4XT
        - name: tenant_id
          in: query
          description: Update the preferences of a user for this specific tenant context.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersUserPreferencesUpdateResponse'
              examples:
                Example1:
                  value:
                    message: success
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Update or Create user preferences for a specific subscription topic
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                topic:
                  $ref: '#/components/schemas/UsersTopicPreferenceUpdate'
              required:
                - topic
            examples:
              Example1:
                value:
                  topic:
                    status: OPTED_IN
                    has_custom_routing: true
                    custom_routing:
                      - inbox
                      - email
  /users/{user_id}/tokens:
    get:
      description: Gets all tokens available for a :user_id
      operationId: users_tokens_list
      tags:
        - Device Tokens
      parameters:
        - name: user_id
          in: path
          description: The user's ID. This can be any uniquely identifiable string.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersGetAllTokensResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get all tokens
      security:
        - BearerAuth: []
    put:
      description: Adds multiple tokens to a user and overwrites matching existing tokens.
      operationId: users_tokens_addMultiple
      tags:
        - Device Tokens
      parameters:
        - name: user_id
          in: path
          description: The user's ID. This can be any uniquely identifiable string.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Add multiple tokens to user
      security:
        - BearerAuth: []
  /users/{user_id}/tokens/{token}:
    get:
      description: Get single token available for a `:token`
      operationId: users_tokens_get
      tags:
        - Device Tokens
      parameters:
        - name: user_id
          in: path
          description: The user's ID. This can be any uniquely identifiable string.
          required: true
          schema:
            type: string
        - name: token
          in: path
          description: The full token string.
          required: true
          schema:
            type: string
          x-stainless-param: token_id
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersGetUserTokenResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get single token
      security:
        - BearerAuth: []
    put:
      description: Adds a single token to a user and overwrites a matching existing token.
      operationId: users_tokens_add
      tags:
        - Device Tokens
      parameters:
        - name: user_id
          in: path
          description: The user's ID. This can be any uniquely identifiable string.
          required: true
          schema:
            type: string
        - name: token
          in: path
          description: The full token string.
          required: true
          schema:
            type: string
          x-stainless-param: token_id
      responses:
        '204':
          description: ''
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Add single token to user
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UsersAddSingleTokenBody'
    patch:
      description: Apply a JSON Patch (RFC 6902) to the specified token.
      operationId: users_tokens_update
      tags:
        - Device Tokens
      parameters:
        - name: user_id
          in: path
          description: The user's ID. This can be any uniquely identifiable string.
          required: true
          schema:
            type: string
        - name: token
          in: path
          description: The full token string.
          required: true
          schema:
            type: string
          x-stainless-param: token_id
      responses:
        '204':
          description: ''
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Update a token
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UsersPatchUserTokenOpts'
    delete:
      operationId: users_tokens_delete
      tags:
        - Device Tokens
      parameters:
        - name: user_id
          in: path
          description: The user's ID. This can be any uniquely identifiable string.
          required: true
          schema:
            type: string
        - name: token
          in: path
          description: The full token string.
          required: true
          schema:
            type: string
          x-stainless-param: token_id
      responses:
        '204':
          description: ''
      summary: Delete User Token
      security:
        - BearerAuth: []
  /automations:
    get:
      description: Get the list of automations.
      operationId: automations_list
      tags:
        - Automations
      parameters:
        - name: cursor
          in: query
          description: >-
            A cursor token for pagination. Use the cursor from the previous response to fetch the next page of
            results.
          required: false
          schema:
            type: string
        - name: version
          in: query
          description: >-
            The version of templates to retrieve. Accepted values are published (for published templates) or
            draft (for draft templates). Defaults to published.
          required: false
          schema:
            type: string
            enum:
              - published
              - draft
            default: published
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationTemplateListResponse'
              examples:
                Example1:
                  value:
                    templates:
                      - name: Welcome Email Automation
                        id: abc-123-def-456
                        version: published
                        createdAt: '2024-01-01T00:00:00Z'
                        updatedAt: '2024-01-02T00:00:00Z'
                      - name: Order Confirmation
                        id: xyz-789-ghi-012
                        version: published
                        createdAt: '2024-01-03T00:00:00Z'
                        updatedAt: '2024-01-04T00:00:00Z'
                    cursor: eyJpZCI6InRlbXBsYXRlLTIifQ==
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              examples:
                InvalidVersion:
                  value:
                    message: >-
                      Invalid version parameter "invalid". Accepted values are: published (for published
                      templates) or draft (for draft templates)
                InvalidCursor:
                  value:
                    message: Invalid cursor format
      summary: List Automations
      security:
        - BearerAuth: []
  /automations/{templateId}/invoke:
    post:
      description: Invoke an automation run from an automation template.
      operationId: automations_invokeAutomationTemplate
      tags:
        - Automations
      parameters:
        - name: templateId
          in: path
          description: >-
            A unique identifier representing the automation template to be invoked. This could be the
            Automation Template ID or the Automation Template Alias.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationInvokeResponse'
      summary: Invoke an Automation
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationInvokeParams'
  /automations/invoke:
    post:
      description: >-
        Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a series of automation
        steps. For information about what steps are available, checkout the ad hoc automation guide
        [here](https://www.courier.com/docs/automations/steps/).
      operationId: automations_invokeAdHocAutomation
      tags:
        - Automations
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationInvokeResponse'
              examples:
                Example1:
                  value:
                    runId: 1-65f240a0-47a6a120c8374de9bcf9f22c
      summary: Invoke an Ad Hoc Automation
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationAdHocInvokeParams'
            examples:
              Example1:
                value:
                  data:
                    name: Foo
                  profile:
                    tenant_id: abc-123
                  recipient: user-yes
                  automation:
                    cancelation_token: delay-send--user-yes--abc-123
                    steps:
                      - action: delay
                        until: 20240408T080910.123
                      - action: send
                        template: 64TP5HKPFTM8VTK1Y75SJDQX9JK0
  /journeys:
    get:
      description: Get the list of journeys.
      operationId: journeys_list
      tags:
        - Journeys
      parameters:
        - name: cursor
          in: query
          description: >-
            A cursor token for pagination. Use the cursor from the previous response to fetch the next page of
            results.
          required: false
          schema:
            type: string
        - name: version
          in: query
          description: >-
            The version of journeys to retrieve. Accepted values are published (for published journeys) or
            draft (for draft journeys). Defaults to published.
          required: false
          schema:
            type: string
            enum:
              - published
              - draft
            default: published
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JourneysListResponse'
              examples:
                Example1:
                  value:
                    templates:
                      - name: Welcome Journey
                        id: abc-123-def-456
                        version: published
                        createdAt: '2024-01-01T00:00:00Z'
                        updatedAt: '2024-01-02T00:00:00Z'
                      - name: Onboarding Flow
                        id: xyz-789-ghi-012
                        version: published
                        createdAt: '2024-01-03T00:00:00Z'
                        updatedAt: '2024-01-04T00:00:00Z'
                    cursor: eyJpZCI6InRlbXBsYXRlLTIifQ==
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                InvalidVersion:
                  value:
                    type: invalid_request_error
                    message: >-
                      Invalid version parameter "invalid". Accepted values are: published (for published
                      templates) or draft (for draft templates)
                InvalidCursor:
                  value:
                    type: invalid_request_error
                    message: Invalid cursor format
      summary: List Journeys
      security:
        - BearerAuth: []
  /journeys/{templateId}/invoke:
    post:
      description: Invoke a journey run from a journey template.
      operationId: journeys_invoke
      tags:
        - Journeys
      parameters:
        - name: templateId
          in: path
          description: >-
            A unique identifier representing the journey template to be invoked. This could be the Journey
            Template ID or the Journey Template Alias.
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Journey invocation accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JourneysInvokeResponse'
              examples:
                Example1:
                  value:
                    runId: 1-65f240a0-47a6a120c8374de9bcf9f22c
        '400':
          description: Bad Request - validation error, invalid version, or missing recipient
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                MissingTemplateId:
                  value:
                    type: invalid_request_error
                    message: templateId is required
                MissingRecipient:
                  value:
                    type: invalid_request_error
                    message: >-
                      User identifier or profile required. Provide user_id, user_id/userId/anonymousId in
                      profile/data, or profile with contact info.
                InvalidVersion:
                  value:
                    type: invalid_request_error
                    message: Invalid automation version. Expected 2025-09-03, got 2022-12-01
        '404':
          description: Journey template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                TemplateNotFound:
                  value:
                    type: invalid_request_error
                    message: Automation template abc-123 not found
        '422':
          description: Unprocessable Entity - trigger conditions failed, template archived or disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntity'
              examples:
                TriggerConditionFailed:
                  value:
                    type: invalid_request_error
                    message: Trigger conditions not met
                ArchivedTemplate:
                  value:
                    type: invalid_request_error
                    message: Cannot invoke archived automation template abc-123
                DisabledTemplate:
                  value:
                    type: invalid_request_error
                    message: Cannot invoke disabled automation template abc-123
      summary: Invoke a Journey
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JourneysInvokeRequest'
            examples:
              WithUserId:
                summary: Invoke with user_id
                value:
                  user_id: user-123
                  data:
                    order_id: order-456
                    amount: 99.99
              WithProfile:
                summary: Invoke with profile containing contact info
                value:
                  profile:
                    email: user@example.com
                    first_name: John
                  data:
                    welcome_message: Hello!
              WithUserIdInProfile:
                summary: Invoke with user_id in profile
                value:
                  profile:
                    user_id: user-123
                    email: user@example.com
                  data:
                    foo: bar
              WithTenantScopedProfile:
                summary: Invoke with tenant-scoped profile
                description: Load a user's profile scoped to a specific tenant
                value:
                  user_id: doctor-smith
                  profile:
                    context:
                      tenant_id: hospital-a
                  data:
                    report_date: '2024-01-15'
  /brands:
    post:
      operationId: brands_create
      tags:
        - Brands
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Brand'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '402':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequired'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlreadyExists'
      summary: Create a new brand
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrandParameters'
    get:
      description: Get the list of brands.
      operationId: brands_list
      tags:
        - Brands
      parameters:
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next set of brands.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandsResponse'
      summary: List brands
      security:
        - BearerAuth: []
  /brands/{brand_id}:
    get:
      description: Fetch a specific brand by brand ID.
      operationId: brands_get
      tags:
        - Brands
      parameters:
        - name: brand_id
          in: path
          description: A unique identifier associated with the brand you wish to retrieve.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Brand'
      summary: Get a brand
      security:
        - BearerAuth: []
    put:
      description: Replace an existing brand with the supplied values.
      operationId: brands_replace
      tags:
        - Brands
      parameters:
        - name: brand_id
          in: path
          description: A unique identifier associated with the brand you wish to update.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Brand'
      summary: Replace a brand
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the brand.
                settings:
                  $ref: '#/components/schemas/BrandSettings'
                  nullable: true
                snippets:
                  $ref: '#/components/schemas/BrandSnippets'
                  nullable: true
              required:
                - name
    delete:
      description: Delete a brand by brand ID.
      operationId: brands_delete
      tags:
        - Brands
      parameters:
        - name: brand_id
          in: path
          description: A unique identifier associated with the brand you wish to retrieve.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conflict'
      summary: Delete a brand
      security:
        - BearerAuth: []
  /inbound/courier:
    post:
      operationId: inbound_track
      tags:
        - Inbound
      parameters: []
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackAcceptedResponse'
              examples:
                Example1:
                  value:
                    messageId: 1-6952feeb-7fed6092da5363f2af38eb42
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conflict'
      summary: Courier Track Event
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboundTrackEvent'
            examples:
              Example1:
                value:
                  event: New Order Placed
                  messageId: 4c62c457-b329-4bea-9bfc-17bba86c393f
                  userId: '1234'
                  type: track
                  properties:
                    order_id: 123
                    total_orders: 5
                    last_order_id: 122
  /translations/{domain}/{locale}:
    get:
      description: Get translations by locale
      operationId: translations_get
      tags:
        - Translations
      parameters:
        - name: domain
          in: path
          description: The domain you want to retrieve translations for. Only `default` is supported at the moment
          required: true
          schema:
            type: string
        - name: locale
          in: path
          description: The locale you want to retrieve the translations for
          required: true
          schema:
            type: string
      responses:
        '200':
          description: .po file translation content
          content:
            application/json:
              schema:
                type: string
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Get a translation
      security:
        - BearerAuth: []
    put:
      description: Update a translation
      operationId: translations_update
      tags:
        - Translations
      parameters:
        - name: domain
          in: path
          description: The domain you want to retrieve translations for. Only `default` is supported at the moment
          required: true
          schema:
            type: string
        - name: locale
          in: path
          description: The locale you want to retrieve the translations for
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Update translations by locale
      security:
        - BearerAuth: []
      requestBody:
        description: .po file translation content
        required: true
        content:
          application/json:
            schema:
              type: string
  /tenants/{tenant_id}/templates/{template_id}:
    get:
      operationId: tenants_getTemplateByTenant
      tags:
        - Courier Create
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant for which to retrieve the template.
          required: true
          schema:
            type: string
        - name: template_id
          in: path
          description: Id of the template to be retrieved.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTemplateByTenantResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get a Template in Tenant
      security:
        - BearerAuth: []
    put:
      operationId: tenants_replaceTemplate
      tags:
        - Courier Create
      description: |
        Creates or updates a notification template for a tenant.

        If the template already exists for the tenant, it will be updated (200).
        Otherwise, a new template is created (201).

        Optionally publishes the template immediately if the `published` flag is set to true.
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant for which to create or update the template.
          required: true
          schema:
            type: string
        - name: template_id
          in: path
          description: Id of the template to be created or updated.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Template updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutTenantTemplateResponse'
        '201':
          description: Template created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutTenantTemplateResponse'
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: Tenant not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '413':
          description: Payload too large - template size exceeds maximum allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayloadTooLarge'
      summary: Create or Update a Tenant Template
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutTenantTemplateRequest'
  /tenants/{tenant_id}/templates/{template_id}/publish:
    post:
      operationId: tenants_publishTemplate
      tags:
        - Courier Create
      description: |
        Publishes a specific version of a notification template for a tenant.

        The template must already exist in the tenant's notification map.
        If no version is specified, defaults to publishing the "latest" version.
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant that owns the template.
          required: true
          schema:
            type: string
        - name: template_id
          in: path
          description: Id of the template to be published.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Template published successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostTenantTemplatePublishResponse'
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: Template or tenant not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Publish a Tenant Template
      security:
        - BearerAuth: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostTenantTemplatePublishRequest'
  /tenants/{tenant_id}/templates/{template_id}/versions/{version}:
    get:
      operationId: tenants_getTemplateVersion
      tags:
        - Courier Create
      description: |
        Fetches a specific version of a tenant template.

        Supports the following version formats:
        - `latest` - The most recent version of the template
        - `published` - The currently published version
        - `v{version}` - A specific version (e.g., "v1", "v2", "v1.0.0")
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant for which to retrieve the template.
          required: true
          schema:
            type: string
        - name: template_id
          in: path
          description: Id of the template to be retrieved.
          required: true
          schema:
            type: string
        - name: version
          in: path
          description: >-
            Version of the template to retrieve. Accepts "latest", "published", or a specific version string
            (e.g., "v1", "v2").
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTemplateByTenantResponse'
        '400':
          description: Bad request - invalid version format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: Template, version, or tenant not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Get a Specific Template Version
      security:
        - BearerAuth: []
  /tenants/{tenant_id}/templates:
    get:
      operationId: tenants_getTemplateListByTenant
      tags:
        - Courier Create
      parameters:
        - name: tenant_id
          in: path
          description: Id of the tenant for which to retrieve the templates.
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: The number of templates to return (defaults to 20, maximum value of 100)
          required: false
          schema:
            type: integer
            nullable: true
        - name: cursor
          in: query
          description: Continue the pagination with the next cursor
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTemplatesByTenantResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: List Templates in Tenant
      security:
        - BearerAuth: []
  /bulk:
    post:
      operationId: bulk_createJob
      tags:
        - Bulk
      description: >
        Creates a new bulk job for sending messages to multiple recipients.


        **Required**: `message.event` (event ID or notification ID)


        **Optional (V2 format)**: `message.template` (notification ID) or `message.content` (Elemental
        content) 

        can be provided to override the notification associated with the event.
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkCreateJobResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Create a bulk job
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  $ref: '#/components/schemas/InboundBulkMessage'
              required:
                - message
  /bulk/{job_id}:
    post:
      description: |
        Ingest user data into a Bulk Job. 

        **Important**: For email-based bulk jobs, each user must include `profile.email` 
        for provider routing to work correctly. The `to.email` field is not sufficient 
        for email provider routing.
      operationId: bulk_ingestUsers
      tags:
        - Bulk
      parameters:
        - name: job_id
          in: path
          description: A unique identifier representing the bulk job
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      summary: Add users
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkIngestUsersParams'
    get:
      description: Get a bulk job
      operationId: bulk_getJob
      tags:
        - Bulk
      parameters:
        - name: job_id
          in: path
          description: A unique identifier representing the bulk job
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkGetJobResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get a Job
      security:
        - BearerAuth: []
  /bulk/{job_id}/run:
    post:
      description: Run a bulk job
      operationId: bulk_runJob
      tags:
        - Bulk
      parameters:
        - name: job_id
          in: path
          description: A unique identifier representing the bulk job
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Run a job
      security:
        - BearerAuth: []
  /bulk/{job_id}/users:
    get:
      description: Get Bulk Job Users
      operationId: bulk_getUsers
      tags:
        - Bulk
      parameters:
        - name: job_id
          in: path
          description: A unique identifier representing the bulk job
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next set of users added to the bulk job
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkGetJobUsersResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Get users
      security:
        - BearerAuth: []
  /audit-events:
    get:
      description: Fetch the list of audit events
      operationId: auditEvents_list
      tags:
        - Audit Events
      parameters:
        - name: cursor
          in: query
          description: A unique identifier that allows for fetching the next set of audit events.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAuditEventsResponse'
      summary: Get all audit events
      security:
        - BearerAuth: []
  /audit-events/{audit-event-id}:
    get:
      description: Fetch a specific audit event by ID.
      operationId: auditEvents_get
      tags:
        - Audit Events
      parameters:
        - name: audit-event-id
          in: path
          description: A unique identifier associated with the audit event you wish to retrieve
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditEvent'
      summary: Get an audit event
      security:
        - BearerAuth: []
  /routing-strategies:
    get:
      description: >-
        List routing strategies in your workspace. Returns metadata only (no routing/channels/providers
        content). Use GET /routing-strategies/{id} for full details.
      operationId: routingStrategies_list
      tags:
        - Routing Strategies
      parameters:
        - name: cursor
          in: query
          description: Opaque pagination cursor from a previous response. Omit for the first page.
          required: false
          schema:
            type: string
            nullable: true
        - name: limit
          in: query
          description: Maximum number of results per page. Default 20, max 100.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingStrategyListResponse'
              examples:
                WithResults:
                  value:
                    results:
                      - id: rs_01abc123
                        name: Email via SendGrid
                        description: Routes email through sendgrid with SES failover
                        tags:
                          - production
                          - email
                        created: 1710000000000
                        creator: user_abc
                        updated: 1710000000000
                        updater: user_def
                    paging:
                      cursor: eyJway...
                      more: true
                Empty:
                  value:
                    results: []
                    paging:
                      cursor: null
                      more: false
      summary: List Routing Strategies
      security:
        - BearerAuth: []
    post:
      description: >-
        Create a routing strategy. Requires a name and routing configuration at minimum. Channels and
        providers default to empty if omitted.
      operationId: routingStrategies_create
      tags:
        - Routing Strategies
      parameters: []
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingStrategyGetResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                ValidationError:
                  value:
                    type: invalid_request_error
                    message: 'name: Required; routing: Required'
      summary: Create Routing Strategy
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoutingStrategyCreateRequest'
            examples:
              FullExample:
                summary: Create a routing strategy with all fields
                value:
                  name: Email via SendGrid
                  description: Routes email through sendgrid with SES failover
                  tags:
                    - production
                    - email
                  routing:
                    method: single
                    channels:
                      - email
                  channels:
                    email:
                      providers:
                        - sendgrid
                        - ses
                  providers:
                    sendgrid:
                      override: {}
              Minimal:
                summary: Create a minimal routing strategy
                value:
                  name: Simple Email
                  routing:
                    method: single
                    channels:
                      - email
  /routing-strategies/{id}:
    get:
      description: Retrieve a routing strategy by ID. Returns the full entity including routing content and metadata.
      operationId: routingStrategies_retrieve
      tags:
        - Routing Strategies
      parameters:
        - name: id
          in: path
          description: Routing strategy ID (rs_ prefix).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingStrategyGetResponse'
              examples:
                FullStrategy:
                  value:
                    id: rs_01abc123
                    name: Email via SendGrid
                    description: Routes email through sendgrid with SES failover
                    tags:
                      - production
                      - email
                    routing:
                      method: single
                      channels:
                        - email
                    channels:
                      email:
                        providers:
                          - sendgrid
                          - ses
                    providers:
                      sendgrid:
                        override: {}
                    created: 1710000000000
                    creator: user_abc
                    updated: 1710000000000
                    updater: user_def
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                StrategyNotFound:
                  value:
                    type: invalid_request_error
                    message: Routing strategy rs_nonexistent not found
      summary: Get Routing Strategy
      security:
        - BearerAuth: []
    put:
      description: >-
        Replace a routing strategy. Full document replacement; the caller must send the complete desired
        state. Missing optional fields are cleared.
      operationId: routingStrategies_replace
      tags:
        - Routing Strategies
      parameters:
        - name: id
          in: path
          description: Routing strategy ID (rs_ prefix).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingStrategyGetResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                ValidationError:
                  value:
                    type: invalid_request_error
                    message: 'name: Required; routing: Required'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                StrategyNotFound:
                  value:
                    type: invalid_request_error
                    message: Routing strategy rs_nonexistent not found
      summary: Replace Routing Strategy
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoutingStrategyReplaceRequest'
            examples:
              FullReplace:
                summary: Replace all fields
                value:
                  name: Email via SendGrid v2
                  description: Updated routing with SES primary
                  tags:
                    - production
                    - email
                    - v2
                  routing:
                    method: single
                    channels:
                      - email
                  channels:
                    email:
                      providers:
                        - ses
                        - sendgrid
                  providers:
                    ses:
                      override: {}
    delete:
      description: >-
        Archive a routing strategy. The strategy must not have associated notification templates. Unlink all
        templates before archiving.
      operationId: routingStrategies_archive
      tags:
        - Routing Strategies
      parameters:
        - name: id
          in: path
          description: Routing strategy ID (rs_ prefix).
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Successfully archived.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                StrategyNotFound:
                  value:
                    type: invalid_request_error
                    message: Routing strategy rs_nonexistent not found
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conflict'
              examples:
                HasAssociatedTemplates:
                  value:
                    type: invalid_request_error
                    message: Routing strategy rs_01abc123 has associated templates and cannot be archived
      summary: Archive Routing Strategy
      security:
        - BearerAuth: []
  /routing-strategies/{id}/notifications:
    get:
      description: >-
        List notification templates associated with a routing strategy. Includes template metadata only, not
        full content.
      operationId: routingStrategies_listNotifications
      tags:
        - Routing Strategies
      parameters:
        - name: id
          in: path
          description: Routing strategy ID (`rs_` prefix).
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          description: Opaque pagination cursor from a previous response. Omit for the first page.
          required: false
          schema:
            type: string
            nullable: true
        - name: limit
          in: query
          description: Maximum number of results per page. Default 20, max 100.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: Associated notification templates retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssociatedNotificationListResponse'
              examples:
                WithResults:
                  value:
                    results:
                      - id: nt_01abc123
                        name: Welcome Email
                        tags:
                          - onboarding
                        state: PUBLISHED
                        created: 1710000000000
                        creator: user_abc
                        updated: 1710000000000
                        updater: user_def
                    paging:
                      cursor: eyJway...
                      more: true
                Empty:
                  value:
                    results: []
                    paging:
                      more: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                StrategyNotFound:
                  value:
                    type: invalid_request_error
                    message: Routing strategy rs_nonexistent not found
      summary: List Associated Notifications
      security:
        - BearerAuth: []
  /providers:
    get:
      description: List configured provider integrations for the current workspace. Supports cursor-based pagination.
      operationId: providers_list
      tags:
        - Providers
      parameters:
        - name: cursor
          in: query
          description: Opaque cursor for fetching the next page.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidersListResponse'
      summary: List providers
      security:
        - BearerAuth: []
    post:
      description: >-
        Create a new provider configuration. The `provider` field must be a known Courier provider key (see
        catalog).
      operationId: providers_create
      tags:
        - Providers
      parameters: []
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
      summary: Create a provider
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvidersCreateRequest'
  /providers/catalog:
    get:
      description: >-
        Returns the catalog of available provider types with their display names, descriptions, and
        configuration schema fields (snake_case, with `type` and `required`). Providers with no configurable
        schema return only `provider`, `name`, and `description`.
      operationId: providers_catalog
      tags:
        - Providers
      parameters:
        - name: keys
          in: query
          description: Comma-separated provider keys to filter by (e.g. `sendgrid,twilio`).
          required: false
          schema:
            type: string
        - name: name
          in: query
          description: Case-insensitive substring match against the provider display name.
          required: false
          schema:
            type: string
        - name: channel
          in: query
          description: >-
            Exact match (case-insensitive) against the provider channel taxonomy (e.g. `email`, `sms`,
            `push`).
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidersCatalogResponse'
      summary: List available provider types
      security:
        - BearerAuth: []
  /providers/{id}:
    get:
      description: Fetch a single provider configuration by ID.
      operationId: providers_retrieve
      tags:
        - Providers
      parameters:
        - name: id
          in: path
          description: A unique identifier of the provider configuration.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Get a provider
      security:
        - BearerAuth: []
    put:
      description: >-
        Replace an existing provider configuration. The `provider` key is required and determines which
        provider-specific settings schema is applied. All other fields are optional — omitted fields are
        cleared from the stored configuration (this is a full replacement, not a partial merge). Changing the
        provider type for an existing configuration is not supported.
      operationId: providers_update
      tags:
        - Providers
      parameters:
        - name: id
          in: path
          description: A unique identifier of the provider configuration to update.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
      summary: Update a provider
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvidersUpdateRequest'
    delete:
      description: >-
        Delete a provider configuration. Returns 409 if the provider is still referenced by routing or
        notifications.
      operationId: providers_delete
      tags:
        - Providers
      parameters:
        - name: id
          in: path
          description: A unique identifier of the provider configuration to delete.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Provider successfully deleted.
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conflict'
      summary: Delete a provider
      security:
        - BearerAuth: []
components:
  schemas:
    SendMessageResponse:
      title: SendMessageResponse
      type: object
      properties:
        requestId:
          type: string
          description: >-
            A successful call to `POST /send` returns a `202` status code along with a `requestId` in the
            response body.

            For single-recipient requests, the `requestId` is the derived message_id. For multiple recipients,
            Courier assigns a unique message_id to each derived message.
          example: 1-65f240a0-47a6a120c8374de9bcf9f22c
      required:
        - requestId
    Message:
      title: Message
      oneOf:
        - $ref: '#/components/schemas/ContentMessage'
    ContentMessage:
      title: ContentMessage
      type: object
      description: >-
        The message property has the following primary top-level properties. They define the destination and
        content of the message.
      properties:
        content:
          $ref: '#/components/schemas/Content'
          description: Describes content that will work for email, inbox, push, chat, or any channel id.
      allOf:
        - $ref: '#/components/schemas/BaseMessage'
        - $ref: '#/components/schemas/BaseMessageSendTo'
    Content:
      title: Content
      oneOf:
        - $ref: '#/components/schemas/ElementalContentSugar'
        - $ref: '#/components/schemas/ElementalContent'
    ElementalContentSugar:
      title: ElementalContentSugar
      type: object
      description: Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
      properties:
        title:
          type: string
          description: Title/subject displayed by supported channels.
        body:
          type: string
          description: The text content displayed in the notification.
      required:
        - title
        - body
    ElementalContent:
      title: ElementalContent
      type: object
      properties:
        version:
          type: string
          description: For example, "2022-01-01"
        elements:
          type: array
          items:
            $ref: '#/components/schemas/ElementalNode'
      required:
        - version
        - elements
    ElementalNode:
      title: ElementalNode
      oneOf:
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - text
            - $ref: '#/components/schemas/ElementalTextNode'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - meta
            - $ref: '#/components/schemas/ElementalMetaNode'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - channel
            - $ref: '#/components/schemas/ElementalChannelNode'
          required:
            - type
            - channel
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - image
            - $ref: '#/components/schemas/ElementalImageNode'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - action
            - $ref: '#/components/schemas/ElementalActionNode'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - divider
            - $ref: '#/components/schemas/ElementalDividerNode'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - quote
            - $ref: '#/components/schemas/ElementalQuoteNode'
          required:
            - type
        - type: object
          allOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - html
            - $ref: '#/components/schemas/ElementalHtmlNode'
          required:
            - type
    ElementalTextNode:
      title: ElementalTextNode
      type: object
      description: Represents a body of text to be rendered inside of the notification.
      properties:
        content:
          type: string
          description: |-
            The text content displayed in the notification. Either this
            field must be specified, or the elements field
        align:
          $ref: '#/components/schemas/TextAlign'
          description: Text alignment.
        text_style:
          $ref: '#/components/schemas/TextStyle'
          nullable: true
          description: Allows the text to be rendered as a heading level.
        color:
          type: string
          nullable: true
          description: Specifies the color of text. Can be any valid css color value
        bold:
          type: string
          nullable: true
          description: Apply bold to the text
        italic:
          type: string
          nullable: true
          description: Apply italics to the text
        strikethrough:
          type: string
          nullable: true
          description: Apply a strike through the text
        underline:
          type: string
          nullable: true
          description: Apply an underline to the text
        locales:
          $ref: '#/components/schemas/Locales'
          nullable: true
          description: >-
            Region specific content. See [locales
            docs](https://www.courier.com/docs/platform/content/elemental/locales/) for more details.
        format:
          type: string
          enum:
            - markdown
          nullable: true
      required:
        - content
        - align
      allOf:
        - $ref: '#/components/schemas/ElementalBaseNode'
    ElementalMetaNode:
      title: ElementalMetaNode
      type: object
      description: |-
        The meta element contains information describing the notification that may 
        be used by a particular channel or provider. One important field is the title 
        field which will be used as the title for channels that support it.
      properties:
        title:
          type: string
          nullable: true
          description: The title to be displayed by supported channels. For example, the email subject.
      allOf:
        - $ref: '#/components/schemas/ElementalBaseNode'
    ElementalChannelNode:
      title: ElementalChannelNode
      type: object
      description: >-
        The channel element allows a notification to be customized based on which channel it is sent through. 

        For example, you may want to display a detailed message when the notification is sent through email, 

        and a more concise message in a push notification. Channel elements are only valid as top-level 

        elements; you cannot nest channel elements. If there is a channel element specified at the top-level 

        of the document, all sibling elements must be channel elements.

        Note: As an alternative, most elements support a `channel` property. Which allows you to selectively 

        display an individual element on a per channel basis. See the 

        [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/) for more
        details.
      properties:
        channel:
          type: string
          example: email
          description: |-
            The channel the contents of this element should be applied to. Can be `email`,
            `push`, `direct_message`, `sms` or a provider such as slack
        raw:
          type: object
          additionalProperties: true
          nullable: true
          description: Raw data to apply to the channel. If `elements` has not been specified, `raw` is required.
      allOf:
        - $ref: '#/components/schemas/ElementalBaseNode'
    ElementalImageNode:
      title: ElementalImageNode
      type: object
      description: Used to embed an image into the notification.
      properties:
        src:
          type: string
          description: The source of the image.
        href:
          type: string
          nullable: true
          description: A URL to link to when the image is clicked.
        align:
          $ref: '#/components/schemas/IAlignment'
          nullable: true
          description: The alignment of the image.
        altText:
          type: string
          nullable: true
          description: Alternate text for the image.
        width:
          type: string
          nullable: true
          description: CSS width properties to apply to the image. For example, 50px
      required:
        - src
      allOf:
        - $ref: '#/components/schemas/ElementalBaseNode'
    ElementalActionNode:
      title: ElementalActionNode
      type: object
      description: Allows the user to execute an action. Can be a button or a link.
      properties:
        content:
          type: string
          description: The text content of the action shown to the user.
        href:
          type: string
          description: The target URL of the action.
        action_id:
          type: string
          nullable: true
          description: A unique id used to identify the action when it is executed.
        align:
          nullable: true
          description: The alignment of the action button. Defaults to "center".
          allOf:
            - $ref: '#/components/schemas/IAlignment'
        background_color:
          type: string
          nullable: true
          description: The background color of the action button.
        style:
          nullable: true
          description: Defaults to `button`.
          allOf:
            - $ref: '#/components/schemas/IActionButtonStyle'
        locales:
          description: >-
            Region specific content. See [locales
            docs](https://www.courier.com/docs/platform/content/elemental/locales/) for more details.
          allOf:
            - $ref: '#/components/schemas/Locales'
      required:
        - content
        - href
        - locales
      allOf:
        - $ref: '#/components/schemas/ElementalBaseNode'
    ElementalDividerNode:
      title: ElementalDividerNode
      type: object
      description: Renders a dividing line between elements.
      properties:
        color:
          type: string
          nullable: true
          description: The CSS color to render the line with. For example, `#fff`
      allOf:
        - $ref: '#/components/schemas/ElementalBaseNode'
    ElementalQuoteNode:
      title: ElementalQuoteNode
      type: object
      description: Renders a quote block.
      properties:
        content:
          type: string
          description: The text value of the quote.
        align:
          $ref: '#/components/schemas/IAlignment'
          nullable: true
          description: Alignment of the quote.
        borderColor:
          type: string
          nullable: true
          description: CSS border color property. For example, `#fff`
        text_style:
          $ref: '#/components/schemas/TextStyle'
        locales:
          $ref: '#/components/schemas/Locales'
          description: >-
            Region specific content. See [locales
            docs](https://www.courier.com/docs/platform/content/elemental/locales/) for more details.
      required:
        - content
        - text_style
        - locales
      allOf:
        - $ref: '#/components/schemas/ElementalBaseNode'
    ElementalHtmlNode:
      title: ElementalHtmlNode
      type: object
      description: >-
        Raw HTML string inside an Elemental document. When rendering a message, this node is turned into
        output only for the email channel; for other channels it produces no blocks.
      properties:
        content:
          type: string
          description: Raw HTML string to render inside the notification.
        locales:
          $ref: '#/components/schemas/Locales'
          nullable: true
          description: >-
            Region-specific `content` overrides. See [locales
            docs](https://www.courier.com/docs/platform/content/elemental/locales/) for more details.
      required:
        - content
      allOf:
        - $ref: '#/components/schemas/ElementalBaseNode'
    TextAlign:
      title: TextAlign
      type: string
      enum:
        - left
        - center
        - right
    TextStyle:
      title: TextStyle
      type: string
      enum:
        - text
        - h1
        - h2
        - subtext
    Locales:
      title: Locales
      type: object
      additionalProperties:
        $ref: '#/components/schemas/Locale'
      nullable: true
    Locale:
      title: Locale
      type: object
      properties:
        content:
          type: string
      required:
        - content
    IAlignment:
      title: IAlignment
      type: string
      enum:
        - center
        - left
        - right
        - full
    ElementalBaseNode:
      title: ElementalBaseNode
      type: object
      properties:
        channels:
          type: array
          items:
            type: string
          nullable: true
        ref:
          type: string
          nullable: true
        if:
          type: string
          nullable: true
        loop:
          type: string
          nullable: true
    IActionButtonStyle:
      title: IActionButtonStyle
      type: string
      enum:
        - button
        - link
    BaseMessage:
      title: BaseMessage
      type: object
      properties:
        template:
          type: string
          nullable: true
        data:
          $ref: '#/components/schemas/MessageData'
          nullable: true
        brand_id:
          type: string
          nullable: true
        channels:
          $ref: '#/components/schemas/MessageChannels'
          nullable: true
          description: >-
            Define run-time configuration for channels. Valid ChannelId's: email, sms, push, inbox,
            direct_message, banner, webhook.
        context:
          $ref: '#/components/schemas/MessageContext'
          nullable: true
        metadata:
          $ref: '#/components/schemas/MessageMetadata'
          nullable: true
        preferences:
          $ref: '#/components/schemas/MessagePreferences'
          nullable: true
        providers:
          $ref: '#/components/schemas/MessageProviders'
          nullable: true
        routing:
          $ref: '#/components/schemas/Routing'
          nullable: true
        timeout:
          $ref: '#/components/schemas/Timeout'
          nullable: true
        delay:
          $ref: '#/components/schemas/Delay'
          nullable: true
        expiry:
          $ref: '#/components/schemas/Expiry'
          nullable: true
    BaseMessageSendTo:
      title: BaseMessageSendTo
      type: object
      properties:
        to:
          $ref: '#/components/schemas/MessageRecipient'
          nullable: true
          description: The recipient or a list of recipients of the message
    Audience:
      title: Audience
      type: object
      properties:
        id:
          type: string
          description: A unique identifier representing the audience_id
        name:
          type: string
          description: The name of the audience
        description:
          type: string
          description: A description of the audience
        operator:
          $ref: '#/components/schemas/LogicalOperator'
          description: The logical operator (AND/OR) for the top-level filter
        filter:
          $ref: '#/components/schemas/AudienceFilterConfig'
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - description
        - created_at
        - updated_at
    AudienceUpdateResponse:
      title: AudienceUpdateResponse
      type: object
      properties:
        audience:
          $ref: '#/components/schemas/Audience'
      required:
        - audience
    MessageRecipient:
      title: MessageRecipient
      description: The recipient of a message. Can be a single recipient or an array of recipients.
      oneOf:
        - $ref: '#/components/schemas/Recipient'
        - type: array
          items:
            $ref: '#/components/schemas/Recipient'
    Recipient:
      title: Recipient
      description: >-
        A single recipient of the message. Choose one of the following types based on how you want to identify
        the recipient: - **User**: Send to a specific user by user_id, email, or phone number - **Audience**:
        Send to all users in an audience - **List**: Send to all users in a list - **List Pattern**: Send to
        users in lists matching a pattern - **Slack**: Send via Slack (channel, email, or user_id) - **MS
        Teams**: Send via Microsoft Teams - **PagerDuty**: Send via PagerDuty - **Webhook**: Send via webhook
      oneOf:
        - $ref: '#/components/schemas/UserRecipient'
        - $ref: '#/components/schemas/AudienceRecipient'
        - $ref: '#/components/schemas/ListRecipient'
        - $ref: '#/components/schemas/ListPatternRecipient'
        - $ref: '#/components/schemas/SlackRecipient'
        - $ref: '#/components/schemas/MsTeamsRecipient'
        - $ref: '#/components/schemas/PagerdutyRecipient'
        - $ref: '#/components/schemas/WebhookRecipient'
      discriminator:
        propertyName: _type
        mapping:
          user: '#/components/schemas/UserRecipient'
          audience: '#/components/schemas/AudienceRecipient'
          list: '#/components/schemas/ListRecipient'
          list_pattern: '#/components/schemas/ListPatternRecipient'
          slack: '#/components/schemas/SlackRecipient'
          ms_teams: '#/components/schemas/MsTeamsRecipient'
          pagerduty: '#/components/schemas/PagerdutyRecipient'
          webhook: '#/components/schemas/WebhookRecipient'
    UserRecipient:
      title: User Recipient
      description: Send to a specific user by user_id, email, phone_number, or list_id
      type: object
      properties:
        user_id:
          type: string
          nullable: true
          description: The user's unique identifier. Typically, this will match the user id of a user in your system.
        account_id:
          type: string
          nullable: true
          description: Deprecated - Use `tenant_id` instead.
        context:
          $ref: '#/components/schemas/MessageContext'
          nullable: true
          description: Context such as tenant_id to send the notification with.
        data:
          $ref: '#/components/schemas/MessageData'
          nullable: true
        email:
          type: string
          nullable: true
          description: The user's email address.
        locale:
          type: string
          nullable: true
          description: The user's preferred ISO 639-1 language code.
        phone_number:
          type: string
          nullable: true
          description: The user's phone number.
        list_id:
          type: string
          nullable: true
          description: The id of the list to send the message to.
        preferences:
          $ref: '#/components/schemas/ProfilePreferences'
          nullable: true
        tenant_id:
          type: string
          nullable: true
          description: The id of the tenant the user is associated with.
      allOf:
        - $ref: '#/components/schemas/UserRecipientType'
    UserRecipientType:
      title: UserRecipientType
      type: object
      properties: {}
    AudienceRecipient:
      title: Audience Recipient
      description: Send to all users in an audience
      type: object
      properties:
        audience_id:
          type: string
          description: >-
            A unique identifier associated with an Audience. A message will be sent to each user in the
            audience.
        data:
          $ref: '#/components/schemas/MessageData'
          nullable: true
        filters:
          type: array
          items:
            $ref: '#/components/schemas/AudienceFilter'
          nullable: true
      required:
        - audience_id
    ListRecipient:
      title: List Recipient
      description: Send to all users in a specific list
      type: object
      properties:
        list_id:
          type: string
          nullable: true
        data:
          $ref: '#/components/schemas/MessageData'
          nullable: true
        filters:
          type: array
          items:
            $ref: '#/components/schemas/ListFilter'
          nullable: true
    ListPatternRecipient:
      title: List Pattern Recipient
      description: Send to users in lists matching a pattern
      type: object
      properties:
        list_pattern:
          type: string
          nullable: true
        data:
          $ref: '#/components/schemas/MessageData'
          nullable: true
    SlackRecipient:
      title: Slack Recipient
      description: Send via Slack (channel, email, or user_id)
      type: object
      properties:
        slack:
          $ref: '#/components/schemas/Slack'
      required:
        - slack
    MsTeamsRecipient:
      title: MS Teams Recipient
      description: Send via Microsoft Teams
      type: object
      properties:
        ms_teams:
          $ref: '#/components/schemas/MsTeams'
      required:
        - ms_teams
    WebhookRecipient:
      title: Webhook Recipient
      description: Send via webhook
      type: object
      properties:
        webhook:
          $ref: '#/components/schemas/WebhookProfile'
      required:
        - webhook
    PagerdutyRecipient:
      title: PagerDuty Recipient
      description: Send via PagerDuty
      type: object
      properties:
        pagerduty:
          $ref: '#/components/schemas/Pagerduty'
      required:
        - pagerduty
    MessageContext:
      title: MessageContext
      type: object
      properties:
        tenant_id:
          type: string
          nullable: true
          description: Tenant id used to load brand/default preferences/context.
    MessageData:
      title: MessageData
      type: object
      additionalProperties: true
    ProfilePreferences:
      title: ProfilePreferences
      type: object
      properties:
        categories:
          $ref: '#/components/schemas/Preferences'
          nullable: true
        notifications:
          $ref: '#/components/schemas/Preferences'
        templateId:
          type: string
          nullable: true
      required:
        - notifications
    Preferences:
      title: Preferences
      type: object
      additionalProperties:
        $ref: '#/components/schemas/Preference'
    Preference:
      title: Preference
      type: object
      properties:
        status:
          $ref: '#/components/schemas/PreferenceStatus'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
          nullable: true
        channel_preferences:
          type: array
          items:
            $ref: '#/components/schemas/ChannelPreference'
          nullable: true
        source:
          $ref: '#/components/schemas/ChannelSource'
          nullable: true
      required:
        - status
    PreferenceStatus:
      title: PreferenceStatus
      type: string
      enum:
        - OPTED_IN
        - OPTED_OUT
        - REQUIRED
    Rule:
      title: Rule
      type: object
      properties:
        start:
          type: string
          nullable: true
        until:
          type: string
      required:
        - until
    ChannelPreference:
      title: ChannelPreference
      type: object
      properties:
        channel:
          $ref: '#/components/schemas/ChannelClassification'
      required:
        - channel
    ChannelClassification:
      title: ChannelClassification
      type: string
      enum:
        - direct_message
        - email
        - push
        - sms
        - webhook
        - inbox
    ChannelSource:
      title: ChannelSource
      type: string
      enum:
        - subscription
        - list
        - recipient
    AudienceFilter:
      title: AudienceFilter
      type: object
      properties:
        operator:
          type: string
          enum:
            - MEMBER_OF
          description: Send to users only if they are member of the account
        path:
          type: string
          enum:
            - account_id
        value:
          type: string
      required:
        - operator
        - path
        - value
    ListFilter:
      title: ListFilter
      type: object
      properties:
        operator:
          type: string
          enum:
            - MEMBER_OF
          description: Send to users only if they are member of the account
        path:
          type: string
          enum:
            - account_id
        value:
          type: string
      required:
        - operator
        - path
        - value
    Routing:
      title: Routing
      type: object
      description: Customize which channels/providers Courier may deliver the message through.
      properties:
        method:
          $ref: '#/components/schemas/RoutingMethod'
        channels:
          type: array
          items:
            $ref: '#/components/schemas/MessageRoutingChannel'
          description: A list of channels or providers (or nested routing rules).
      required:
        - method
        - channels
    RoutingMethod:
      title: RoutingMethod
      type: string
      enum:
        - all
        - single
    MessageRoutingChannel:
      title: MessageRoutingChannel
      oneOf:
        - type: string
        - $ref: '#/components/schemas/MessageRouting'
    MessageRouting:
      title: MessageRouting
      type: object
      properties:
        method:
          $ref: '#/components/schemas/MessageRoutingMethod'
        channels:
          type: array
          items:
            $ref: '#/components/schemas/MessageRoutingChannel'
      required:
        - method
        - channels
    MessageRoutingMethod:
      title: MessageRoutingMethod
      type: string
      enum:
        - all
        - single
    MessageChannels:
      title: MessageChannels
      type: object
      additionalProperties:
        $ref: '#/components/schemas/Channel'
    Channel:
      title: Channel
      type: object
      properties:
        brand_id:
          type: string
          nullable: true
          description: Brand id used for rendering.
        providers:
          type: array
          items:
            type: string
          nullable: true
          description: Providers enabled for this channel.
        routing_method:
          $ref: '#/components/schemas/RoutingMethod'
          nullable: true
          description: Defaults to `single`.
        if:
          type: string
          nullable: true
          description: JS conditional with access to data/profile.
        timeouts:
          $ref: '#/components/schemas/Timeouts'
          nullable: true
        override:
          type: object
          additionalProperties: true
          nullable: true
          description: Channel specific overrides.
        metadata:
          $ref: '#/components/schemas/ChannelMetadata'
          nullable: true
      x-stainless-naming:
        csharp:
          type_name: MessageChannel
    ChannelMetadata:
      title: ChannelMetadata
      type: object
      properties:
        utm:
          $ref: '#/components/schemas/UTM'
          nullable: true
    MessageProviders:
      title: MessageProviders
      type: object
      additionalProperties:
        $ref: '#/components/schemas/MessageProvidersType'
    MessageProvidersType:
      title: MessageProvidersType
      type: object
      properties:
        override:
          type: object
          additionalProperties: true
          nullable: true
          description: Provider-specific overrides.
        if:
          type: string
          nullable: true
          description: JS conditional with access to data/profile.
        timeouts:
          type: integer
          nullable: true
        metadata:
          $ref: '#/components/schemas/Metadata'
          nullable: true
    Timeout:
      title: Timeout
      type: object
      properties:
        provider:
          type: object
          additionalProperties:
            type: integer
          nullable: true
        channel:
          type: object
          additionalProperties:
            type: integer
          nullable: true
        message:
          type: integer
          nullable: true
        escalation:
          type: integer
          nullable: true
        criteria:
          $ref: '#/components/schemas/Criteria'
          nullable: true
    Criteria:
      title: Criteria
      type: string
      enum:
        - no-escalation
        - delivered
        - viewed
        - engaged
    Timeouts:
      title: Timeouts
      type: object
      properties:
        provider:
          type: integer
          nullable: true
        channel:
          type: integer
          nullable: true
      x-stainless-naming:
        csharp:
          type_name: ChannelTimeouts
    Delay:
      title: Delay
      type: object
      properties:
        duration:
          type: integer
          nullable: true
          description: The duration of the delay in milliseconds.
        until:
          type: string
          nullable: true
          description: ISO 8601 timestamp or opening_hours-like format.
        timezone:
          type: string
          nullable: true
          description: >-
            IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). Used when resolving opening hours
            expressions. Takes precedence over user profile timezone settings.
    Expiry:
      title: Expiry
      type: object
      properties:
        expires_at:
          type: string
          nullable: true
          description: Epoch or ISO8601 timestamp with timezone.
        expires_in:
          $ref: '#/components/schemas/ExpiresInType'
          description: Duration in ms or ISO8601 duration (e.g. P1DT4H).
      required:
        - expires_in
    ExpiresInType:
      title: ExpiresInType
      oneOf:
        - type: string
        - type: integer
    MessageMetadata:
      title: MessageMetadata
      type: object
      properties:
        event:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        utm:
          $ref: '#/components/schemas/UTM'
          nullable: true
        trace_id:
          type: string
          nullable: true
    UTM:
      title: UTM
      type: object
      properties:
        source:
          type: string
          nullable: true
        medium:
          type: string
          nullable: true
        campaign:
          type: string
          nullable: true
        term:
          type: string
          nullable: true
        content:
          type: string
          nullable: true
    MessagePreferences:
      title: MessagePreferences
      type: object
      properties:
        subscription_topic_id:
          type: string
          description: The subscription topic to apply to the message.
      required:
        - subscription_topic_id
    Metadata:
      title: Metadata
      type: object
      properties:
        utm:
          $ref: '#/components/schemas/UTM'
          nullable: true
      x-stainless-naming:
        csharp:
          type_name: ProviderMetadata
    Slack:
      title: Slack
      oneOf:
        - $ref: '#/components/schemas/SendToSlackChannel'
        - $ref: '#/components/schemas/SendToSlackEmail'
        - $ref: '#/components/schemas/SendToSlackUserId'
    SlackBaseProperties:
      title: SlackBaseProperties
      type: object
      properties:
        access_token:
          type: string
      required:
        - access_token
    SendToSlackChannel:
      title: SendToSlackChannel
      type: object
      properties:
        access_token:
          type: string
        channel:
          type: string
      required:
        - access_token
        - channel
    SendToSlackEmail:
      title: SendToSlackEmail
      type: object
      properties:
        access_token:
          type: string
        email:
          type: string
      required:
        - access_token
        - email
    SendToSlackUserId:
      title: SendToSlackUserId
      type: object
      properties:
        access_token:
          type: string
        user_id:
          type: string
      required:
        - access_token
        - user_id
    MsTeams:
      title: MsTeams
      oneOf:
        - $ref: '#/components/schemas/SendToMsTeamsUserId'
        - $ref: '#/components/schemas/SendToMsTeamsEmail'
        - $ref: '#/components/schemas/SendToMsTeamsChannelId'
        - $ref: '#/components/schemas/SendToMsTeamsConversationId'
        - $ref: '#/components/schemas/SendToMsTeamsChannelName'
    MsTeamsBaseProperties:
      title: MsTeamsBaseProperties
      type: object
      properties:
        tenant_id:
          type: string
        service_url:
          type: string
      required:
        - tenant_id
        - service_url
    SendToMsTeamsUserId:
      title: SendToMsTeamsUserId
      type: object
      properties:
        tenant_id:
          type: string
        service_url:
          type: string
        user_id:
          type: string
      required:
        - tenant_id
        - service_url
        - user_id
    SendToMsTeamsEmail:
      title: SendToMsTeamsEmail
      type: object
      properties:
        tenant_id:
          type: string
        service_url:
          type: string
        email:
          type: string
      required:
        - tenant_id
        - service_url
        - email
    SendToMsTeamsConversationId:
      title: SendToMsTeamsConversationId
      type: object
      properties:
        tenant_id:
          type: string
        service_url:
          type: string
        conversation_id:
          type: string
      required:
        - tenant_id
        - service_url
        - conversation_id
    SendToMsTeamsChannelId:
      title: SendToMsTeamsChannelId
      type: object
      properties:
        tenant_id:
          type: string
        service_url:
          type: string
        channel_id:
          type: string
      required:
        - tenant_id
        - service_url
        - channel_id
    SendToMsTeamsChannelName:
      title: SendToMsTeamsChannelName
      type: object
      properties:
        tenant_id:
          type: string
        service_url:
          type: string
        channel_name:
          type: string
        team_id:
          type: string
      required:
        - tenant_id
        - service_url
        - channel_name
        - team_id
    Pagerduty:
      title: Pagerduty
      type: object
      properties:
        routing_key:
          type: string
          nullable: true
        event_action:
          type: string
          nullable: true
        severity:
          type: string
          nullable: true
        source:
          type: string
          nullable: true
    WebhookProfile:
      title: WebhookProfile
      type: object
      properties:
        url:
          type: string
          description: The URL to send the webhook request to.
        method:
          $ref: '#/components/schemas/WebhookMethod'
          nullable: true
          description: The HTTP method to use for the webhook request. Defaults to POST if not specified.
        headers:
          type: object
          additionalProperties:
            type: string
          nullable: true
          description: Custom headers to include in the webhook request.
        authentication:
          $ref: '#/components/schemas/WebhookAuthentication'
          nullable: true
          description: Authentication configuration for the webhook request.
        profile:
          $ref: '#/components/schemas/WebhookProfileType'
          nullable: true
          description: >-
            Specifies what profile information is included in the request payload. Defaults to 'limited' if
            not specified.
      required:
        - url
    WebhookMethod:
      title: WebhookMethod
      type: string
      enum:
        - POST
        - PUT
    WebhookAuthentication:
      title: WebhookAuthentication
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/WebhookAuthMode'
          description: The authentication mode to use. Defaults to 'none' if not specified.
        username:
          type: string
          nullable: true
          description: Username for basic authentication.
        password:
          type: string
          nullable: true
          description: Password for basic authentication.
        token:
          type: string
          nullable: true
          description: Token for bearer authentication.
      required:
        - mode
    WebhookAuthMode:
      title: WebhookAuthMode
      type: string
      enum:
        - none
        - basic
        - bearer
    WebhookProfileType:
      title: WebhookProfileType
      type: string
      enum:
        - limited
        - expanded
    UserProfile:
      title: UserProfile
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          nullable: true
        birthdate:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        email_verified:
          type: boolean
          nullable: true
        family_name:
          type: string
          nullable: true
        gender:
          type: string
          nullable: true
        given_name:
          type: string
          nullable: true
        locale:
          type: string
          nullable: true
        middle_name:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        nickname:
          type: string
          nullable: true
        phone_number:
          type: string
          nullable: true
        phone_number_verified:
          type: boolean
          nullable: true
        picture:
          type: string
          nullable: true
        preferred_name:
          type: string
          nullable: true
        profile:
          type: string
          nullable: true
        sub:
          type: string
          nullable: true
        updated_at:
          type: string
          nullable: true
        website:
          type: string
          nullable: true
        zoneinfo:
          type: string
          nullable: true
        custom:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            A free form object. Due to a limitation of the API Explorer, you can only enter string key/values
            below, but this API accepts more complex object structures.
        airship:
          $ref: '#/components/schemas/AirshipProfile'
          nullable: true
        apn:
          type: string
          nullable: true
        target_arn:
          type: string
          nullable: true
        discord:
          $ref: '#/components/schemas/Discord'
          nullable: true
        expo:
          $ref: '#/components/schemas/Expo'
          nullable: true
        facebookPSID:
          type: string
          nullable: true
        firebaseToken:
          $ref: '#/components/schemas/UserProfileFirebaseToken'
          nullable: true
        intercom:
          $ref: '#/components/schemas/Intercom'
          nullable: true
        slack:
          $ref: '#/components/schemas/Slack'
          nullable: true
        ms_teams:
          $ref: '#/components/schemas/MsTeams'
          nullable: true
    UserProfileFirebaseToken:
      title: UserProfileFirebaseToken
      oneOf:
        - type: string
        - type: array
          items:
            type: string
    AirshipProfile:
      title: AirshipProfile
      type: object
      properties:
        audience:
          $ref: '#/components/schemas/AirshipProfileAudience'
        device_types:
          type: array
          items:
            $ref: '#/components/schemas/DeviceType'
      required:
        - audience
        - device_types
    AirshipProfileAudience:
      title: AirshipProfileAudience
      type: object
      properties:
        named_user:
          type: string
      required:
        - named_user
    DeviceType:
      title: DeviceType
      type: string
    Discord:
      title: Discord
      oneOf:
        - $ref: '#/components/schemas/SendToChannel'
        - $ref: '#/components/schemas/SendDirectMessage'
    SendToChannel:
      title: SendToChannel
      type: object
      properties:
        channel_id:
          type: string
      required:
        - channel_id
    SendDirectMessage:
      title: SendDirectMessage
      type: object
      properties:
        user_id:
          type: string
      required:
        - user_id
    Expo:
      title: Expo
      oneOf:
        - $ref: '#/components/schemas/Token'
        - $ref: '#/components/schemas/MultipleTokens'
    Token:
      title: Token
      type: object
      properties:
        token:
          type: string
      required:
        - token
    MultipleTokens:
      title: MultipleTokens
      type: object
      properties:
        tokens:
          type: array
          items:
            $ref: '#/components/schemas/Token'
      required:
        - tokens
    Intercom:
      title: Intercom
      type: object
      properties:
        from:
          type: string
        to:
          $ref: '#/components/schemas/IntercomRecipient'
      required:
        - from
        - to
    IntercomRecipient:
      title: IntercomRecipient
      type: object
      properties:
        id:
          type: string
      required:
        - id
    FilterConfig:
      title: FilterConfig
      type: object
      description: >-
        A filter rule that can be either a single condition (with path/value) or a  nested group (with filters
        array). Use comparison operators (EQ, GT, etc.)  for single conditions, and logical operators (AND,
        OR) for nested groups.
      properties:
        operator:
          type: string
          description: >-
            The operator for this filter. Use comparison operators (EQ, GT, LT, GTE, LTE,  NEQ, EXISTS,
            INCLUDES, STARTS_WITH, ENDS_WITH, IS_BEFORE, IS_AFTER, OMIT) for  single conditions, or logical
            operators (AND, OR) for nested filter groups.
        path:
          type: string
          description: >-
            The attribute path from the user profile to filter on. Required for single  filter conditions, not
            used for nested filter groups.
        value:
          type: string
          description: >-
            The value to compare against. Required for single filter conditions,  not used for nested filter
            groups.
        filters:
          type: array
          items:
            $ref: '#/components/schemas/FilterConfig'
          description: >-
            Nested filter rules to combine with AND/OR. Required for nested filter groups, not used for single
            filter conditions.
      required:
        - operator
    AudienceFilterConfig:
      title: AudienceFilterConfig
      type: object
      description: Filter configuration for audience membership containing an array of filter rules
      properties:
        filters:
          type: array
          items:
            $ref: '#/components/schemas/FilterConfig'
          description: Array of filter rules (single conditions or nested groups)
      required:
        - filters
    ComparisonOperator:
      title: ComparisonOperator
      type: string
      enum:
        - ENDS_WITH
        - EQ
        - EXISTS
        - GT
        - GTE
        - INCLUDES
        - IS_AFTER
        - IS_BEFORE
        - LT
        - LTE
        - NEQ
        - OMIT
        - STARTS_WITH
    LogicalOperator:
      title: LogicalOperator
      type: string
      enum:
        - AND
        - OR
    AudienceMember:
      title: AudienceMember
      type: object
      properties:
        added_at:
          type: string
        audience_id:
          type: string
        audience_version:
          type: integer
        member_id:
          type: string
        reason:
          type: string
      required:
        - added_at
        - audience_id
        - audience_version
        - member_id
        - reason
    AudienceListResponse:
      title: AudienceListResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        items:
          type: array
          items:
            $ref: '#/components/schemas/Audience'
      required:
        - paging
        - items
    AudienceMemberListResponse:
      title: AudienceMemberListResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        items:
          type: array
          items:
            $ref: '#/components/schemas/AudienceMember'
      required:
        - paging
        - items
    Paging:
      title: Paging
      type: object
      properties:
        cursor:
          type: string
          nullable: true
        more:
          type: boolean
      required:
        - more
    ListAuditEventsResponse:
      title: ListAuditEventsResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        results:
          type: array
          items:
            $ref: '#/components/schemas/AuditEvent'
      required:
        - paging
        - results
    AuditEvent:
      title: AuditEvent
      type: object
      properties:
        auditEventId:
          type: string
        actor:
          $ref: '#/components/schemas/Actor'
        target:
          type: string
        source:
          type: string
        timestamp:
          type: string
        type:
          type: string
      required:
        - auditEventId
        - actor
        - target
        - source
        - timestamp
        - type
    Actor:
      title: Actor
      type: object
      properties:
        id:
          type: string
        email:
          type: string
          nullable: true
      required:
        - id
    IssueTokenResponse:
      title: IssueTokenResponse
      type: object
      properties:
        token:
          type: string
      required:
        - token
    AutomationInvokeParams:
      title: AutomationInvokeParams
      type: object
      properties:
        brand:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties: true
          nullable: true
        profile:
          type: object
          additionalProperties: true
          nullable: true
        recipient:
          type: string
          nullable: true
        template:
          type: string
          nullable: true
      required:
        - recipient
    AutomationAdHocInvokeParams:
      title: AutomationAdHocInvokeParams
      type: object
      properties:
        automation:
          $ref: '#/components/schemas/Automation'
        brand:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties: true
          nullable: true
        profile:
          type: object
          additionalProperties: true
          nullable: true
        recipient:
          type: string
          nullable: true
        template:
          type: string
          nullable: true
      required:
        - automation
    Automation:
      title: Automation
      type: object
      properties:
        cancelation_token:
          type: string
          nullable: true
        steps:
          type: array
          items:
            $ref: '#/components/schemas/AutomationStep'
      required:
        - steps
    AutomationStep:
      title: AutomationStep
      oneOf:
        - $ref: '#/components/schemas/AutomationDelayStep'
        - $ref: '#/components/schemas/AutomationSendStep'
        - $ref: '#/components/schemas/AutomationSendListStep'
        - $ref: '#/components/schemas/AutomationUpdateProfileStep'
        - $ref: '#/components/schemas/AutomationCancelStep'
        - $ref: '#/components/schemas/AutomationFetchDataStep'
        - $ref: '#/components/schemas/AutomationInvokeStep'
    AutomationDelayStep:
      title: AutomationDelayStep
      type: object
      properties:
        action:
          type: string
          enum:
            - delay
        duration:
          type: string
          nullable: true
        until:
          type: string
          nullable: true
      required:
        - action
    AutomationSendStep:
      title: AutomationSendStep
      type: object
      properties:
        action:
          type: string
          enum:
            - send
        template:
          type: string
          nullable: true
        brand:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties: true
          nullable: true
        profile:
          type: object
          additionalProperties: true
          nullable: true
        recipient:
          type: string
          nullable: true
      required:
        - action
    AutomationSendListStep:
      title: AutomationSendListStep
      type: object
      properties:
        action:
          type: string
          enum:
            - send-list
        list:
          type: string
        data:
          type: object
          additionalProperties: true
          nullable: true
        brand:
          type: string
          nullable: true
      required:
        - action
        - list
    AutomationUpdateProfileStep:
      title: AutomationUpdateProfileStep
      type: object
      properties:
        action:
          type: string
          enum:
            - update-profile
        recipient_id:
          type: string
          nullable: true
        merge:
          type: string
          enum:
            - none
            - overwrite
            - soft-merge
            - replace
          nullable: true
        profile:
          type: object
          additionalProperties: true
      required:
        - action
        - profile
    AutomationCancelStep:
      title: AutomationCancelStep
      type: object
      properties:
        action:
          type: string
          enum:
            - cancel
        cancelation_token:
          type: string
      required:
        - action
        - cancelation_token
    AutomationFetchDataStep:
      title: AutomationFetchDataStep
      type: object
      properties:
        action:
          type: string
          enum:
            - fetch-data
        webhook:
          $ref: '#/components/schemas/AutomationWebhookParams'
        merge_strategy:
          type: string
          enum:
            - replace
            - overwrite
            - soft-merge
          nullable: true
      required:
        - action
        - webhook
    AutomationWebhookParams:
      title: AutomationWebhookParams
      type: object
      properties:
        url:
          type: string
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
        headers:
          type: object
          additionalProperties:
            type: string
          nullable: true
        body:
          type: string
          nullable: true
      required:
        - url
        - method
    AutomationInvokeStep:
      title: AutomationInvokeStep
      type: object
      properties:
        action:
          type: string
          enum:
            - invoke
        template:
          type: string
      required:
        - action
        - template
    AutomationInvokeResponse:
      title: AutomationInvokeResponse
      type: object
      properties:
        runId:
          type: string
      required:
        - runId
    AutomationTemplate:
      title: AutomationTemplate
      type: object
      properties:
        name:
          type: string
          description: The name of the automation template.
        id:
          type: string
          description: The unique identifier of the automation template.
        version:
          type: string
          description: The version of the template published or drafted.
          enum:
            - published
            - draft
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the template was created.
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the template was last updated.
      required:
        - name
        - id
        - version
    AutomationTemplateListResponse:
      title: AutomationTemplateListResponse
      type: object
      properties:
        templates:
          type: array
          items:
            $ref: '#/components/schemas/AutomationTemplate'
        cursor:
          type: string
          description: A cursor token for pagination. Present when there are more results available.
    JourneysInvokeRequest:
      title: JourneysInvokeRequest
      type: object
      description: >-
        Request body for invoking a journey. Requires either a user identifier or a profile with contact
        information. User identifiers can be provided via user_id field, or resolved from profile/data objects
        (user_id, userId, or anonymousId fields).
      properties:
        user_id:
          type: string
          description: >-
            A unique identifier for the user. If not provided, the system will attempt to resolve the user
            identifier from profile or data objects.
        profile:
          type: object
          additionalProperties: true
          description: >-
            Profile data for the user. Can contain contact information (email, phone_number), user identifiers
            (user_id, userId, anonymousId), or any custom profile fields. Profile fields are merged with any
            existing stored profile for the user. Include context.tenant_id to load a tenant-scoped profile
            for multi-tenant scenarios.
        data:
          type: object
          additionalProperties: true
          description: >-
            Data payload passed to the journey. The expected shape can be predefined using the schema builder
            in the journey editor. This data is available in journey steps for condition evaluation and
            template variable interpolation. Can also contain user identifiers (user_id, userId, anonymousId)
            if not provided elsewhere.
    JourneysInvokeResponse:
      title: JourneysInvokeResponse
      type: object
      properties:
        runId:
          type: string
          description: A unique identifier for the journey run that was created.
      required:
        - runId
    Journey:
      title: Journey
      type: object
      description: A journey template representing an automation workflow.
      properties:
        name:
          type: string
          description: The name of the journey.
        id:
          type: string
          description: The unique identifier of the journey.
        version:
          type: string
          description: The version of the journey (published or draft).
          enum:
            - published
            - draft
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the journey was created.
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the journey was last updated.
      required:
        - name
        - id
        - version
    JourneysListResponse:
      title: JourneysListResponse
      type: object
      properties:
        templates:
          type: array
          items:
            $ref: '#/components/schemas/Journey'
        cursor:
          type: string
          description: A cursor token for pagination. Present when there are more results available.
    Brand:
      title: Brand
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        published:
          type: integer
          format: int64
          nullable: true
        created:
          type: integer
          format: int64
        updated:
          type: integer
          format: int64
        settings:
          $ref: '#/components/schemas/BrandSettings'
          nullable: true
        snippets:
          $ref: '#/components/schemas/BrandSnippets'
          nullable: true
        version:
          type: string
          nullable: true
      required:
        - id
        - name
        - created
        - updated
    BrandParameters:
      title: BrandParameters
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
        settings:
          $ref: '#/components/schemas/BrandSettings'
          nullable: true
        snippets:
          $ref: '#/components/schemas/BrandSnippets'
          nullable: true
      required:
        - name
    BrandSettings:
      title: BrandSettings
      type: object
      properties:
        colors:
          $ref: '#/components/schemas/BrandColors'
          nullable: true
        email:
          $ref: '#/components/schemas/BrandSettingsEmail'
          nullable: true
        inapp:
          $ref: '#/components/schemas/BrandSettingsInApp'
          nullable: true
    BrandColors:
      title: BrandColors
      type: object
      properties:
        primary:
          type: string
        secondary:
          type: string
      additionalProperties:
        type: string
    BrandSnippets:
      title: BrandSnippets
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BrandSnippet'
          nullable: true
    BrandSnippet:
      title: BrandSnippet
      type: object
      properties:
        name:
          type: string
        value:
          type: string
      required:
        - name
        - value
    BrandsResponse:
      title: BrandsResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        results:
          type: array
          items:
            $ref: '#/components/schemas/Brand'
      required:
        - paging
        - results
    BrandSettingsEmail:
      title: BrandSettingsEmail
      type: object
      properties:
        templateOverride:
          $ref: '#/components/schemas/BrandTemplateOverride'
          nullable: true
        head:
          $ref: '#/components/schemas/EmailHead'
          nullable: true
        footer:
          $ref: '#/components/schemas/EmailFooter'
          nullable: true
        header:
          $ref: '#/components/schemas/EmailHeader'
          nullable: true
    EmailHead:
      title: EmailHead
      type: object
      properties:
        inheritDefault:
          type: boolean
        content:
          type: string
          nullable: true
      required:
        - inheritDefault
    EmailFooter:
      title: EmailFooter
      type: object
      properties:
        content:
          type: string
          nullable: true
        inheritDefault:
          type: boolean
          nullable: true
    EmailHeader:
      title: EmailHeader
      type: object
      properties:
        inheritDefault:
          type: boolean
          nullable: true
        barColor:
          type: string
          nullable: true
        logo:
          $ref: '#/components/schemas/Logo'
      required:
        - logo
    Logo:
      title: Logo
      type: object
      properties:
        href:
          type: string
          nullable: true
        image:
          type: string
          nullable: true
    BrandTemplate:
      title: BrandTemplate
      type: object
      properties:
        backgroundColor:
          type: string
          nullable: true
        blocksBackgroundColor:
          type: string
          nullable: true
        enabled:
          type: boolean
        footer:
          type: string
          nullable: true
        head:
          type: string
          nullable: true
        header:
          type: string
          nullable: true
        width:
          type: string
          nullable: true
      required:
        - enabled
    BrandTemplateOverride:
      title: BrandTemplateOverride
      type: object
      properties:
        mjml:
          $ref: '#/components/schemas/BrandTemplate'
        footerBackgroundColor:
          type: string
          nullable: true
        footerFullWidth:
          type: boolean
          nullable: true
      required:
        - mjml
      allOf:
        - $ref: '#/components/schemas/BrandTemplate'
    BrandSettingsSocialPresence:
      title: BrandSettingsSocialPresence
      type: object
      properties:
        inheritDefault:
          type: boolean
          nullable: true
        facebook:
          $ref: '#/components/schemas/BaseSocialPresence'
          nullable: true
        instagram:
          $ref: '#/components/schemas/BaseSocialPresence'
          nullable: true
        linkedin:
          $ref: '#/components/schemas/BaseSocialPresence'
          nullable: true
        medium:
          $ref: '#/components/schemas/BaseSocialPresence'
          nullable: true
        twitter:
          $ref: '#/components/schemas/BaseSocialPresence'
          nullable: true
    BaseSocialPresence:
      title: BaseSocialPresence
      type: object
      properties:
        url:
          type: string
      required:
        - url
    BrandSettingsInApp:
      title: BrandSettingsInApp
      type: object
      properties:
        borderRadius:
          type: string
          nullable: true
        disableMessageIcon:
          type: boolean
          nullable: true
        fontFamily:
          type: string
          nullable: true
        placement:
          $ref: '#/components/schemas/InAppPlacement'
          nullable: true
        widgetBackground:
          $ref: '#/components/schemas/WidgetBackground'
        colors:
          $ref: '#/components/schemas/BrandColors'
        icons:
          $ref: '#/components/schemas/Icons'
      required:
        - widgetBackground
        - colors
        - icons
    InAppPlacement:
      title: InAppPlacement
      type: string
      enum:
        - top
        - bottom
        - left
        - right
    WidgetBackground:
      title: WidgetBackground
      type: object
      properties:
        topColor:
          type: string
          nullable: true
        bottomColor:
          type: string
          nullable: true
    Icons:
      title: Icons
      type: object
      properties:
        bell:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
    BulkCreateJobResponse:
      title: BulkCreateJobResponse
      type: object
      properties:
        jobId:
          type: string
      required:
        - jobId
    InboundBulkMessage:
      title: InboundBulkMessage
      type: object
      description: >
        Bulk message definition. Supports two formats:

        - V1 format: Requires `event` field (event ID or notification ID)

        - V2 format: Optionally use `template` (notification ID) or `content` (Elemental content) in addition
        to `event`
      properties:
        brand:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties: true
          nullable: true
        event:
          type: string
          description: |
            Event ID or Notification ID (required). Can be either a 
            Notification ID (e.g., "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID 
            (e.g., "welcome-email") mapped to a notification.
        template:
          type: string
          nullable: true
          description: |
            Notification ID or template ID (optional, for V2 format). When provided, 
            this will be used instead of the notification associated with the `event` field.
        content:
          $ref: '#/components/schemas/Content'
          nullable: true
          description: |
            Elemental content (optional, for V2 format). When provided, this will be used 
            instead of the notification associated with the `event` field.
        locale:
          type: object
          additionalProperties:
            type: object
            additionalProperties: true
          nullable: true
        override:
          type: object
          additionalProperties: true
          nullable: true
      required:
        - event
    InboundBulkMessageV2:
      title: InboundBulkMessageV2
      oneOf:
        - $ref: '#/components/schemas/InboundBulkTemplateMessage'
        - $ref: '#/components/schemas/InboundBulkContentMessage'
    InboundBulkTemplateMessage:
      title: InboundBulkTemplateMessage
      type: object
      description: |
        V2 format bulk message using a template. For V1 format, use `event` field 
        in InboundBulkMessage instead.
      properties:
        template:
          type: string
          description: Notification ID or template ID
      required:
        - template
    InboundBulkContentMessage:
      title: InboundBulkContentMessage
      type: object
      properties:
        content:
          $ref: '#/components/schemas/Content'
      required:
        - content
    InboundBulkMessageUser:
      title: InboundBulkMessageUser
      type: object
      properties:
        preferences:
          $ref: '#/components/schemas/RecipientPreferences'
          nullable: true
        profile:
          type: object
          nullable: true
          description: |
            User profile information. For email-based bulk jobs, `profile.email` is required 
            for provider routing to determine if the message can be delivered. The email 
            address should be provided here rather than in `to.email`.
          additionalProperties: true
        recipient:
          type: string
          nullable: true
          description: User ID (legacy field, use profile or to.user_id instead)
        data:
          nullable: true
          description: User-specific data that will be merged with message.data
        to:
          $ref: '#/components/schemas/UserRecipient'
          nullable: true
          description: |
            Optional recipient information. Note: For email provider routing, use 
            `profile.email` instead of `to.email`. The `to` field is primarily used 
            for recipient identification and data merging.
    BulkIngestUsersParams:
      title: BulkIngestUsersParams
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/InboundBulkMessageUser'
      required:
        - users
    BulkIngestError:
      title: BulkIngestError
      type: object
      properties:
        user: {}
        error: {}
      required:
        - user
        - error
    BulkIngestUsersResponse:
      title: BulkIngestUsersResponse
      type: object
      properties:
        total:
          type: integer
        errors:
          type: array
          items:
            $ref: '#/components/schemas/BulkIngestError'
          nullable: true
      required:
        - total
    BulkGetJobParams:
      title: BulkGetJobParams
      type: object
      properties:
        jobId:
          type: string
      required:
        - jobId
    BulkJobStatus:
      title: BulkJobStatus
      type: string
      enum:
        - CREATED
        - PROCESSING
        - COMPLETED
        - ERROR
    BulkJobUserStatus:
      title: BulkJobUserStatus
      type: string
      enum:
        - PENDING
        - ENQUEUED
        - ERROR
    BulkGetJobResponse:
      title: BulkGetJobResponse
      type: object
      properties:
        job:
          $ref: '#/components/schemas/JobDetails'
      required:
        - job
    JobDetails:
      title: JobDetails
      type: object
      properties:
        definition:
          $ref: '#/components/schemas/InboundBulkMessage'
        enqueued:
          type: integer
        failures:
          type: integer
        received:
          type: integer
        status:
          $ref: '#/components/schemas/BulkJobStatus'
      required:
        - definition
        - enqueued
        - failures
        - received
        - status
    BulkGetJobUsersParams:
      title: BulkGetJobUsersParams
      type: object
      properties:
        jobId:
          type: string
        cursor:
          type: string
          nullable: true
      required:
        - jobId
    BulkMessageUserResponse:
      title: BulkMessageUserResponse
      type: object
      properties:
        status:
          $ref: '#/components/schemas/BulkJobUserStatus'
        messageId:
          type: string
          nullable: true
      required:
        - status
      allOf:
        - $ref: '#/components/schemas/InboundBulkMessageUser'
    BulkGetJobUsersResponse:
      title: BulkGetJobUsersResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BulkMessageUserResponse'
        paging:
          $ref: '#/components/schemas/Paging'
      required:
        - items
        - paging
    Provider:
      title: Provider
      type: object
      description: A configured provider in the workspace.
      properties:
        id:
          type: string
          description: A unique identifier for the provider configuration.
        title:
          type: string
          description: Display title. Defaults to "Default Configuration" when not explicitly set.
        provider:
          type: string
          description: The provider key (e.g. "sendgrid", "twilio", "slack").
        alias:
          type: string
          description: Optional alias for this configuration.
        settings:
          type: object
          description: Provider-specific settings (snake_case keys on the wire).
          additionalProperties: true
        created:
          type: integer
          description: Unix timestamp (ms) of when the provider was created.
        updated:
          type: integer
          nullable: true
          description: Unix timestamp (ms) of when the provider was last updated.
      required:
        - id
        - title
        - provider
        - settings
        - created
    ProvidersCreateRequest:
      title: ProvidersCreateRequest
      type: object
      description: Request body for creating a new provider configuration.
      properties:
        provider:
          type: string
          maxLength: 128
          description: >-
            The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a known Courier
            provider — see the catalog endpoint for valid keys.
        title:
          type: string
          description: Optional display title. Omit to use "Default Configuration".
        alias:
          type: string
          description: Optional alias for this configuration.
        settings:
          type: object
          description: >-
            Provider-specific settings (snake_case keys). Defaults to an empty object when omitted. Use the
            catalog endpoint to discover required fields for a given provider — omitting a required field
            returns a 400 validation error.
          additionalProperties: true
      required:
        - provider
    ProvidersUpdateRequest:
      title: ProvidersUpdateRequest
      type: object
      description: >-
        Request body for replacing an existing provider configuration. The `provider` key is required because
        it determines which provider-specific settings schema is validated against. Changing the provider type
        for an existing configuration is not supported. All other fields are optional — omitted fields are
        cleared from the stored configuration (this is a full replacement, not a partial merge).
      properties:
        provider:
          type: string
          maxLength: 128
          description: >-
            The provider key identifying the type. Required on every request because it selects the
            provider-specific settings schema for validation.
        title:
          type: string
          description: Updated display title.
        alias:
          type: string
          description: Updated alias. Omit to clear.
        settings:
          type: object
          description: >-
            Provider-specific settings (snake_case keys). Replaces the full settings object — omitted settings
            fields are removed. Use the catalog endpoint to check required fields.
          additionalProperties: true
      required:
        - provider
    ProvidersListResponse:
      title: ProvidersListResponse
      type: object
      description: Paginated list of provider configurations.
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        results:
          type: array
          items:
            $ref: '#/components/schemas/Provider'
      required:
        - paging
        - results
    ProviderSchemaField:
      title: ProviderSchemaField
      type: object
      description: Describes a single configuration field in the provider catalog.
      properties:
        type:
          type: string
          description: The field's data type (e.g. "string", "boolean", "enum").
        required:
          type: boolean
          description: Whether this field is required when configuring the provider.
        values:
          type: array
          items:
            type: string
          description: Allowed values when `type` is "enum".
      required:
        - type
        - required
    ProvidersCatalogEntry:
      title: ProvidersCatalogEntry
      type: object
      description: >-
        A provider type from the catalog. Contains the key, display name, description, and a `settings` object
        describing configuration schema fields.
      properties:
        provider:
          type: string
          description: The provider key (e.g. "sendgrid", "twilio").
        name:
          type: string
          description: Human-readable display name.
        description:
          type: string
          description: Short description of the provider.
        channel:
          type: string
          description: Courier taxonomy channel (e.g. email, push, sms, direct_message, inbox, webhook).
        settings:
          type: object
          description: >-
            Map of setting field names (snake_case) to their schema descriptors. Each descriptor has `type`
            and `required`. Empty when the provider has no configurable schema.
          additionalProperties:
            $ref: '#/components/schemas/ProviderSchemaField'
      required:
        - provider
        - name
        - description
        - channel
        - settings
    ProvidersCatalogResponse:
      title: ProvidersCatalogResponse
      type: object
      description: Paginated list of available provider types with their configuration schemas.
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProvidersCatalogEntry'
      required:
        - paging
        - results
    BaseError:
      title: BaseError
      type: object
      properties:
        message:
          type: string
          description: A message describing the error that occurred.
      required:
        - message
    BadRequest:
      title: BadRequest
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    PaymentRequired:
      title: PaymentRequired
      type: object
      properties:
        type:
          type: string
          enum:
            - authorization_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    AlreadyExists:
      title: AlreadyExists
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    Conflict:
      title: Conflict
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    NotFound:
      title: NotFound
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    UnprocessableEntity:
      title: UnprocessableEntity
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    MessageNotFound:
      title: MessageNotFound
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    InboundTrackEvent:
      title: InboundTrackEvent
      type: object
      properties:
        event:
          type: string
          description: >-
            A descriptive name of the event. This name will appear as a trigger in the Courier Automation
            Trigger node.
          example: New Order Placed
        messageId:
          type: string
          description: >-
            A required unique identifier that will be used to de-duplicate requests. If not unique, will
            respond with 409 Conflict status
          example: 4c62c457-b329-4bea-9bfc-17bba86c393f
        properties:
          type: object
          additionalProperties: true
        type:
          type: string
          enum:
            - track
        userId:
          type: string
          nullable: true
          description: The user id associated with the track
      required:
        - event
        - messageId
        - properties
        - type
    TrackAcceptedResponse:
      title: TrackAcceptedResponse
      type: object
      properties:
        messageId:
          type: string
          description: A successful call returns a `202` status code along with a `requestId` in the response body.
          example: 1-65f240a0-47a6a120c8374de9bcf9f22c
      required:
        - messageId
    SubscriptionList:
      title: SubscriptionList
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        created:
          type: string
          nullable: true
        updated:
          type: string
          nullable: true
      required:
        - id
        - name
    ListPutParams:
      title: ListPutParams
      type: object
      properties:
        name:
          type: string
        preferences:
          $ref: '#/components/schemas/RecipientPreferences'
          nullable: true
      required:
        - name
    ListGetAllResponse:
      title: ListGetAllResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        items:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionList'
      required:
        - paging
        - items
    ListSubscriptionRecipient:
      title: ListSubscriptionRecipient
      type: object
      properties:
        recipientId:
          type: string
        created:
          type: string
          nullable: true
        preferences:
          $ref: '#/components/schemas/RecipientPreferences'
          nullable: true
      required:
        - recipientId
    ListGetSubscriptionsResponse:
      title: ListGetSubscriptionsResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        items:
          type: array
          items:
            $ref: '#/components/schemas/ListSubscriptionRecipient'
      required:
        - paging
        - items
    PutSubscriptionsRecipient:
      title: PutSubscriptionsRecipient
      type: object
      properties:
        recipientId:
          type: string
        preferences:
          $ref: '#/components/schemas/RecipientPreferences'
          nullable: true
      required:
        - recipientId
    RecipientPreferences:
      title: RecipientPreferences
      type: object
      properties:
        categories:
          $ref: '#/components/schemas/NotificationPreferences'
          nullable: true
        notifications:
          $ref: '#/components/schemas/NotificationPreferences'
          nullable: true
    NotificationPreferences:
      title: NotificationPreferences
      type: object
      additionalProperties:
        $ref: '#/components/schemas/NotificationPreferenceDetails'
    NotificationPreferenceDetails:
      title: NotificationPreferenceDetails
      type: object
      properties:
        status:
          $ref: '#/components/schemas/PreferenceStatus'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
          nullable: true
        channel_preferences:
          type: array
          items:
            $ref: '#/components/schemas/ChannelPreference'
          nullable: true
      required:
        - status
    MessageStatus:
      title: MessageStatus
      type: string
      enum:
        - CANCELED
        - CLICKED
        - DELAYED
        - DELIVERED
        - DIGESTED
        - ENQUEUED
        - FILTERED
        - OPENED
        - ROUTED
        - SENT
        - SIMULATED
        - THROTTLED
        - UNDELIVERABLE
        - UNMAPPED
        - UNROUTABLE
    MessageDetails:
      title: MessageDetails
      type: object
      properties:
        id:
          type: string
          description: A unique identifier associated with the message you wish to retrieve (results from a send).
        status:
          $ref: '#/components/schemas/MessageStatus'
          description: The current status of the message.
        enqueued:
          type: integer
          format: int64
          description: >-
            A UTC timestamp at which Courier received the message request. Stored as a millisecond
            representation of the Unix epoch.
        sent:
          type: integer
          format: int64
          description: >-
            A UTC timestamp at which Courier passed the message to the Integration provider. Stored as a
            millisecond representation of the Unix epoch.
        delivered:
          type: integer
          format: int64
          description: >-
            A UTC timestamp at which the Integration provider delivered the message. Stored as a millisecond
            representation of the Unix epoch.
        opened:
          type: integer
          format: int64
          description: >-
            A UTC timestamp at which the recipient opened a message for the first time. Stored as a
            millisecond representation of the Unix epoch.
        clicked:
          type: integer
          format: int64
          description: >-
            A UTC timestamp at which the recipient clicked on a tracked link for the first time. Stored as a
            millisecond representation of the Unix epoch.
        recipient:
          type: string
          description: A unique identifier associated with the recipient of the delivered message.
        event:
          type: string
          description: A unique identifier associated with the event of the delivered message.
        notification:
          type: string
          description: A unique identifier associated with the notification of the delivered message.
        error:
          type: string
          nullable: true
          description: A message describing the error that occurred.
        reason:
          $ref: '#/components/schemas/Reason'
          nullable: true
          description: The reason for the current status of the message.
      required:
        - id
        - status
        - enqueued
        - recipient
        - event
        - notification
    MessageDetailsExtended:
      title: MessageDetailsExtended
      type: object
      properties:
        providers:
          type: array
          items:
            type: object
            additionalProperties: true
          nullable: true
      allOf:
        - $ref: '#/components/schemas/MessageDetails'
    Reason:
      title: Reason
      type: string
      enum:
        - BOUNCED
        - FAILED
        - FILTERED
        - NO_CHANNELS
        - NO_PROVIDERS
        - OPT_IN_REQUIRED
        - PROVIDER_ERROR
        - UNPUBLISHED
        - UNSUBSCRIBED
    ListMessagesResponse:
      title: ListMessagesResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
          description: Paging information for the result set.
        results:
          type: array
          items:
            $ref: '#/components/schemas/MessageDetails'
          description: An array of messages with their details.
      required:
        - paging
        - results
    MessageHistoryResponse:
      title: MessageHistoryResponse
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            additionalProperties: true
      required:
        - results
    RenderOutputResponse:
      title: RenderOutputResponse
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/RenderOutput'
          description: An array of render output of a previously sent message.
      required:
        - results
    RenderedMessageBlock:
      title: RenderedMessageBlock
      type: object
      properties:
        type:
          type: string
          description: The block type of the rendered message block.
        text:
          type: string
          description: The block text of the rendered message block.
      required:
        - type
        - text
    RenderedMessageContent:
      title: RenderedMessageContent
      type: object
      properties:
        html:
          type: string
          description: The html content of the rendered message.
        title:
          type: string
          description: The title of the rendered message.
        body:
          type: string
          description: The body of the rendered message.
        subject:
          type: string
          description: The subject of the rendered message.
        text:
          type: string
          description: The text of the rendered message.
        blocks:
          type: array
          items:
            $ref: '#/components/schemas/RenderedMessageBlock'
          description: The blocks of the rendered message.
      required:
        - html
        - title
        - body
        - subject
        - text
        - blocks
    RenderOutput:
      title: RenderOutput
      type: object
      properties:
        channel:
          type: string
          description: The channel used for rendering the message.
        channel_id:
          type: string
          description: The ID of channel used for rendering the message.
        content:
          $ref: '#/components/schemas/RenderedMessageContent'
          description: Content details of the rendered message.
      required:
        - channel
        - channel_id
        - content
    NotificationListResponse:
      title: NotificationListResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        results:
          type: array
          description: Notification templates in this workspace.
          items:
            oneOf:
              - $ref: '#/components/schemas/Notification'
              - $ref: '#/components/schemas/NotificationTemplateSummary'
      required:
        - paging
        - results
    NotificationGetContentResponse:
      title: NotificationGetContentResponse
      type: object
      properties:
        blocks:
          type: array
          items:
            $ref: '#/components/schemas/NotificationBlock'
          nullable: true
        channels:
          type: array
          items:
            $ref: '#/components/schemas/NotificationChannel'
          nullable: true
        checksum:
          type: string
          nullable: true
    Notification:
      title: Notification
      type: object
      properties:
        created_at:
          type: integer
          format: int64
        updated_at:
          type: integer
          format: int64
        id:
          type: string
        routing:
          $ref: '#/components/schemas/MessageRouting'
        tags:
          $ref: '#/components/schemas/NotificationTag'
          nullable: true
        title:
          type: string
          nullable: true
        topic_id:
          type: string
        note:
          type: string
        event_ids:
          type: array
          items:
            type: string
          description: Array of event IDs associated with this notification
      required:
        - created_at
        - updated_at
        - id
        - routing
        - topic_id
        - event_ids
    NotificationTag:
      title: NotificationTag
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/NotificationTagData'
      required:
        - data
    NotificationTagData:
      title: NotificationTagData
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
    NotificationBlock:
      title: NotificationBlock
      type: object
      properties:
        alias:
          type: string
          nullable: true
        context:
          type: string
          nullable: true
        id:
          type: string
        type:
          $ref: '#/components/schemas/BlockType'
        content:
          $ref: '#/components/schemas/NotificationContent'
          nullable: true
        locales:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NotificationContent'
          nullable: true
        checksum:
          type: string
          nullable: true
      required:
        - id
        - type
    NotificationContent:
      title: NotificationContent
      oneOf:
        - type: string
        - $ref: '#/components/schemas/NotificationContentHierarchy'
    NotificationContentHierarchy:
      title: NotificationContentHierarchy
      type: object
      properties:
        parent:
          type: string
          nullable: true
        children:
          type: string
          nullable: true
    BlockType:
      title: BlockType
      type: string
      enum:
        - action
        - divider
        - image
        - jsonnet
        - list
        - markdown
        - quote
        - template
        - text
    NotificationChannel:
      title: NotificationChannel
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          nullable: true
        content:
          $ref: '#/components/schemas/NotificationChannelContent'
          nullable: true
        locales:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NotificationChannelContent'
          nullable: true
        checksum:
          type: string
          nullable: true
      required:
        - id
    NotificationChannelContent:
      title: NotificationChannelContent
      type: object
      properties:
        subject:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
    NotificationTemplatePayload:
      title: NotificationTemplatePayload
      type: object
      description: >-
        Core template fields used in POST and PUT request bodies (nested under a `notification` key) and
        returned at the top level in responses.
      properties:
        name:
          type: string
          description: Display name for the template.
        tags:
          type: array
          items:
            type: string
          description: Tags for categorization. Send empty array for none.
        brand:
          nullable: true
          type: object
          description: Brand reference, or null for no brand.
          properties:
            id:
              type: string
          required:
            - id
        subscription:
          nullable: true
          type: object
          description: Subscription topic reference, or null for none.
          properties:
            topic_id:
              type: string
          required:
            - topic_id
        routing:
          nullable: true
          type: object
          description: Routing strategy reference, or null for none.
          properties:
            strategy_id:
              type: string
          required:
            - strategy_id
        content:
          $ref: '#/components/schemas/ElementalContent'
          description: Elemental content definition.
      required:
        - name
        - tags
        - brand
        - subscription
        - routing
        - content
    NotificationTemplateCreateRequest:
      title: NotificationTemplateCreateRequest
      type: object
      description: Request body for creating a notification template.
      properties:
        notification:
          $ref: '#/components/schemas/NotificationTemplatePayload'
        state:
          type: string
          description: >-
            Template state after creation. Case-insensitive input, normalized to uppercase in the response.
            Defaults to "DRAFT".
          enum:
            - DRAFT
            - PUBLISHED
          default: DRAFT
      required:
        - notification
    NotificationTemplateUpdateRequest:
      title: NotificationTemplateUpdateRequest
      type: object
      description: >-
        Request body for replacing a notification template. Same shape as create. All fields required (PUT =
        full replacement).
      properties:
        notification:
          $ref: '#/components/schemas/NotificationTemplatePayload'
        state:
          type: string
          description: >-
            Template state after update. Case-insensitive input, normalized to uppercase in the response.
            Defaults to "DRAFT".
          enum:
            - DRAFT
            - PUBLISHED
          default: DRAFT
      required:
        - notification
    NotificationTemplateMutationResponse:
      title: NotificationTemplateMutationResponse
      type: object
      deprecated: true
      description: >-
        Deprecated — mutation endpoints now return NotificationTemplateResponse. Retained for backward
        compatibility with generated SDKs.
      properties:
        notification:
          type: object
          properties:
            id:
              type: string
              description: The ID of the created or updated template.
          required:
            - id
        state:
          type: string
          description: The template state after the operation. Always uppercase.
          enum:
            - DRAFT
            - PUBLISHED
      required:
        - notification
        - state
    NotificationTemplateResponse:
      title: NotificationTemplateResponse
      description: >-
        Response for GET /notifications/{id}, POST /notifications, and PUT /notifications/{id}. Returns all
        template fields at the top level.
      allOf:
        - $ref: '#/components/schemas/NotificationTemplatePayload'
        - type: object
          properties:
            id:
              type: string
              description: The template ID.
            state:
              type: string
              description: The template state. Always uppercase.
              enum:
                - DRAFT
                - PUBLISHED
            created:
              type: integer
              format: int64
              description: Epoch milliseconds when the template was created.
            creator:
              type: string
              description: User ID of the creator.
            updated:
              type: integer
              format: int64
              description: Epoch milliseconds of last update.
            updater:
              type: string
              description: User ID of the last updater.
          required:
            - id
            - state
            - created
            - creator
    NotificationTemplateSummary:
      title: NotificationTemplateSummary
      type: object
      description: V2 (CDS) template summary returned in list responses.
      properties:
        id:
          type: string
        name:
          type: string
        tags:
          type: array
          items:
            type: string
        state:
          type: string
          enum:
            - DRAFT
            - PUBLISHED
        created:
          type: integer
          format: int64
          description: Epoch milliseconds when the template was created.
        creator:
          type: string
          description: User ID of the creator.
        updated:
          type: integer
          format: int64
          description: Epoch milliseconds of last update.
        updater:
          type: string
          description: User ID of the last updater.
      required:
        - id
        - name
        - tags
        - state
        - created
        - creator
    VersionNode:
      title: VersionNode
      type: object
      description: A version entry for a notification template.
      properties:
        version:
          type: string
          description: >-
            Version identifier. One of "draft", "published:vNNN" (current published version), or "vNNN"
            (historical version).
        created:
          type: integer
          format: int64
          description: Epoch milliseconds when this version was created.
        creator:
          type: string
          description: User ID of the version creator.
        has_changes:
          type: boolean
          description: Whether the draft has unpublished changes. Only present on the draft version.
      required:
        - version
        - created
        - creator
    NotificationTemplateVersionListResponse:
      title: NotificationTemplateVersionListResponse
      type: object
      properties:
        versions:
          type: array
          items:
            $ref: '#/components/schemas/VersionNode'
        paging:
          $ref: '#/components/schemas/Paging'
      required:
        - versions
        - paging
    NotificationTemplatePublishRequest:
      title: NotificationTemplatePublishRequest
      type: object
      description: >-
        Optional request body for publishing a notification template. Omit or send an empty object to publish
        the current draft.
      properties:
        version:
          type: string
          pattern: ^v\d+$
          description: Historical version to publish (e.g. "v001"). Omit to publish the current draft.
    BaseCheck:
      title: BaseCheck
      type: object
      properties:
        id:
          type: string
        status:
          $ref: '#/components/schemas/CheckStatus'
        type:
          type: string
          enum:
            - custom
      required:
        - id
        - status
        - type
    Check:
      title: Check
      type: object
      properties:
        updated:
          type: integer
          format: int64
      required:
        - updated
      allOf:
        - $ref: '#/components/schemas/BaseCheck'
    CheckStatus:
      title: CheckStatus
      type: string
      enum:
        - RESOLVED
        - FAILED
        - PENDING
    SubmissionChecksGetResponse:
      title: SubmissionChecksGetResponse
      type: object
      properties:
        checks:
          type: array
          items:
            $ref: '#/components/schemas/Check'
      required:
        - checks
    SubmissionChecksReplaceResponse:
      title: SubmissionChecksReplaceResponse
      type: object
      properties:
        checks:
          type: array
          items:
            $ref: '#/components/schemas/Check'
      required:
        - checks
    NotificationTemplateState:
      title: NotificationTemplateState
      type: string
      description: Template state. Defaults to `DRAFT`.
      enum:
        - DRAFT
        - PUBLISHED
      default: DRAFT
    NotificationContentGetResponse:
      title: NotificationContentGetResponse
      type: object
      description: Elemental content response for V2 templates. Contains versioned elements with content checksums.
      properties:
        version:
          type: string
          description: Content version identifier.
          example: '2022-01-01'
        elements:
          type: array
          items:
            $ref: '#/components/schemas/ElementWithChecksums'
      required:
        - version
        - elements
    ElementWithChecksums:
      title: ElementWithChecksums
      type: object
      description: An element with its content checksum and optional nested elements and locale checksums.
      properties:
        id:
          type: string
        checksum:
          type: string
          description: MD5 hash of translatable content.
        type:
          type: string
          description: Element type (text, meta, action, etc.).
        elements:
          type: array
          items:
            $ref: '#/components/schemas/ElementWithChecksums'
          description: Nested child elements (for group-type elements).
        locales:
          type: object
          additionalProperties:
            type: object
            properties:
              checksum:
                type: string
            required:
              - checksum
          description: Locale-specific content with checksums.
      required:
        - checksum
        - type
      additionalProperties: true
    NotificationContentPutRequest:
      title: NotificationContentPutRequest
      type: object
      description: Request body for replacing the elemental content of a notification template.
      properties:
        content:
          type: object
          description: Elemental content payload. The server defaults `version` when omitted.
          properties:
            version:
              type: string
              description: Content version identifier (e.g., `2022-01-01`). Optional; server defaults when omitted.
            elements:
              type: array
              items:
                $ref: '#/components/schemas/ElementalNode'
          required:
            - elements
        state:
          $ref: '#/components/schemas/NotificationTemplateState'
      required:
        - content
    NotificationContentMutationResponse:
      title: NotificationContentMutationResponse
      type: object
      description: >-
        Shared mutation response for `PUT` content, `PUT` element, and `PUT` locale operations. Contains the
        template ID, content version, per-element checksums, and resulting state.
      properties:
        id:
          type: string
          description: Template ID.
        version:
          type: string
          description: Content version identifier.
        elements:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              checksum:
                type: string
            required:
              - id
              - checksum
        state:
          $ref: '#/components/schemas/NotificationTemplateState'
      required:
        - id
        - version
        - elements
        - state
    NotificationElementPutRequest:
      title: NotificationElementPutRequest
      type: object
      description: Request body for updating a single element. Additional type-specific fields are allowed.
      properties:
        type:
          type: string
          description: Element type (text, meta, action, image, etc.).
        channels:
          type: array
          items:
            type: string
        data:
          type: object
          additionalProperties: true
        if:
          type: string
        loop:
          type: string
        ref:
          type: string
        state:
          $ref: '#/components/schemas/NotificationTemplateState'
      required:
        - type
      additionalProperties: true
    NotificationLocalePutRequest:
      title: NotificationLocalePutRequest
      type: object
      description: >-
        Request body for setting locale-specific content overrides. Each element override must include the
        target element ID.
      properties:
        elements:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Target element ID.
            required:
              - id
            additionalProperties: true
          description: Elements with locale-specific content overrides.
        state:
          $ref: '#/components/schemas/NotificationTemplateState'
      required:
        - elements
    Address:
      title: Address
      type: object
      properties:
        formatted:
          type: string
        street_address:
          type: string
        locality:
          type: string
        region:
          type: string
        postal_code:
          type: string
        country:
          type: string
      required:
        - formatted
        - street_address
        - locality
        - region
        - postal_code
        - country
    ProfileGetResponse:
      title: ProfileGetResponse
      type: object
      properties:
        profile:
          type: object
          additionalProperties: true
        preferences:
          $ref: '#/components/schemas/RecipientPreferences'
          nullable: true
      required:
        - profile
    MergeProfileResponse:
      title: MergeProfileResponse
      type: object
      properties:
        status:
          type: string
          enum:
            - SUCCESS
      required:
        - status
    ReplaceProfileResponse:
      title: ReplaceProfileResponse
      type: object
      properties:
        status:
          type: string
          enum:
            - SUCCESS
      required:
        - status
    ProfileUpdateRequest:
      title: ProfileUpdateRequest
      type: object
      properties:
        patch:
          type: array
          items:
            $ref: '#/components/schemas/UserProfilePatch'
          description: List of patch operations to apply to the profile.
      required:
        - patch
    UserProfilePatch:
      title: UserProfilePatch
      type: object
      properties:
        op:
          type: string
          description: The operation to perform.
        path:
          type: string
          description: The JSON path specifying the part of the profile to operate on.
        value:
          type: string
          description: The value for the operation.
      required:
        - op
        - path
        - value
    SubscribeToListsRequest:
      title: SubscribeToListsRequest
      type: object
      properties:
        lists:
          type: array
          items:
            $ref: '#/components/schemas/SubscribeToListsRequestItem'
      required:
        - lists
    SubscribeToListsRequestItem:
      title: SubscribeToListsRequestItem
      type: object
      properties:
        listId:
          type: string
        preferences:
          $ref: '#/components/schemas/RecipientPreferences'
          nullable: true
      required:
        - listId
    SubscribeToListsResponse:
      title: SubscribeToListsResponse
      type: object
      properties:
        status:
          type: string
          enum:
            - SUCCESS
      required:
        - status
    DeleteListSubscriptionResponse:
      title: DeleteListSubscriptionResponse
      type: object
      properties:
        status:
          type: string
          enum:
            - SUCCESS
      required:
        - status
    GetListSubscriptionsItem:
      title: GetListSubscriptionsItem
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: List name
        created:
          type: string
          description: The date/time of when the list was created. Represented as a string in ISO format.
        updated:
          type: string
          description: The date/time of when the list was updated. Represented as a string in ISO format.
        preferences:
          $ref: '#/components/schemas/RecipientPreferences'
          nullable: true
      required:
        - id
        - name
        - created
        - updated
    GetListSubscriptionsResponse:
      title: GetListSubscriptionsResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        results:
          type: array
          items:
            $ref: '#/components/schemas/GetListSubscriptionsItem'
          description: An array of lists
      required:
        - paging
        - results
    Tenant:
      title: Tenant
      type: object
      properties:
        id:
          type: string
          description: Id of the tenant.
        name:
          type: string
          description: Name of the tenant.
        parent_tenant_id:
          type: string
          nullable: true
          description: Tenant's parent id (if any).
        default_preferences:
          $ref: '#/components/schemas/DefaultPreferences'
          nullable: true
          description: Defines the preferences used for the account when the user hasn't specified their own.
        properties:
          type: object
          additionalProperties: true
          nullable: true
          description: Arbitrary properties accessible to a template.
        user_profile:
          type: object
          additionalProperties: true
          nullable: true
          description: A user profile object merged with user profile on send.
        brand_id:
          type: string
          nullable: true
          description: Brand to be used for the account when one is not specified by the send call.
      required:
        - id
        - name
    DefaultPreferences:
      title: DefaultPreferences
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionTopic'
          nullable: true
    SubscriptionTopicNew:
      title: SubscriptionTopicNew
      type: object
      properties:
        status:
          $ref: '#/components/schemas/SubscriptionTopicStatus'
        has_custom_routing:
          type: boolean
          nullable: true
          description: >-
            Override channel routing with custom preferences. This will override any template preferences that
            are set, but a user can still customize their preferences
        custom_routing:
          type: array
          items:
            $ref: '#/components/schemas/ChannelClassification'
          nullable: true
          description: The default channels to send to this tenant when has_custom_routing is enabled
      required:
        - status
    SubscriptionTopic:
      title: SubscriptionTopic
      type: object
      properties:
        id:
          type: string
          description: Topic ID
      required:
        - id
      allOf:
        - $ref: '#/components/schemas/SubscriptionTopicNew'
    SubscriptionTopicStatus:
      title: SubscriptionTopicStatus
      type: string
      enum:
        - OPTED_OUT
        - OPTED_IN
        - REQUIRED
    TenantListResponse:
      title: TenantListResponse
      type: object
      properties:
        cursor:
          type: string
          nullable: true
          description: A pointer to the next page of results. Defined only when has_more is set to true.
        has_more:
          type: boolean
          description: Set to true when there are more pages that can be retrieved.
        items:
          type: array
          items:
            $ref: '#/components/schemas/Tenant'
          description: An array of Tenants
        next_url:
          type: string
          nullable: true
          description: |-
            A url that may be used to generate fetch the next set of results. 
            Defined only when has_more is set to true
        url:
          type: string
          description: A url that may be used to generate these results.
        type:
          type: string
          enum:
            - list
          description: Always set to "list". Represents the type of this object.
      required:
        - has_more
        - items
        - url
        - type
    ListUsersForTenantResponse:
      title: ListUsersForTenantResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/UserTenantAssociation'
          nullable: true
        has_more:
          type: boolean
          description: Set to true when there are more pages that can be retrieved.
        url:
          type: string
          description: A url that may be used to generate these results.
        next_url:
          type: string
          nullable: true
          description: |-
            A url that may be used to generate fetch the next set of results. 
            Defined only when `has_more` is set to true
        cursor:
          type: string
          nullable: true
          description: |-
            A pointer to the next page of results. Defined 
            only when `has_more` is set to true
        type:
          type: string
          enum:
            - list
          description: Always set to `list`. Represents the type of this object.
      required:
        - has_more
        - url
        - type
    UserTenantAssociation:
      title: UserTenantAssociation
      type: object
      properties:
        user_id:
          type: string
          nullable: true
          description: User ID for the association between tenant and user
        type:
          type: string
          enum:
            - user
          nullable: true
        tenant_id:
          type: string
          description: Tenant ID for the association between tenant and user
        profile:
          type: object
          additionalProperties: true
          nullable: true
          description: Additional metadata to be applied to a user profile when used in a tenant context
      required:
        - tenant_id
    GetTemplateByTenantResponse:
      title: GetTemplateByTenantResponse
      type: object
      properties: {}
      allOf:
        - $ref: '#/components/schemas/SingleTemplateTenantAssociation'
    ListTemplatesByTenantResponse:
      title: ListTemplatesByTenantResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ListTemplateTenantAssociation'
          nullable: true
        has_more:
          type: boolean
          description: Set to true when there are more pages that can be retrieved.
        url:
          type: string
          description: A url that may be used to generate these results.
        next_url:
          type: string
          nullable: true
          description: |-
            A url that may be used to generate fetch the next set of results. 
            Defined only when `has_more` is set to true
        cursor:
          type: string
          nullable: true
          description: |-
            A pointer to the next page of results. Defined 
            only when `has_more` is set to true
        type:
          type: string
          enum:
            - list
          description: Always set to `list`. Represents the type of this object.
      required:
        - has_more
        - url
        - type
    BaseTemplateTenantAssociation:
      title: BaseTemplateTenantAssociation
      type: object
      properties:
        id:
          type: string
          description: The template's id
        created_at:
          type: string
          description: The timestamp at which the template was created
        updated_at:
          type: string
          description: The timestamp at which the template was last updated
        published_at:
          type: string
          description: The timestamp at which the template was published
        version:
          type: string
          description: The version of the template
      required:
        - id
        - created_at
        - updated_at
        - published_at
        - version
    SingleTemplateTenantAssociation:
      title: SingleTemplateTenantAssociation
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TenantTemplateData'
      required:
        - data
      allOf:
        - $ref: '#/components/schemas/BaseTemplateTenantAssociation'
    ListTemplateTenantAssociation:
      title: ListTemplateTenantAssociation
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TenantTemplateDataNoContent'
      required:
        - data
      allOf:
        - $ref: '#/components/schemas/BaseTemplateTenantAssociation'
    TenantTemplateData:
      title: TenantTemplateData
      type: object
      description: The template's data containing it's routing configs and Elemental content
      properties:
        routing:
          $ref: '#/components/schemas/MessageRouting'
        content:
          $ref: '#/components/schemas/ElementalContent'
      required:
        - routing
        - content
    TenantTemplateDataNoContent:
      title: TenantTemplateDataNoContent
      type: object
      description: The template's data containing it's routing configs
      properties:
        routing:
          $ref: '#/components/schemas/MessageRouting'
      required:
        - routing
    PutTenantTemplateRequest:
      title: PutTenantTemplateRequest
      type: object
      description: Request body for creating or updating a tenant notification template
      properties:
        published:
          type: boolean
          default: false
          description: >-
            Whether to publish the template immediately after saving. When true, the template becomes the
            active/published version. When false (default), the template is saved as a draft.
        template:
          $ref: '#/components/schemas/TenantTemplateInput'
      required:
        - template
    TenantTemplateInput:
      title: TenantTemplateInput
      type: object
      description: Template configuration for creating or updating a tenant notification template
      properties:
        channels:
          $ref: '#/components/schemas/MessageChannels'
          description: Channel-specific delivery configuration (email, SMS, push, etc.)
        content:
          $ref: '#/components/schemas/ElementalContent'
          description: Template content configuration including blocks, elements, and message structure
        providers:
          $ref: '#/components/schemas/MessageProviders'
          description: Provider-specific delivery configuration for routing to specific email/SMS providers
        routing:
          $ref: '#/components/schemas/MessageRouting'
          description: Message routing configuration for multi-channel delivery strategies
      required:
        - content
    PutTenantTemplateResponse:
      title: PutTenantTemplateResponse
      type: object
      description: Response from creating or updating a tenant notification template
      properties:
        id:
          type: string
          description: The template ID
        version:
          type: string
          description: The version of the saved template
        published_at:
          type: string
          nullable: true
          description: >-
            The timestamp when the template was published. Only present if the template was published as part
            of this request.
      required:
        - id
        - version
    PostTenantTemplatePublishRequest:
      title: PostTenantTemplatePublishRequest
      type: object
      description: Request body for publishing a tenant template version
      properties:
        version:
          type: string
          default: latest
          description: >-
            The version of the template to publish (e.g., "v1", "v2", "latest"). If not provided, defaults to
            "latest".
    PostTenantTemplatePublishResponse:
      title: PostTenantTemplatePublishResponse
      type: object
      description: Response from publishing a tenant template
      properties:
        id:
          type: string
          description: The template ID
        version:
          type: string
          description: The published version of the template
        published_at:
          type: string
          description: The timestamp when the template was published
      required:
        - id
        - version
        - published_at
    PayloadTooLarge:
      title: PayloadTooLarge
      type: object
      description: Error returned when the request payload exceeds the maximum allowed size
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    RoutingStrategyCreateRequest:
      title: RoutingStrategyCreateRequest
      type: object
      description: Request body for creating a routing strategy.
      properties:
        name:
          type: string
          description: Human-readable name for the routing strategy.
        description:
          type: string
          nullable: true
          description: Optional description of the routing strategy.
        tags:
          type: array
          items:
            type: string
          nullable: true
          description: Optional tags for categorization.
        routing:
          $ref: '#/components/schemas/MessageRouting'
          description: Routing tree defining channel selection method and order.
        channels:
          $ref: '#/components/schemas/MessageChannels'
          nullable: true
          description: Per-channel delivery configuration. Defaults to empty if omitted.
        providers:
          $ref: '#/components/schemas/MessageProviders'
          nullable: true
          description: Per-provider delivery configuration. Defaults to empty if omitted.
      required:
        - name
        - routing
    RoutingStrategyReplaceRequest:
      title: RoutingStrategyReplaceRequest
      type: object
      description: >-
        Request body for replacing a routing strategy. Full document replacement; missing optional fields are
        cleared.
      properties:
        name:
          type: string
          description: Human-readable name for the routing strategy.
        description:
          type: string
          nullable: true
          description: Optional description. Omit or null to clear.
        tags:
          type: array
          items:
            type: string
          nullable: true
          description: Optional tags. Omit or null to clear.
        routing:
          $ref: '#/components/schemas/MessageRouting'
          description: Routing tree defining channel selection method and order.
        channels:
          $ref: '#/components/schemas/MessageChannels'
          nullable: true
          description: Per-channel delivery configuration. Omit to clear.
        providers:
          $ref: '#/components/schemas/MessageProviders'
          nullable: true
          description: Per-provider delivery configuration. Omit to clear.
      required:
        - name
        - routing
    RoutingStrategyMutationResponse:
      title: RoutingStrategyMutationResponse
      type: object
      deprecated: true
      description: >-
        Deprecated — mutation endpoints now return RoutingStrategyGetResponse. Retained for backward
        compatibility with generated SDKs.
      properties:
        id:
          type: string
          description: The routing strategy ID (rs_ prefix).
      required:
        - id
    RoutingStrategyGetResponse:
      title: RoutingStrategyGetResponse
      type: object
      description: Full routing strategy entity returned by GET.
      properties:
        id:
          type: string
          description: The routing strategy ID (rs_ prefix).
        name:
          type: string
          description: Human-readable name.
        description:
          type: string
          nullable: true
          description: Description of the routing strategy.
        tags:
          type: array
          items:
            type: string
          nullable: true
          description: Tags for categorization.
        routing:
          $ref: '#/components/schemas/MessageRouting'
          description: Routing tree defining channel selection method and order.
        channels:
          $ref: '#/components/schemas/MessageChannels'
          description: Per-channel delivery configuration. May be empty.
        providers:
          $ref: '#/components/schemas/MessageProviders'
          description: Per-provider delivery configuration. May be empty.
        created:
          type: integer
          format: int64
          description: Epoch milliseconds when the strategy was created.
        creator:
          type: string
          description: User ID of the creator.
        updated:
          type: integer
          format: int64
          nullable: true
          description: Epoch milliseconds of last update.
        updater:
          type: string
          nullable: true
          description: User ID of the last updater.
      required:
        - id
        - name
        - routing
        - channels
        - providers
        - created
        - creator
    RoutingStrategySummary:
      title: RoutingStrategySummary
      type: object
      description: >-
        Routing strategy metadata returned in list responses. Does not include routing/channels/providers
        content.
      properties:
        id:
          type: string
          description: The routing strategy ID (rs_ prefix).
        name:
          type: string
          description: Human-readable name.
        description:
          type: string
          nullable: true
          description: Description of the routing strategy.
        tags:
          type: array
          items:
            type: string
          nullable: true
          description: Tags for categorization.
        created:
          type: integer
          format: int64
          description: Epoch milliseconds when the strategy was created.
        creator:
          type: string
          description: User ID of the creator.
        updated:
          type: integer
          format: int64
          nullable: true
          description: Epoch milliseconds of last update.
        updater:
          type: string
          nullable: true
          description: User ID of the last updater.
      required:
        - id
        - name
        - created
        - creator
    RoutingStrategyListResponse:
      title: RoutingStrategyListResponse
      type: object
      description: Paginated list of routing strategy summaries.
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        results:
          type: array
          items:
            $ref: '#/components/schemas/RoutingStrategySummary'
      required:
        - paging
        - results
    AssociatedNotificationListResponse:
      title: AssociatedNotificationListResponse
      type: object
      description: Paginated list of notification templates associated with a routing strategy.
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        results:
          type: array
          items:
            $ref: '#/components/schemas/NotificationTemplateSummary'
      required:
        - paging
        - results
    UsersUserPreferencesListResponse:
      title: UsersUserPreferencesListResponse
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
          description: Deprecated - Paging not implemented on this endpoint
        items:
          type: array
          items:
            $ref: '#/components/schemas/UsersTopicPreference'
          description: The Preferences associated with the user_id.
      required:
        - paging
        - items
    UsersUserPreferencesGetResponse:
      title: UsersUserPreferencesGetResponse
      type: object
      properties:
        topic:
          $ref: '#/components/schemas/UsersTopicPreference'
      required:
        - topic
    UsersTopicPreference:
      title: UsersTopicPreference
      type: object
      properties:
        custom_routing:
          type: array
          items:
            $ref: '#/components/schemas/ChannelClassification'
          nullable: true
          description: The Channels a user has chosen to receive notifications through for this topic
        default_status:
          $ref: '#/components/schemas/PreferenceStatus'
        has_custom_routing:
          type: boolean
          nullable: true
        status:
          $ref: '#/components/schemas/PreferenceStatus'
        topic_id:
          type: string
        topic_name:
          type: string
      required:
        - default_status
        - status
        - topic_id
        - topic_name
    UsersTopicPreferenceUpdate:
      title: UsersTopicPreferenceUpdate
      type: object
      properties:
        status:
          $ref: '#/components/schemas/PreferenceStatus'
        custom_routing:
          type: array
          items:
            $ref: '#/components/schemas/ChannelClassification'
          nullable: true
          description: The Channels a user has chosen to receive notifications through for this topic
        has_custom_routing:
          type: boolean
          nullable: true
      required:
        - status
    UsersUserPreferencesUpdateResponse:
      title: UsersUserPreferencesUpdateResponse
      type: object
      properties:
        message:
          type: string
          example: success
      required:
        - message
    UsersListTenantsForUserResponse:
      title: UsersListTenantsForUserResponse
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/UserTenantAssociation'
          nullable: true
        has_more:
          type: boolean
          description: Set to true when there are more pages that can be retrieved.
        url:
          type: string
          description: A url that may be used to generate these results.
        next_url:
          type: string
          nullable: true
          description: |-
            A url that may be used to generate fetch the next set of results. 
            Defined only when `has_more` is set to true
        cursor:
          type: string
          nullable: true
          description: |-
            A pointer to the next page of results. Defined 
            only when `has_more` is set to true
        type:
          type: string
          enum:
            - list
          description: Always set to `list`. Represents the type of this object.
      required:
        - has_more
        - url
        - type
    UsersProviderKey:
      title: UsersProviderKey
      type: string
      enum:
        - firebase-fcm
        - apn
        - expo
        - onesignal
    UsersTokenStatus:
      title: UsersTokenStatus
      type: string
      enum:
        - active
        - unknown
        - failed
        - revoked
    UsersPatchOp:
      title: UsersPatchOp
      type: string
      enum:
        - replace
        - add
        - remove
        - copy
        - move
        - test
    UsersDevice:
      title: UsersDevice
      type: object
      properties:
        app_id:
          type: string
          nullable: true
          description: Id of the application the token is used for
        ad_id:
          type: string
          nullable: true
          description: Id of the advertising identifier
        device_id:
          type: string
          nullable: true
          description: Id of the device the token is associated with
        platform:
          type: string
          nullable: true
          description: The device platform i.e. android, ios, web
        manufacturer:
          type: string
          nullable: true
          description: The device manufacturer
        model:
          type: string
          nullable: true
          description: The device model
    UsersTracking:
      title: usersTracking
      type: object
      properties:
        os_version:
          type: string
          nullable: true
          description: The operating system version
        ip:
          type: string
          nullable: true
          description: The IP address of the device
        lat:
          type: string
          nullable: true
          description: The latitude of the device
        long:
          type: string
          nullable: true
          description: The longitude of the device
    UsersUserToken:
      title: UsersUserToken
      type: object
      properties:
        token:
          type: string
          description: Full body of the token. Must match token in URL path parameter.
        provider_key:
          $ref: '#/components/schemas/UsersProviderKey'
        expiry_date:
          $ref: '#/components/schemas/UsersExpiryDate'
          nullable: true
          description: >-
            ISO 8601 formatted date the token expires. Defaults to 2 months. Set to false to disable
            expiration.
        properties:
          nullable: true
          description: Properties about the token.
        device:
          $ref: '#/components/schemas/UsersDevice'
          nullable: true
          description: Information about the device the token came from.
        tracking:
          $ref: '#/components/schemas/UsersTracking'
          nullable: true
          description: Tracking information about the device the token came from.
      required:
        - provider_key
        - token
    UsersAddSingleTokenBody:
      title: UsersAddSingleTokenBody
      type: object
      description: >-
        Request body for adding a single token. The token value itself is provided via the path parameter, so
        it is omitted from the body.
      properties:
        provider_key:
          $ref: '#/components/schemas/UsersProviderKey'
        expiry_date:
          $ref: '#/components/schemas/UsersExpiryDate'
          nullable: true
          description: >-
            ISO 8601 formatted date the token expires. Defaults to 2 months. Set to false to disable
            expiration.
        properties:
          nullable: true
          description: Properties about the token.
        device:
          $ref: '#/components/schemas/UsersDevice'
          nullable: true
          description: Information about the device the token came from.
        tracking:
          $ref: '#/components/schemas/UsersTracking'
          nullable: true
          description: Tracking information about the device the token came from.
      required:
        - provider_key
    UsersGetUserTokenResponse:
      title: UsersGetUserTokenResponse
      type: object
      properties:
        status:
          $ref: '#/components/schemas/UsersTokenStatus'
          nullable: true
        status_reason:
          type: string
          nullable: true
          description: The reason for the token status.
      allOf:
        - $ref: '#/components/schemas/UsersUserToken'
    UsersPatchUserTokenOpts:
      title: UsersPatchUserTokenOpts
      type: object
      properties:
        patch:
          type: array
          items:
            $ref: '#/components/schemas/UsersPatchOperation'
      required:
        - patch
    UsersPatchOperation:
      title: UsersPatchOperation
      type: object
      properties:
        op:
          type: string
          description: The operation to perform.
        path:
          type: string
          description: The JSON path specifying the part of the profile to operate on.
        value:
          type: string
          nullable: true
          description: The value for the operation.
      required:
        - op
        - path
    UsersExpiryDate:
      title: UsersExpiryDate
      oneOf:
        - type: string
        - type: boolean
    UsersGetAllTokensResponse:
      title: UsersGetAllTokensResponse
      type: object
      properties:
        tokens:
          type: array
          items:
            $ref: '#/components/schemas/UsersUserToken'
      required:
        - tokens
      description: A list of tokens registered with the user.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
servers:
  - url: https://api.courier.com
    description: Production
