Skip to main content
POST
/
events
curl --request POST \
  --url https://api.autosend.com/v1/events \
  --header 'Authorization: Bearer AS_your-project-api-key' \
  --header 'Content-Type: application/json' \
  --data '{
  "eventName": "order_completed",
  "description": "Fired when a customer completes a checkout",
  "properties": [
    { "propertyName": "order_total", "type": "number", "description": "Total order value in USD" },
    { "propertyName": "currency", "type": "string", "suggestedValues": ["USD", "EUR", "GBP"] },
    { "propertyName": "is_first_purchase", "type": "boolean" }
  ]
}'
{
  "success": true,
  "data": {
    "id": "60d5ec49f1b2c72d9c8b1234",
    "eventName": "order_completed",
    "description": "Fired when a customer completes a checkout",
    "properties": [
      {
        "propertyName": "order_total",
        "type": "number",
        "description": "Total order value in USD",
        "suggestedValues": []
      },
      {
        "propertyName": "currency",
        "type": "string",
        "suggestedValues": ["USD", "EUR", "GBP"]
      },
      {
        "propertyName": "is_first_purchase",
        "type": "boolean",
        "suggestedValues": []
      }
    ],
    "createdAt": "2026-05-08T10:00:00.000Z",
    "updatedAt": "2026-05-08T10:00:00.000Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.autosend.com/llms.txt

Use this file to discover all available pages before exploring further.

Defines a new event for the project. Event names and property names accept ASCII letters, digits, and underscores only, and must be 64 characters or fewer.
curl --request POST \
  --url https://api.autosend.com/v1/events \
  --header 'Authorization: Bearer AS_your-project-api-key' \
  --header 'Content-Type: application/json' \
  --data '{
  "eventName": "order_completed",
  "description": "Fired when a customer completes a checkout",
  "properties": [
    { "propertyName": "order_total", "type": "number", "description": "Total order value in USD" },
    { "propertyName": "currency", "type": "string", "suggestedValues": ["USD", "EUR", "GBP"] },
    { "propertyName": "is_first_purchase", "type": "boolean" }
  ]
}'
{
  "success": true,
  "data": {
    "id": "60d5ec49f1b2c72d9c8b1234",
    "eventName": "order_completed",
    "description": "Fired when a customer completes a checkout",
    "properties": [
      {
        "propertyName": "order_total",
        "type": "number",
        "description": "Total order value in USD",
        "suggestedValues": []
      },
      {
        "propertyName": "currency",
        "type": "string",
        "suggestedValues": ["USD", "EUR", "GBP"]
      },
      {
        "propertyName": "is_first_purchase",
        "type": "boolean",
        "suggestedValues": []
      }
    ],
    "createdAt": "2026-05-08T10:00:00.000Z",
    "updatedAt": "2026-05-08T10:00:00.000Z"
  }
}

Authorizations

Authorizations
string | header
required
Project API key header of the form Bearer AS_<key>.

Body

eventName
string
required
Unique name of the event within the project. ASCII letters, digits, and underscores only.Maximum length: 64Example: "order_completed"
description
string
Optional human-readable description.Example: "Fired when a customer completes a checkout"
properties
object[]
Schema for the event’s custom properties. Up to 50 properties per event.

Response

Event created successfully (201)
success
boolean
Indicates if the request was successfulExample: true
data
object
The created event definition

Error Responses

400 - Invalid event name
object
{
  "success": false,
  "error": {
    "message": "Event name can only contain ASCII letters (a-z, A-Z), numbers (0-9), and underscores (_).",
    "code": "INVALID_EVENT_NAME_CHARACTERS"
  }
}
409 - Event already exists
object
Returned when an event with the same eventName already exists in the project.
{
  "success": false,
  "error": {
    "message": "Event with this name already exists in the project",
    "code": "EVENT_ALREADY_EXISTS"
  }
}
400 - Max events reached
object
Returned when the project has 100 active event definitions.
{
  "success": false,
  "error": {
    "message": "Maximum number of events (100) reached for this project.",
    "code": "MAX_EVENTS_REACHED"
  }
}