---
title: "Create Event"
method: POST
path: "/api/v1/events"
tags: ["events"]
---

# Create Event

`POST /api/v1/events`

## Request

- Base URL: `https://api.gnosari.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gnosari.com/api/v1/events`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-AUTH-TOKEN`

Receive an external event.

The event will be stored and processed asynchronously by any matching
event listeners configured for this account.

**Authentication:**
- JWT Token: `Authorization: Bearer <jwt_token>`
- API Key: `X-AUTH-TOKEN: <api_key>`

**Request Body:**
```json
{
    "event_type": "order.created",
    "payload": {
        "order_id": "12345",
        "customer": "John Doe",
        "total": 99.99
    },
    "context": {
        "source": "shopify",
        "environment": "production"
    },
    "event_id": "evt_abc123"
}
```

**Fields:**
- `event_type` (required): Type of the event (e.g., "order.created", "user.signup")
- `payload` (required): Event data as JSON object
- `context` (optional): Additional context (source, environment, etc.)
- `event_id` (optional): Unique ID for idempotency - auto-generated if not provided

**Response:**
Returns the created event with listener count and processing status.

## Request body

- InboundEventCreate: Schema for creating an inbound event via API.
  - `event_type` string, required: Type of the event (e.g., 'order.created', 'user.signup')
  - `payload` object: Event payload data as JSON
  - `context` object, nullable: Optional context data (source, environment, etc.)
  - `event_id` string, nullable: Unique event ID for idempotency. Auto-generated if not provided.

## Response `201`

Successful Response

- InboundEventResponse: Response when creating an event via API.
  - `event` InboundEvent, required: Response schema for inbound event.
    - `event_type` string, required: Type of the event (e.g., 'order.created', 'user.signup')
    - `payload` object: Event payload data as JSON
    - `context` object, nullable: Optional context data (source, environment, etc.)
    - `id` integer, required
    - `event_id` string, required
    - `status` 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'NO_LISTENERS', required: Status of an inbound event in the processing pipeline.
    - `error_message` string, nullable
    - `processed_at` string, date-time, nullable
    - `account_id` integer, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, nullable
  - `listeners_matched` integer, required
  - `message` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/gnosari/apis/gnosari-api.md) · [All operations](https://skmtc.dev/gnosari/apis/gnosari-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gnosari/apis/gnosari-api/revisions/f299cf53ae5f?raw)
