
# Create an event

Create one event. The response is a 201 with the new event's URI in `Location`.

```sh
POST https://sitepaste.com/api/v1/public/sites/{siteId}/events
```

Requires the `content` scope.

To write several events at once, or to create, update, and delete together, use [POST /sites/{siteId}/events/batch](/api/events/post-events-batch). To change an event that already exists, use [PATCH /sites/{siteId}/events/{eventId}](/api/events/patch-events-id).

## Usage

```bash
curl -X POST https://sitepaste.com/api/v1/public/sites/default/events \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Morning Breathwork",
    "startsAt": "2026-09-01T09:00",
    "timezone": "America/Los_Angeles",
    "eventTypeSlugs": ["breathwork"],
    "price": "$25",
    "bookingUrl": "https://example.com/book"
  }'
```

The response's `Location` names the new event:

```
Location: /api/v1/public/sites/default/events/4ghjanhpo9sy
```

Saving an event does not publish it. Deploy the site with [POST /sites/{siteId}/deployments](/api/deployments/post-deployments) when you are ready for the change to go live.

## Authorizations

| Header | Type | Required | Description |
|--------|------|----------|-------------|
| Authorization | string | Yes | Bearer token (`Authorization: Bearer sp_...`). Created in the dashboard under Account > Tokens. See [authentication](/api/authentication). |

## Body

The body is one event object.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| title | string | Yes | The event's name. |
| startsAt | string | Yes | RFC 3339, or `YYYY-MM-DDTHH:MM` read in the event's own timezone. |
| timezone | string | Yes | IANA timezone name, such as `America/Los_Angeles`. |
| description | string | No | Longer text for the event. |
| eventTypeSlugs | array | No | Slugs of [event types](/api/events/get-event-types) that must already exist on the site. |
| price | string | No | Displayed as written, such as `$25`. |
| capacity | integer | No | Number of places. |
| location | string | No | Where the event happens. |
| imageUrl | string | No | Image for the event. |
| bookingUrl | string | No | HTTPS only. |
| hidden | boolean | No | Keeps the event off the published schedule. |

The site is named in the path, not the body. See [addressing](/api/overview#addressing).

`events` and `deleteIds` belong to the [batch](/api/events/post-events-batch), an `id` names an event that already exists and belongs to [the event's own URI](/api/events/patch-events-id), and publishing has [its own route](/api/deployments/post-deployments). A body carrying one of them answers 422 naming the field and where it belongs.

## Response

201 Created, with the event in the representation [GET /sites/{siteId}/events/{eventId}](/api/events/get-events-id) serves and the event's URI in `Location`.

## Errors

Field problems return 422 and name the field:

```json
{ "error": "validation failed", "code": "validation_failed", "fields": { "timezone": "invalid timezone" } }
```

An `eventTypeSlugs` entry naming a type that does not exist on the site is a 422 as well. See [errors](/api/overview#errors).