Build your event flow.
A persistent event API for connecting systems. Publish a message, poll when you need it, and acknowledge it after processing.
Store events in a persistent log.
Your client initiates polling.
Progress saved after processing.
Quickstart
The SDKs use https://api.eventharbor.io by default: provide
your credentials to get started. For development or self-hosted
installations, override baseUrl (TypeScript/PHP), base_url (Python), BaseURL (Go), or use the constructor with an explicit
URL (Java). The cURL examples use the default URL directly.
To use an SDK, follow the local installation instructions before running the examples. Your language selection applies to every example on this page and is saved in this browser.
The SDK examples are standalone programs. Between steps, set EVENTHARBOR_API_KEY and EVENTHARBOR_CLIENT_ID to the API key issued in the
console and the ID of the client you created. Set EVENTHARBOR_PRODUCER_KEY/EVENTHARBOR_CONSUMER_KEY to the issued secrets. For ACK, use EVENTHARBOR_BATCH_ID and EVENTHARBOR_ACK_SEQUENCE from the processed prefix. Use Example.java for Java examples.
1 Create a client
First, create your account and an organization
in the console. Issue an API key to manage clients and a producer key to
publish events. The organization is derived from the credential. Each
client has its own history and progress. Use external_id to keep
an identifier you already have.
# Create your organization in the console and issue a management API key.
export EVENTHARBOR_API_KEY='API_KEY_FROM_CONSOLE'
curl -sS "https://api.eventharbor.io/clients" \
-H "Authorization: Bearer $EVENTHARBOR_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name":"Downtown Store","external_id":"store-42"}'
# Copy the id returned when creating the client.
export EVENTHARBOR_CLIENT_ID='CLIENT_ID'2 Issue a consumer key
A producer key publishes to the organization's clients. A consumer key
polls and acknowledges events for a single client. Save the key field from each response: the secret is shown only when issued.
curl -sS "https://api.eventharbor.io/clients/$EVENTHARBOR_CLIENT_ID/consumer-keys" \
-H "Authorization: Bearer $EVENTHARBOR_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name":"Store integration"}'
# Save the key value returned when issued.
export EVENTHARBOR_CONSUMER_KEY='ISSUED_CONSUMER_KEY'
# Producer keys are issued in the organization console.
export EVENTHARBOR_PRODUCER_KEY='PRODUCER_KEY_FROM_CONSOLE'3 Publish your first event
Send message as a JSON object and exactly one identifier: client_id or client_external_id. This example uses the client created
in the first step.
curl -sS "https://api.eventharbor.io/events" \
-H "Authorization: Bearer $EVENTHARBOR_PRODUCER_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: order-123-created' \
-d '{
"event_type": "order.created",
"client_external_id": "store-42",
"message": { "order_id": "order-123", "total": 150 }
}'4 Poll for pending events
The credential determines the client and organization. Do not send these IDs in the polling query.
curl -sS "https://api.eventharbor.io/events?limit=100" \
-H "Authorization: Bearer $EVENTHARBOR_CONSUMER_KEY"Illustrative response. IDs and dates will differ in your installation.
{
"batch_id": "507f1f77bcf86cd799439011",
"acked_sequence": "0",
"events": [
{
"id": "507f1f77bcf86cd799439012",
"client_id": "507f1f77bcf86cd799439013",
"event_type": "order.created",
"message": {
"order_id": "order-123",
"total": 150
},
"sequence": "1",
"created_at": "2026-09-28T12:00:00.000Z"
}
]
}5 Process and acknowledge
Persist each event's effects before sending an ACK. Acknowledge only the
last sequence in a processed prefix with no gaps. If batch_id is null, there is no batch to acknowledge.
# Only after persisting the effects of processing.
# Replace batch_id and sequence with values from the received batch.
curl -sS "https://api.eventharbor.io/events/ack" \
-H "Authorization: Bearer $EVENTHARBOR_CONSUMER_KEY" \
-H 'Content-Type: application/json' \
-d '{"batch_id":"507f1f77bcf86cd799439011","sequence":"1"}'Without an ACK, the batch will be delivered again. A failure between processing an event and sending its ACK can cause duplicates: deduplicate by event ID or make your effects idempotent.
Authentication
Use Authorization: Bearer <key> for event operations. Organization
and client scope are derived from the authenticated credential.
Producer key
events:publish Each issued key belongs to an organization. It authorizes publishing events to that organization's clients.
Consumer key
events:consume Scoped to an organization and a client. It authorizes polling, ACK, and status queries.
Replacing or revoking a consumer key does not reset progress. All keys for the same client share an offset and a pending batch. Key listings return metadata without secrets or hashes.
Your account session lets you manage your organizations and issue API
keys and producer keys in the console. An API key has the clients:manage scope: create and query clients, and issue, list, and revoke consumer
keys. It cannot create organizations, publish events, or consume events.
Never share your API key with an end client.
Delivery and ACK
- There is one logical consumer per client, with an initial offset of zero. Configurable consumer groups are not yet available.
- Polling delivers one pending batch at a time. Until fully
acknowledged, the entire batch is repeated, including its acknowledged
prefix, regardless of a new
limit. - ACK is cumulative and validates the batch, scope, and sequence range. Retrying a valid ACK never moves the offset backward, even for older batches.
- Sequences are strings representing 64-bit integers. In JavaScript, use
BigIntfor comparisons; never convert them toNumber. - Ordering uses the stream sequence for each organization/client pair. Do not substitute timestamps or event IDs.
GET /events/status reads progress without opening a batch
or acknowledging events. pending_count is the difference between
the last published sequence and the ACK, not a guarantee that the history
is available.
Exactly-once processing is not guaranteed. Gaps in history produce an error; the consumer does not silently advance past missing events. Retention and automatic expiration remain disabled.
Publishing idempotency
Send the optional Idempotency-Key header with 1–128
characters from [A-Za-z0-9._:-]. The value is
case-sensitive and scoped to the organization and resolved client,
independently of the producer key used.
JSON object property order does not affect comparison; array order matters. After a timeout, retry with the same key, client, and content. The SDK does not generate the key or retry automatically.
API reference
Send Content-Type: application/json with JSON bodies. Resource
IDs are ObjectIds with 24 hexadecimal characters. Unknown fields are rejected.
Dates are returned as ISO strings. All API-owned JSON fields use snake_case,
including related IDs and timestamps (client_id, organization_id, created_at).
Keys inside message are preserved exactly as supplied.
Management listings return { items, next_cursor }: limit defaults to 20 (1–100), and after is exclusive, with
results ordered by ascending ID. Pass next_cursor as after, preserving your filters. null marks the end
of the list.
10 of 10 operations
POST/clients
Create client
Body: { name, external_id? }. Name must contain 1–120 characters and cannot be only whitespace. external_id must contain 1–255 characters, cannot be null, empty, or only whitespace, is unique within the organization, and cannot be changed. The organization is derived from the API key. Returns id, organization_id, name, external_id (if provided), created_at, and updated_at.
GET/clients
List clients
Query: limit, after, and optional external_id (exact comparison, without normalization). Returns { items, next_cursor }, scoped to the organization of the API key.
GET/clients/:clientId
Get client
Returns client details. A missing client or a client outside the organization of the API key returns 404.
POST/clients/:clientId/consumer-keys
Issue consumer key
Body: { name } with 1–120 characters, not just whitespace. Returns id, organization_id, client_id, name, key, prefix, scope (events:consume), and created_at. The key secret is shown only when issued.
GET/clients/:clientId/consumer-keys
List consumer keys
Query: limit and after. Returns { items, next_cursor }, including active and revoked keys, status, and revoked_at. Never returns a secret or hash.
DELETE/clients/:clientId/consumer-keys/:keyId
Revoke consumer key
No response body. Preserves the document and the first revocation date on retries. Does not change the offset or batch. Missing or out-of-scope resource: 404.
POST/events
Publish event
Body: event_type (1–120 characters, not just whitespace), message (JSON object), and exactly one of client_id / client_external_id. Optional Idempotency-Key header. Returns id, client_id, event_type, sequence, and created_at.
GET/events
Poll pending batch
Query: limit (1–1000, default 100). Returns batch_id, acked_sequence, and events. Each event contains id, client_id, event_type, message, sequence, and created_at. With no new events: batch_id is null and events is empty. Polling does not acknowledge processing.
POST/events/ack
Acknowledge processing
Body: { batch_id, sequence }. sequence is a positive 64-bit integer string within the batch range. Returns { acked_sequence }. ACK is cumulative, scoped to the batch/client, and never moves the offset backward on retries.
GET/events/status
Get progress
Returns acked_sequence, last_published_sequence, pending_count (strings), and pending_batch (null or batch_id, first_sequence, last_sequence, acked_sequence, event_count, created_at). Does not create a batch or advance the ACK. pending_count is logical lag, not a physical count of stored events.
In addition to the 10 integration operations, GET / identifies
the service with “EventHarbor API”. Organizations, API keys, and producer
keys are managed in the console.
SDKs
All five SDKs cover the 10 integration operations. ACK, pagination, and retries are explicit. The packages are implemented in the repository; publication to package registries is still pending.
@eventharbor/sdkNode.js ≥ 22 · ESMsdks/typescripteventharbor.io/sdk/goGo ≥ 1.22sdks/goeventharbor-sdkPython ≥ 3.11 · synchronoussdks/pythoneventharbor/sdkPHP ≥ 8.2 · cURL + JSONsdks/phpio.eventharbor:eventharbor-sdkJava ≥ 17 · Mavensdks/javaSet up the examples
The paths below are local: replace /path/to/eventharbor with
your repository path. None of these commands require the SDK to be published
to a registry.
curl --version
# Default URL: https://api.eventharbor.io
# No SDK required. Use the Quickstart examples.curl -sS "https://api.eventharbor.io/events" \
-H "Authorization: Bearer $EVENTHARBOR_PRODUCER_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: order-123-created' \
-d '{
"event_type": "order.created",
"client_external_id": "store-42",
"message": { "order_id": "order-123", "total": 150 }
}'The examples preserve sequences as strings. The SDKs do not ACK or retry automatically; handle failures in your application before acknowledging progress.
Limits and errors
| Resource | Limit |
|---|---|
| JSON body / publication | 256 KiB (262144 bytes) |
| New consumption batch | 1 MiB of JSON (1048576 bytes) |
| Events per poll | 100 by default · maximum 1000 |
| Items per management listing | 20 by default · maximum 100 |
The body limit includes whitespace and is applied after decompression. A batch may contain fewer events to stay within the byte limit. Legacy pending batches are repeated in full; a legacy event that cannot fit on its own returns 409 without advancing progress.
Error responses use status_code, message, and
an optional error label. Validation messages may be an array
of strings.
| HTTP | Meaning |
|---|---|
| 400 | Invalid body, ID, query, or header. |
| 401 / 403 | Invalid or revoked credential, or missing required scope, depending on the operation. |
| 404 | Resource not found or outside the authorized scope. |
| 409 | Conflict: duplicate external ID, idempotency conflict, deletion dependencies, or inconsistent consumption state/history. |
| 413 | Payload exceeds the allowed limit. |
After a network failure or publishing timeout, the event may already have been stored. Use the same idempotency key when retrying. If an ACK fails, repeat the same ACK without assuming the first attempt failed on the server.