Skip to content
Start here

Data

Produce records
POST/produce
ModelsExpand Collapse
DataProduceResponse object { success }
success: true

DataSubscriptions

List subscriptions
GET/subscriptions
Create subscription
POST/subscriptions
Get subscription
GET/subscriptions/{subscription_id}
Delete subscription
DELETE/subscriptions/{subscription_id}
Consume records
POST/subscriptions/{subscription_id}/consume
ModelsExpand Collapse
SubscriptionListResponse object { id, created_at, modified_at, 2 more }
id: string

Specifies the ID of the subscription.

created_at: string
formatdate-time
modified_at: string
formatdate-time
name: string
start_at: object { type }
type: "earliest" or "latest"
One of the following:
"earliest"
"latest"
SubscriptionCreateResponse object { id }
id: string

Specifies the ID of the subscription.

SubscriptionGetResponse object { id, created_at, modified_at, 2 more }
id: string

Specifies the ID of the subscription.

created_at: string
formatdate-time
modified_at: string
formatdate-time
name: string
start_at: object { type }
type: "earliest" or "latest"
One of the following:
"earliest"
"latest"
SubscriptionDeleteResponse object { id }
id: string

Specifies the ID of the subscription.

SubscriptionConsumeResponse object { batch_id, leased_until_ms, records }
batch_id: string

Identifies the delivered batch for ACK, NACK, and extend. Null when the response contains no records.

leased_until_ms: number

Shows when the lease on the batch expires, in epoch milliseconds. ACK or NACK the batch before then. Null when the response contains no records.

records: array of object { content, timestamp_ms, headers }
content: string

The record payload, encoded as standard base64.

formatbyte
timestamp_ms: number

Shows when K2 received the record, in epoch milliseconds.

headers: optional map[string]

Lists the metadata the producer attached to the record. Omitted when the record carries none.

DataSubscriptionsBatches

Acknowledge batch
POST/subscriptions/{subscription_id}/batches/{batch_id}/ack
Release batch
POST/subscriptions/{subscription_id}/batches/{batch_id}/nack
Extend batch lease
POST/subscriptions/{subscription_id}/batches/{batch_id}/extend
ModelsExpand Collapse
BatchAckResponse = unknown
BatchNackResponse = unknown
BatchExtendResponse object { leased_until_ms }
leased_until_ms: number

Shows the new lease expiry, in epoch milliseconds.