> ## Documentation Index
> Fetch the complete documentation index at: https://www.notifuse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Send a transactional notification

Sends a transactional notification to a contact through specified channels.
Requires authentication.

## OpenAPI

````yaml /openapi.json post /api/transactional.send
openapi: 3.0.3
info:
  title: Notifuse API
  description: API for Notifuse - a transactional email and newsletter management platform
  version: 1.0.0
  contact:
    name: Notifuse Support
    url: https://www.notifuse.com/support
    email: hello@notifuse.com
  license:
    name: BUSL-1.1
    url: https://github.com/Notifuse/notifuse/blob/main/LICENSE
servers:
  - url: https://{notifuseDomain}
    description: Customer-specific Notifuse API server
    variables:
      notifuseDomain:
        description: Your unique Notifuse domain
        default: demo.notifuse.com
security: []
paths:
  /api/transactional.send:
    post:
      summary: Send a transactional notification
      description: >
        Sends a transactional notification to a contact through specified
        channels.

        Requires authentication.
      operationId: sendTransactionalNotification
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SendTransactionalRequest"
      responses:
        "200":
          description: Notification sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message_id:
                    type: string
                    description: Unique identifier for the sent message
                    example: msg_1234567890abcdef
                  success:
                    type: boolean
                    description: Whether the notification was sent successfully
                    example: true
        "400":
          description: Bad request - validation failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                notFoundExample:
                  value:
                    error: Notification not found
                inactiveExample:
                  value:
                    error: Notification is not active
                noChannelsExample:
                  value:
                    error: No valid channels configured
                validationExample:
                  value:
                    error: notification.contact is required
        "401":
          description: Unauthorized - invalid or missing authentication token
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                error: Unauthorized
        "403":
          description: >
            The API key lacks a permission the send requires.
            `transactional:write` is

            always required; `contacts:read` is required in addition when the
            request

            sets `cc` or `bcc`, because the subject is rendered against the
            contact.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                error: "Insufficient permissions: write access to transactional notifications
                  required"
                resource: transactional
                permission: write
        "422":
          description: >
            The email cannot be built from the template and the data of the
            send: a Liquid error,

            such as a filter that fails or a comparison of a text with a number,
            or an MJML error.

            Nothing is sent. The template or the data has to change; sending
            again fails the same way.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                error: "template compilation failed: liquid rendering error in block (ID:
                  mjml-source): liquid rendering failed: Liquid error: divided
                  by 0"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                error: Failed to send notification
components:
  schemas:
    Contact:
      type: object
      required:
        - email
      properties:
        email:
          type: string
          format: email
          description: Email address of the contact. This is the contact's unique
            identifier.
          example: user@example.com
        external_id:
          type: string
          nullable: true
          description: Identifier for the contact in your own system. Not unique — several
            contacts may share the same external_id.
          example: user_12345
        timezone:
          type: string
          nullable: true
          description: Timezone of the contact
          example: America/New_York
        language:
          type: string
          nullable: true
          description: Preferred language of the contact
          example: en-US
        first_name:
          type: string
          nullable: true
          description: First name of the contact
          example: John
        last_name:
          type: string
          nullable: true
          description: Last name of the contact
          example: Doe
        full_name:
          type: string
          nullable: true
          description: Full name of the contact (for systems that don't have separate
            first/last names)
          example: John Doe
        phone:
          type: string
          nullable: true
          description: Phone number of the contact
          example: "+15551234567"
        address_line_1:
          type: string
          nullable: true
          description: First line of address
          example: 123 Main St
        address_line_2:
          type: string
          nullable: true
          description: Second line of address
          example: Apt 4B
        country:
          type: string
          nullable: true
          description: Country of the contact
          example: US
        postcode:
          type: string
          nullable: true
          description: Postal code
          example: "10001"
        state:
          type: string
          nullable: true
          description: State or province
          example: NY
        job_title:
          type: string
          nullable: true
          description: Job title of the contact
          example: Software Engineer
        tracking_opens_consent:
          type: string
          nullable: true
          enum:
            - granted
            - denied
            - null
          description: The contact's own choice about open tracking; `null` means unknown.
        tracking_clicks_consent:
          type: string
          nullable: true
          enum:
            - granted
            - denied
            - null
          description: The contact's own choice about click tracking; `null` means unknown.
        tracking_consent_updated_at:
          type: string
          format: date-time
          nullable: true
          description: When a tracking choice last changed.
        tracking_consent_source:
          type: string
          nullable: true
          description: Where the last tracking choice came from (api, console, import,
            notification_center, email_link, subscribe_form).
        custom_string_1:
          type: string
          nullable: true
          description: Custom string field 1
          example: Premium tier
        custom_string_2:
          type: string
          nullable: true
          description: Custom string field 2
        custom_string_3:
          type: string
          nullable: true
          description: Custom string field 3
        custom_string_4:
          type: string
          nullable: true
          description: Custom string field 4
        custom_string_5:
          type: string
          nullable: true
          description: Custom string field 5
        custom_number_1:
          type: number
          format: float
          nullable: true
          description: Custom number field 1
          example: 42
        custom_number_2:
          type: number
          format: float
          nullable: true
          description: Custom number field 2
        custom_number_3:
          type: number
          format: float
          nullable: true
          description: Custom number field 3
        custom_number_4:
          type: number
          format: float
          nullable: true
          description: Custom number field 4
        custom_number_5:
          type: number
          format: float
          nullable: true
          description: Custom number field 5
        custom_datetime_1:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 1
          example: 2023-06-01T09:00:00Z
        custom_datetime_2:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 2
        custom_datetime_3:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 3
        custom_datetime_4:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 4
        custom_datetime_5:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 5
        custom_json_1:
          description: Custom JSON field 1. Any JSON value, or null.
          example:
            preferences:
              theme: dark
              notifications: true
        custom_json_2:
          description: Custom JSON field 2. Any JSON value, or null.
        custom_json_3:
          description: Custom JSON field 3. Any JSON value, or null.
        custom_json_4:
          description: Custom JSON field 4. Any JSON value, or null.
        custom_json_5:
          description: Custom JSON field 5. Any JSON value, or null.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: When the contact was created (read-only, set by server)
          example: 2023-01-15T10:30:00Z
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: When the contact was last updated (read-only, set by server)
          example: 2023-04-22T15:45:00Z
        contact_lists:
          type: array
          readOnly: true
          description: Lists the contact is subscribed to (read-only, included in GET
            responses only)
          items:
            $ref: "#/components/schemas/ContactList"
          example:
            - email: user@example.com
              list_id: newsletter
              list_name: Newsletter
              status: active
              created_at: 2023-01-15T10:30:00Z
              updated_at: 2023-01-15T10:30:00Z
              deleted_at: null
        contact_segments:
          type: array
          readOnly: true
          description: Segments the contact belongs to (read-only, included in GET
            responses only)
          items:
            $ref: "#/components/schemas/ContactSegment"
    ContactList:
      type: object
      properties:
        email:
          type: string
          format: email
          description: Email address of the contact
          example: user@example.com
        list_id:
          type: string
          description: ID of the list
          example: newsletter
        list_name:
          type: string
          description: Name of the list
          example: Newsletter
        status:
          type: string
          enum:
            - active
            - pending
            - unsubscribed
            - bounced
            - complained
          description: Subscription status
          example: active
        created_at:
          type: string
          format: date-time
          description: When the contact was subscribed to this list
          example: 2023-01-15T10:30:00Z
        updated_at:
          type: string
          format: date-time
          description: When the subscription was last updated
          example: 2023-01-15T10:30:00Z
        deleted_at:
          type: string
          format: date-time
          nullable: true
          description: When the subscription was deleted (null if active)
          example: null
    ContactSegment:
      type: object
      properties:
        email:
          type: string
          format: email
          description: Email address of the contact
          example: user@example.com
        segment_id:
          type: string
          description: ID of the segment
          example: premium_users
        version:
          type: integer
          format: int64
          description: Version of the segment computation
          example: 1
        matched_at:
          type: string
          format: date-time
          description: When the contact was matched to this segment
          example: 2023-01-15T10:30:00Z
        computed_at:
          type: string
          format: date-time
          description: When the segment was last computed
          example: 2023-01-15T10:30:00Z
    EmailAttachment:
      type: object
      required:
        - filename
        - content
      properties:
        filename:
          type: string
          description: Name of the file (max 255 characters, no path separators)
          example: invoice.pdf
          maxLength: 255
        content:
          type: string
          format: byte
          description: Base64-encoded file content (max 3MB per file)
          example: JVBERi0xLjQKJeLjz9MKMy4uLg==
        content_type:
          type: string
          description: MIME type of the file (auto-detected if not provided)
          example: application/pdf
        disposition:
          type: string
          enum:
            - attachment
            - inline
          description: How the attachment should be displayed (defaults to 'attachment')
          example: attachment
          default: attachment
        content_id:
          type: string
          description: Content-ID for inline attachments, referenced from the HTML body as
            <img src="cid:..."> . Only allowed when disposition is 'inline'. May
            only contain letters, digits, and the characters . _ - @ (max 255
            characters). Defaults to the filename when omitted.
          example: checkInQr
          maxLength: 255
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
    SendTransactionalRequest:
      type: object
      required:
        - workspace_id
        - notification
      properties:
        workspace_id:
          type: string
          description: The ID of the workspace
          example: ws_1234567890
        notification:
          $ref: "#/components/schemas/TransactionalNotificationSendParams"
    TransactionalNotificationSendParams:
      type: object
      required:
        - id
        - contact
        - channels
      properties:
        id:
          type: string
          description: ID of the notification to send
          example: welcome_email
        external_id:
          type: string
          nullable: true
          description: External ID for idempotency checks
          example: txn_12345
        contact:
          $ref: "#/components/schemas/Contact"
        channels:
          type: array
          description: Channels to send through (at least one required)
          minItems: 1
          items:
            type: string
            enum:
              - email
          example:
            - email
        data:
          type: object
          additionalProperties: true
          description: Data to populate the template with
          example:
            user_name: John Doe
            activation_link: https://example.com/activate/abc123
        metadata:
          type: object
          additionalProperties: true
          description: Additional metadata for tracking
          example:
            campaign_id: spring_promo_2023
            source: user_signup
        email_options:
          type: object
          description: Email-specific options
          properties:
            sender_id:
              type: string
              description: >
                ID of one of the transactional email integration's senders. The
                email leaves from

                this sender instead of the template's. An ID that is not one of
                the integration's

                senders is refused with a 400 before the contact is created or
                updated. `from_name`

                still applies on top of it.
              example: 3f1c2a9e-7b4d-4e1a-9c2f-5d8e6a0b1c3d
            from_name:
              type: string
              nullable: true
              description: Override default sender from name
              example: Support Team
            subject:
              type: string
              nullable: true
              description: Override template subject line. Supports Liquid templating
                variables.
              maxLength: 255
              example: Welcome, {{ name }}!
            subject_preview:
              type: string
              nullable: true
              description: Override template preheader/preview text. Supports Liquid
                templating variables.
              maxLength: 255
              example: Your order has been confirmed
            cc:
              type: array
              description: CC email addresses
              items:
                type: string
                format: email
              example:
                - manager@example.com
            bcc:
              type: array
              description: BCC email addresses
              items:
                type: string
                format: email
              example:
                - archive@example.com
            reply_to:
              type: string
              format: email
              description: Reply-To email address. Takes the place of the template's reply-to
                for this message.
              example: support@example.com
            attachments:
              type: array
              description: Email attachments (max 20 files, 3MB per file, 10MB total)
              items:
                $ref: "#/components/schemas/EmailAttachment"
              maxItems: 20
              example:
                - filename: invoice.pdf
                  content: JVBERi0xLjQKJeLjz9MKMy4uLg==
                  content_type: application/pdf
                  disposition: attachment
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API token for authentication
````
