Skip to content

Create a new event store

POST
/api/event-stores

Creates a new event store for storing event streams.

An event store is a container for event streams and provides functionality for appending, reading, and subscribing to events. Each event store has its own isolated storage and processing capabilities.

object
name
required

Name for the new event store

string
>= 3 characters <= 63 characters /^[a-z0-9_-]+$/
description

Optional description of the event store

string
<= 255 characters
settings

Optional configuration settings for the event store

object
retentionPeriodDays

Number of days to retain events before automatic deletion

integer
maxStreamSizeBytes

Maximum size limit for a stream in bytes

integer
Examples

Basic event store

{
"name": "my-application",
"description": "Event store for My Application"
}

Event store created successfully

object
eventStoreId
required

Composite identifier (orgId:name) - use eventStoreName for API calls

string
eventStoreName
required

Simple event store name for use in API calls

string
eventStoreDurableObjectId
required

Durable Object ID for the event store

string
eventBusDurableObjectId
required

Durable Object ID for the event bus

string
description

Description of the event store

string
settings

Configuration settings for the event store

object
retentionPeriodDays

Number of days to retain events before automatic deletion

integer
maxStreamSizeBytes

Maximum size limit for a stream in bytes

integer
created
required

When this event store was created

string format: date-time
Examples
{
"eventStoreId": "es_1234567890",
"eventStoreName": "my-application",
"eventStoreDurableObjectID": "do_eventstore_1234567890",
"eventBusDurableObjectID": "do_eventbus_1234567890",
"created": "2023-10-25T15:30:45Z"
}

Invalid request or validation error

object
error
required

Error type

string
message
required

Human-readable error message

string
details

Additional error details

object
key
additional properties
nullable
Examples
{
"error": "INVALID_NAME",
"message": "Event store name must contain only lowercase letters, numbers, dashes, and underscores",
"details": {
"name": "my-event-store"
}
}

Unauthorized - Organization ID not found in authentication context

object
error
required

Error type

string
message
required

Human-readable error message

string
details

Additional error details

object
key
additional properties
nullable
Examples
{
"error": "UNAUTHORIZED",
"message": "Organization ID not found in authentication context"
}

Event store with this name already exists

object
error
required

Error type

string
message
required

Human-readable error message

string
details

Additional error details

object
key
additional properties
nullable
Examples
{
"error": "EVENT_STORE_ALREADY_EXISTS",
"message": "An event store with this name already exists",
"details": {
"name": "my-application"
}
}

Internal server error

object
error
required

Error type

string
message
required

Human-readable error message

string
details

Additional error details

object
key
additional properties
nullable