Bulk Event Ingestion
Emit up to 100 events per request using the /api/v1/events/bulk endpoint.
Use this endpoint to emit multiple events in one request:
POST https://api.meshes.io/api/v1/events/bulk
You can authenticate with either:
X-Meshes-Publishable-Key(recommended for client-side), orAuthorization: Bearer <jwt>(server-side only)
Request
Send a JSON array of events. Each item supports the same shape as single-event ingestion:
event(string, required)payload(object, required)resource(string, optional)resource_id(string, optional)
Example: curl (publishable key)
curl -X POST https://api.meshes.io/api/v1/events/bulk \
-H "X-Meshes-Publishable-Key: <WORKSPACE_PUBLISHABLE_KEY>" \
-H "Content-Type: application/json" \
-d '[
{
"event": "contact.created",
"payload": {
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Doe"
}
},
{
"event": "contact.created",
"payload": {
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe"
}
}
]'
Example: TypeScript (Meshes client)
import { MeshesEventsClient } from '@mesheshq/events';
const client = new MeshesEventsClient(process.env.WORKSPACE_PUBLISHABLE_KEY!);
await client.emitBatch([
{
event: 'contact.created',
payload: {
email: 'jane@example.com',
first_name: 'Jane',
last_name: 'Doe',
},
},
{
event: 'contact.created',
payload: {
email: 'john@example.com',
first_name: 'John',
last_name: 'Doe',
},
},
]);
Limits
- Up to 100 events per request.
Processing Order
Event processing order is not guaranteed for bulk ingestion. Even if events are submitted in a specific order, they may be processed and delivered out of order.
If ordering matters, include your own ordering fields in the payload (e.g., sequence, timestamp, or an idempotency key) so downstream systems can sort or deduplicate.
Responses
201 Created— all events accepted207 Mixed Results— some events accepted, some rejected (check the response for per-item errors)400 Bad Request— invalid request format401 Unauthorized— missing/invalid key or token500 Internal Error
A 207 response includes per-item success/error details for each event in the batch.