EventHarbor DOCUMENTATION Open console

Build your event flow.

A persistent event API for connecting systems. Publish a message, poll when you need it, and acknowledge it after processing.

ProducerPublish

Store events in a persistent log.

ConsumerPoll

Your client initiates polling.

ProgressProcess & ACK

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.

cURL · client registration
# 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 · key issuance
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 · publishing
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 · polling
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.

JSON · received batch
{
  "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.

cURL · explicit ACK
# 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"}'
Polling does not acknowledge processing.

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.

Account and API key

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 BigInt for comparisons; never convert them to Number.
  • 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.

Same key + same contentThe original response is returned with 201, without a new event.
Same key + different content409 Conflict, without incrementing the sequence.
No idempotency keyEach publication can create a distinct event.

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

API key · clients:manageSuccess: 201

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

API key · clients:manageSuccess: 200

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

API key · clients:manageSuccess: 200

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

API key · clients:manageSuccess: 201

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

API key · clients:manageSuccess: 200

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

API key · clients:manageSuccess: 204

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

Producer keySuccess: 201

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

Consumer keySuccess: 200

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

Consumer keySuccess: 200

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

Consumer keySuccess: 200

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.

JavaScript / TypeScript@eventharbor/sdkNode.js ≥ 22 · ESMsdks/typescript
Goeventharbor.io/sdk/goGo ≥ 1.22sdks/go
Pythoneventharbor-sdkPython ≥ 3.11 · synchronoussdks/python
PHPeventharbor/sdkPHP ≥ 8.2 · cURL + JSONsdks/php
Javaio.eventharbor:eventharbor-sdkJava ≥ 17 · Mavensdks/java

Set 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.

Shell · cURL
curl --version
# Default URL: https://api.eventharbor.io
# No SDK required. Use the Quickstart examples.
cURL · publishing
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

Current limits
ResourceLimit
JSON body / publication256 KiB (262144 bytes)
New consumption batch1 MiB of JSON (1048576 bytes)
Events per poll100 by default · maximum 1000
Items per management listing20 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.

Errors your integration should handle
HTTPMeaning
400Invalid body, ID, query, or header.
401 / 403Invalid or revoked credential, or missing required scope, depending on the operation.
404Resource not found or outside the authorized scope.
409Conflict: duplicate external ID, idempotency conflict, deletion dependencies, or inconsistent consumption state/history.
413Payload 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.