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

# Execute Custom Action

> Execute a custom action when a customer clicks a custom button in email. Receives the customer's email and the action ID to process any custom business logic.



## OpenAPI

````yaml /openapi.json post /zaymo/custom-action
openapi: 3.0.1
info:
  title: Zaymo Custom Integration API
  description: >-
    API for managing product upsells, customer interactions, and custom actions
    in email campaigns
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.your-domain.com/example/
security:
  - apiKeyAuth: []
tags:
  - name: Upsells
    description: Endpoints for managing product upsells in emails
  - name: Customer Portal
    description: Endpoints for customer subscription management portal
  - name: Swap Up
    description: Endpoints for swapping a customer's current subscription product
  - name: Reactivate
    description: Endpoints for reactivating cancelled subscriptions
  - name: Custom Actions
    description: Endpoints for executing custom actions from email buttons
  - name: Discounts
    description: Endpoints for retrieving discount information
paths:
  /zaymo/custom-action:
    post:
      tags:
        - Custom Actions
      summary: Execute Custom Action
      description: >-
        Execute a custom action when a customer clicks a custom button in email.
        Receives the customer's email and the action ID to process any custom
        business logic.
      requestBody:
        description: Custom action request with customer email and action identifier
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomActionRequest'
        required: true
      responses:
        '200':
          description: Custom action executed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomActionResponse'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CustomActionRequest:
      type: object
      required:
        - email
        - action_id
      properties:
        email:
          type: string
          format: email
          description: The email address of the customer who clicked the button
          example: customer@example.com
        action_id:
          type: string
          description: >-
            Unique identifier for the specific action that was triggered. You
            can use any action_id that makes sense for your business. Example
            action_ids: 'claim_discount_10off', 'join_waitlist_product_123',
            'change_to_quarterly', 'register_webinar_march'
          example: claim_discount_10off
    CustomActionResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          example: true
          description: Indicates if the custom action was executed successfully
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Error code identifier
            message:
              type: string
              description: Human-readable error message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Zaymo-API-Key
      description: Zaymo will authenticate requests using the API key you provide

````