---
updatedAt: 2026-09-09T03:53:24.000Z
agentTools:
  projectIndex: https://docs.vouchery.io/llms.txt
---

# Send custom event

Invoke custom event

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "contact": {
      "email": "hello@vouchery.io"
    },
    "description": "Vouchery API",
    "license": {
      "name": "Commercial",
      "url": "https://www.vouchery.io"
    },
    "title": "Vouchery",
    "version": "dev-vouchery-go"
  },
  "paths": {
    "/api/v2.1/events": {
      "post": {
        "description": "Invoke custom event",
        "operationId": "postApiV21Events",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/requestCustomEvent"
              }
            }
          },
          "description": "Event to send",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Created object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/eventEvent"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseError_Example_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseError_Example_Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity error. Validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseValidationError_Example"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. Try again in a few minutes or contact support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseError_Example_InternalServerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "app_auth": [
              "admin"
            ]
          }
        ],
        "summary": "Send custom event",
        "tags": [
          "Workflows"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "",
      "externalDocs": {
        "description": "",
        "url": "https://docs.vouchery.io"
      },
      "name": "Workflows"
    }
  ],
  "servers": [
    {
      "url": "https://admin.sandbox.vouchery.app"
    }
  ],
  "components": {
    "securitySchemes": {
      "app_auth": {
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      }
    },
    "schemas": {
      "eventAction": {
        "properties": {
          "action_id": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "next_action_id": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          },
          "wait_for_events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "next_action_id",
          "error",
          "wait_for_events",
          "success",
          "action_id"
        ],
        "type": "object"
      },
      "eventActor": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "eventCampaign": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "eventCategory": {
        "properties": {
          "name": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "tag"
        ],
        "type": "object"
      },
      "eventCustomer": {
        "properties": {
          "email": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "identifier": {
            "type": "string"
          },
          "loyalty_points": {
            "format": "int32",
            "type": "integer"
          },
          "loyalty_points_change": {
            "format": "int32",
            "type": "integer"
          },
          "name": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "referral_code": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "referred_by_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "identifier",
          "loyalty_points",
          "loyalty_points_change"
        ],
        "type": "object"
      },
      "eventEvent": {
        "properties": {
          "action": {
            "$ref": "#/components/schemas/eventAction"
          },
          "actor": {
            "$ref": "#/components/schemas/eventActor"
          },
          "campaign": {
            "$ref": "#/components/schemas/eventCampaign"
          },
          "category": {
            "$ref": "#/components/schemas/eventCategory"
          },
          "customer": {
            "$ref": "#/components/schemas/eventCustomer"
          },
          "id": {
            "type": "string"
          },
          "invalid_redemption": {
            "$ref": "#/components/schemas/eventInvalidRedemption"
          },
          "mews_reservation": {
            "$ref": "#/components/schemas/eventMewsReservation"
          },
          "project": {
            "$ref": "#/components/schemas/eventProject"
          },
          "redemption": {
            "$ref": "#/components/schemas/eventRedemption"
          },
          "relates_workflow": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "scope": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "timestamp": {
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "transaction": {
            "$ref": "#/components/schemas/eventTransaction"
          },
          "type": {
            "type": "string"
          },
          "voucher": {
            "$ref": "#/components/schemas/eventVoucher"
          },
          "workflow": {
            "$ref": "#/components/schemas/eventWorkflow"
          }
        },
        "required": [
          "type",
          "service",
          "id",
          "scope",
          "timestamp"
        ],
        "type": "object"
      },
      "eventInvalidRedemption": {
        "properties": {
          "campaign_id": {
            "format": "int64",
            "type": "integer"
          },
          "confirmed_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "created_by_id": {
            "format": "int64",
            "type": "integer"
          },
          "customer_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "expires_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "granted_discount": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "granted_shipping_discount": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "id": {
            "format": "int32",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          },
          "total_transaction_cost": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "transaction_id": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "updated_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "user_agent": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "voucher_id": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "voucher_id",
          "campaign_id",
          "granted_shipping_discount",
          "total_transaction_cost",
          "granted_discount",
          "reason_code",
          "created_by_id",
          "reason"
        ],
        "type": "object"
      },
      "eventMewsReservation": {
        "properties": {
          "customer_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "external_id": {
            "type": "string"
          },
          "id": {
            "format": "int32",
            "type": "integer"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "external_id",
          "state"
        ],
        "type": "object"
      },
      "eventProject": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "eventRedemption": {
        "properties": {
          "campaign_id": {
            "format": "int64",
            "type": "integer"
          },
          "cancelled_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "confirmed_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "created_by_id": {
            "format": "int64",
            "type": "integer"
          },
          "customer_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "granted_discount": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "granted_shipping_discount": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "id": {
            "format": "int32",
            "type": "integer"
          },
          "matching_product_cost": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "shipping_cost": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "total_transaction_cost": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "transaction_id": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "user_agent": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "voucher_id": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "shipping_cost",
          "total_transaction_cost",
          "granted_shipping_discount",
          "id",
          "voucher_id",
          "campaign_id",
          "created_by_id",
          "matching_product_cost",
          "granted_discount"
        ],
        "type": "object"
      },
      "eventTransaction": {
        "properties": {
          "cancelled_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "created_by_id": {
            "format": "int64",
            "type": "integer"
          },
          "customer_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "discount_applied": {
            "type": "boolean"
          },
          "id": {
            "format": "int32",
            "type": "integer"
          },
          "shipping_cost": {
            "description": "Nullable. Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "total_transaction_cost": {
            "description": "Float64",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "transaction_id": {
            "type": "string"
          },
          "updated_at": {
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "discount_applied",
          "created_by_id",
          "transaction_id",
          "total_transaction_cost",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "eventVoucher": {
        "properties": {
          "activates_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "attempted_redemptions": {
            "format": "int32",
            "type": "integer"
          },
          "campaign_id": {
            "format": "int64",
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "customer_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "expires_at": {
            "description": "Nullable. ",
            "example": "2021-03-30T20:13:35.339398+01:00",
            "format": "date-time",
            "type": "string"
          },
          "gift_card_value": {
            "description": "Nullable. Float64 or null",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "gift_card_value_left": {
            "description": "Nullable. Float64 or null",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "gift_card_value_reserved": {
            "description": "Nullable. Float64 or null",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "id": {
            "format": "int32",
            "type": "integer"
          },
          "prefix": {
            "type": "string"
          },
          "redemptions_confirmed_count": {
            "format": "int32",
            "type": "integer"
          },
          "redemptions_left": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "redemptions_unconfirmed_count": {
            "format": "int32",
            "type": "integer"
          },
          "source_id": {
            "description": "Nullable. Integer or null",
            "example": "123",
            "format": "int64",
            "type": "integer"
          },
          "source_type": {
            "description": "Nullable. String or null.",
            "type": "string"
          },
          "value_left": {
            "description": "Nullable. Float64 or null",
            "example": "123.01",
            "format": "double",
            "type": "number"
          },
          "voucher_type": {
            "format": "int32",
            "type": "integer"
          },
          "voucher_type_name": {
            "type": "string"
          }
        },
        "required": [
          "voucher_type_name",
          "redemptions_confirmed_count",
          "attempted_redemptions",
          "prefix",
          "id",
          "campaign_id",
          "code",
          "voucher_type",
          "redemptions_unconfirmed_count"
        ],
        "type": "object"
      },
      "eventWorkflow": {
        "properties": {
          "id": {
            "format": "int32",
            "type": "integer"
          },
          "run_id": {
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "run_id"
        ],
        "type": "object"
      },
      "requestCustomEvent": {
        "properties": {
          "customer_identifier": {
            "description": "Customer identifier for which the event will be sent.",
            "type": "string"
          },
          "type": {
            "description": "Type of a custom event.",
            "type": "string"
          }
        },
        "required": [
          "type",
          "customer_identifier"
        ],
        "type": "object"
      },
      "responseError_Example_Forbidden": {
        "properties": {
          "code": {
            "example": "forbidden",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "message": {
            "example": "You are not permitted to access this resource",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "message",
          "type",
          "code",
          "error"
        ],
        "type": "object"
      },
      "responseError_Example_InternalServerError": {
        "properties": {
          "code": {
            "example": "unknown_error",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "message": {
            "example": "Unknown error. Trace ID 1b477920d09147d9bce22cce8f405e98.",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "message",
          "type",
          "code",
          "error"
        ],
        "type": "object"
      },
      "responseError_Example_Unauthorized": {
        "properties": {
          "code": {
            "example": "not_authorized",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "message": {
            "example": "Not authorized",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "code",
          "error",
          "message",
          "type"
        ],
        "type": "object"
      },
      "responseValidationError_Example": {
        "properties": {
          "code": {
            "example": "invalid",
            "type": "string"
          },
          "error": {
            "example": "true",
            "type": "boolean"
          },
          "errors": {
            "items": {
              "$ref": "#/components/schemas/responseValidationSubError_Example"
            },
            "type": "array"
          },
          "message": {
            "example": "Object is invalid",
            "type": "string"
          },
          "type": {
            "example": "Error",
            "type": "string"
          }
        },
        "required": [
          "code",
          "error",
          "message",
          "type",
          "errors"
        ],
        "type": "object"
      },
      "responseValidationSubError_Example": {
        "properties": {
          "attribute": {
            "description": "Name of the property which is invalid",
            "example": "name",
            "type": "string"
          },
          "code": {
            "example": "must_be_unique",
            "type": "string"
          },
          "message": {
            "example": "Name must be unique",
            "type": "string"
          }
        },
        "required": [
          "attribute",
          "code",
          "message"
        ],
        "type": "object"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```