HTTP Endpoints
This pages describes the HTTP endpoints available in the WarpStream Kafka product.
Authentication and Authorization
These rules apply to all HTTP endpoints on this page. Each API section below only documents what is specific to it, such as the required ACL permission or a different credential header.
Authentication
All endpoints support optional HTTP Basic Auth carrying your WarpStream credentials (the same ones used for Kafka SASL/PLAIN). When the Agent is configured to require SASL authentication, credentials are mandatory; otherwise they can be omitted.
With curl, use the -u flag:
curl -u 'ccun_YOUR_USERNAME:ccp_YOUR_PASSWORD' ...This is equivalent to setting the Authorization header manually with the base64-encoded username:password pair:
curl -H 'Authorization: Basic Y2N1bl9ZT1VSX1VTRVJOQU1FOmNjcF9ZT1VSX1BBU1NXT1JE' ...The Datadog log intake endpoints are the one exception: they accept the same credentials via the DD-API-KEY header instead of Basic Auth. See Datadog HTTP Log Intake for details.
mTLS authentication is not supported for any of the HTTP endpoints.
Authorization (ACLs)
All endpoints enforce the same Kafka ACLs as the native Kafka protocol:
The ACL principal is derived from the authenticated username as
User:<username>. For example, if you authenticate asccun_abc123, the ACL principal will beUser:ccun_abc123.If authentication is optional and no credentials are provided, the request is evaluated as the anonymous principal.
The required permission depends on the API: the fetch endpoints require
READon each topic being fetched, while the produce and Datadog log intake endpoints requireWRITEon each destination topic.
HTTP Fetch APIs
The WarpStream Agent exposes HTTP/JSON endpoints for fetching records from Kafka topics without a native Kafka client. All endpoints are served on the Agent's HTTP port (8080 by default).
Authentication and Authorization
See Authentication and Authorization. Specific to the fetch endpoints:
They require
READpermission on each topic being fetched.If the authenticated user does not have
READaccess to a topic, the partition will be returned with aTOPIC_AUTHORIZATION_FAILEDerror code (for/v1/kafka/fetch) or a400error response (for the single-record endpoints).
Common Headers
kafka-client-id
Identifies the client for logging and diagnostics
http-fetch-client / http-fetch-single-record-client
Endpoints
GET or POST /v1/kafka/fetch
Full-featured fetch endpoint that mirrors the Kafka Fetch protocol. Supports fetching from multiple topics and partitions in a single request.
Request Body (JSON)
topics
array
yes
List of topics to fetch from
topics[].topic
string
yes
Topic name
topics[].partitions
array
yes
List of partitions to fetch from
topics[].partitions[].partition
integer
yes
Partition index (≥ 0)
topics[].partitions[].fetch_offset
integer
yes
Offset to start fetching from (≥ 0)
topics[].partitions[].partition_max_bytes
integer
yes
Max bytes to fetch for this partition (> 0)
max_bytes
integer
no
Max bytes for the entire fetch response (≥ 0). Default: 0 (agent-managed)
max_records
integer
no
Max total records to return across all partitions (≥ 0). 0 means unlimited. Parsing stops early once the budget is reached.
isolation_level
string
no
"read_uncommitted" (default) or "read_committed"
long_poll
boolean
no
If true, the agent waits up to 30s for new data instead of returning immediately. Default: false
Example Request
Success Response (200 OK)
Note:
key,value, and headervaluefields are base64-encoded byte arrays. A JSONnullindicates a nil key/value.
Error Response (400 Bad Request / 500 Internal Server Error)
GET /v1/kafka/fetch_single_record
Convenience endpoint for fetching a single record at a specific offset using query parameters.
Query Parameters
topic
string
yes
Topic name
partition
integer
yes
Partition index (≥ 0)
offset
integer
yes
Exact offset to fetch (≥ 0)
Example Request
Success Response (200 OK)
Returns the record directly as a JSON object (not wrapped in the topic/partition structure):
Not Found Response (404 Not Found)
Returned when no record exists at the requested offset (e.g., the offset is beyond the high watermark or below the low watermark):
Error Response (400 Bad Request)
GET /v1/kafka/topics/{topic}/partitions/{partition}/records/{offset}
REST-style convenience endpoint for fetching a single record at a specific offset using path parameters. Functionally identical to /v1/kafka/fetch_single_record.
Path Parameters
topic
string
yes
Topic name
partition
integer
yes
Partition index (≥ 0)
offset
integer
yes
Exact offset to fetch (≥ 0)
Example Request
Responses
Identical to /v1/kafka/fetch_single_record:
200 OK— The record as a JSON object.404 Not Found— No record at the requested offset (OFFSET_OUT_OF_RANGE).400 Bad Request— Invalid path parameters.
Error Codes
The code field in error responses maps to Kafka protocol error codes:
400
INVALID_REQUEST
Malformed request (bad JSON, missing fields, invalid values)
401
SASL_AUTHENTICATION_FAILED
Missing or invalid credentials
403
TOPIC_AUTHORIZATION_FAILED
ACL denied read access to the topic
404
OFFSET_OUT_OF_RANGE
No record exists at the requested offset
500
KAFKA_STORAGE_ERROR
Internal error fetching data
HTTP Produce APIs
The WarpStream Agent exposes HTTP/JSON endpoints for producing records to Kafka topics without a native Kafka client. All endpoints are served on the Agent's HTTP port (8080 by default).
Two API styles are available:
Confluent REST Proxy v2-compatible endpoints (
POST /topics/{topic}andPOST /topics/{topic}/partitions/{partition}) — drop-in compatible with existing Confluent REST Proxy v2 tooling. Single topic per request, automatic partitioning.WarpStream-native endpoint (
POST /v1/kafka/produce) — mirrors the Kafka Produce protocol. Supports multiple topics and partitions per request with explicit partition assignment, per-record timestamps, and headers.
Authentication and Authorization
See Authentication and Authorization. Specific to the produce endpoints:
They require
WRITEpermission on each destination topic.If the authenticated principal does not have write access, the affected records fail with an authorization error:
403 TOPIC_AUTHORIZATION_FAILEDfor the native endpoint, or error code40301for the v2-compatible endpoints.
Common Headers
kafka-client-id
Identifies the client for logging and diagnostics
http-produce-client / http-produce-v2-client
Content-Encoding
Optional request compression (gzip or zstd)
none
The request body limit is 64 MiB after decompression.
Confluent REST Proxy v2-Compatible Endpoints
These endpoints implement the Confluent REST Proxy v2 produce API for the binary and json embedded formats. Schema-based formats (avro, jsonschema, protobuf) are not supported and return 415 Unsupported Media Type.
Content Types
The Content-Type request header selects the embedded format:
application/vnd.kafka.binary.v2+json
binary: key and value are base64-encoded strings
application/vnd.kafka.json.v2+json
json: key and value are arbitrary JSON, stored as their JSON serialization
application/vnd.kafka.v2+json
Treated as binary
application/json
Treated as binary
application/octet-stream
Treated as binary
Responses always use Content-Type: application/vnd.kafka.v2+json.
POST /topics/{topic}
Produce records to a topic, optionally specifying keys or partitions per record.
Request Body (JSON)
records
array
yes
List of records to produce (must not be empty)
records[].key
object
no
Record key, formatted according to the embedded format, or null to omit
records[].value
object
no
Record value, formatted according to the embedded format
records[].partition
integer
no
Partition to store the record in
records[].headers
array
no
Record headers: {"key": string, "value": base64 string} (WarpStream extension)
Partitioning
Each record's partition is chosen with the same semantics as Kafka's default partitioner:
If
records[].partitionis set, it is used directly.Otherwise, if the record has a key, the partition is
murmur2(serialized key) % partition count— identical to the Kafka Java client and Confluent REST Proxy, so records produced over HTTP land on the same partitions as records produced with a Kafka client.Otherwise (keyless records), all keyless records in the request share one sticky partition, which rotates round-robin across requests.
Example Requests
Binary format (base64 key and value):
JSON format (arbitrary JSON key and value):
Success Response (200 OK)
offsets contains one entry per record, in the same order as the request:
If an individual record fails, its entry has null partition and offset and a non-null error_code and error:
Request-Level Error Response
POST /topics/{topic}/partitions/{partition}
Produce records directly to a single partition. Identical to POST /topics/{topic} except that all records are written to the partition from the path, and per-record partition fields are ignored.
Path Parameters
topic
string
yes
Topic name
partition
integer
yes
Partition index (≥ 0)
Example Request
If the partition does not exist, the request fails with 404 and error code 40402.
v2 Error Codes
Error codes follow the Confluent REST Proxy v2 numeric scheme:
HTTP Status
error_code
Meaning
400
400
Serialization failure (e.g. invalid base64 in binary format)
401
40101
Missing or invalid credentials
403
40301
ACL denied write access to the topic
404
40401
Topic does not exist
404
40402
Partition does not exist
413
413
Request body exceeds 64 MiB after decompression, or record too large
415
415
Unsupported embedded format (e.g. avro, protobuf)
422
422
Request validation failure (e.g. empty records list)
500
50002
Non-retriable Kafka error
500
50003
Retriable Kafka error; the produce might succeed if retried
Per-record failures inside a 200 OK response use 50002, 50003, or 40301 in the offsets[].error_code field. If any record fails with an authorization error, the overall HTTP status is 403.
WarpStream-Native Endpoint
POST /v1/kafka/produce
Full-featured produce endpoint that mirrors the Kafka Produce protocol. Supports producing to multiple topics and partitions in a single request with explicit partition assignment.
Request Body (JSON)
topics
array
yes
List of topics to produce to
topics[].topic
string
yes
Topic name
topics[].partitions
array
yes
List of partitions to produce to
topics[].partitions[].partition
integer
yes
Partition index (≥ 0)
topics[].partitions[].records
array
yes
List of records for this partition
topics[].partitions[].records[].key
string
no
Base64-encoded record key, or null for no key
topics[].partitions[].records[].value
string
no
Base64-encoded record value, or null for a tombstone
topics[].partitions[].records[].headers
array
no
Record headers: {"key": string, "value": base64 string}
topics[].partitions[].records[].timestamp
integer
no
Record timestamp in milliseconds since the Unix epoch. If 0 or omitted, the Agent assigns the current time.
timeout_ms
integer
no
Produce timeout in milliseconds. Default: 10000
Example Request
Success Response (200 OK)
The response mirrors the Kafka Produce response. Per-partition failures are reported in the body with a 200 status, so check each partition's error_code:
base_offset is the offset assigned to the first record in the partition's batch; subsequent records occupy consecutive offsets.
Error Response (400 Bad Request / other statuses)
Native Endpoint Error Codes
The code field in error responses maps to Kafka protocol error codes, in the same style as the HTTP fetch endpoints:
400
INVALID_REQUEST
Malformed request (bad JSON, missing fields, invalid values)
401
SASL_AUTHENTICATION_FAILED
Missing or invalid credentials
403
TOPIC_AUTHORIZATION_FAILED
ACL denied write access to the topic
404
UNKNOWN_TOPIC_OR_PARTITION
Topic or partition does not exist
413
MESSAGE_TOO_LARGE
Request body exceeds 64 MiB after decompression
500
KAFKA_STORAGE_ERROR
Internal error producing data
Datadog HTTP Log Intake
Datadog Log Intake APIs
The WarpStream Agent exposes Datadog-compatible HTTP/JSON endpoints for accepting log batches from the Datadog Agent and producing them into Kafka topics. All endpoints are served on the Agent's HTTP port (8080 by default).
Authentication and Authorization
See Authentication and Authorization. Specific to the log intake endpoints:
These endpoints use the
DD-API-KEYheader rather than HTTP Basic Auth. WarpStream interpretsDD-API-KEYas Kafka SASL/PLAIN credentials encoded as$SASL_USERNAME:$SASL_PASSWORD.If
DD-API-KEYis present but malformed and SASL auth is optional, it is ignored.If
DD-API-KEYis missing or malformed and SASL auth is required, the request fails with401 SASL_AUTHENTICATION_FAILED.They require
WRITEpermission on the destination topic. If the authenticated principal does not have write access to the topic, the request fails with403 TOPIC_AUTHORIZATION_FAILED.
Example:
Common Headers
DD-API-KEY
WarpStream Kafka SASL/PLAIN credentials encoded as username:password
omitted
kafka-client-id
Identifies the client for logging and diagnostics
http-datadog-logs-client
Content-Type
Must be application/json
none
Content-Encoding
Optional request compression
none
Datadog Agent Configuration
When configuring the Datadog Agent, point logs_dd_url at the path prefix only. Do not include /api/v2/logs or /v1/input in the configured URL, because the Datadog Agent appends the intake suffix itself.
Example Datadog Agent configuration for the primary endpoint:
If you want Datadog to use the compatibility endpoint instead, set:
Common Behavior
These endpoints share the following behavior:
The
$TOPIC_NAMEpath parameter is the exact Kafka topic name to produce to.The topic must already exist.
The topic name must be a valid Kafka topic name.
The request body limit is
64 MiBafter decompression.Each JSON object in the submitted array becomes one Kafka record.
The JSON object is stored as the Kafka record value exactly as submitted.
No Kafka key is set.
No Datadog-specific fields are interpreted or transformed.
All records from a single HTTP request are written to the same partition.
Across requests, the Agent rotates partitions over time for rough byte-based balancing.
Raw Endpoint Specs
POST /dd/$TOPIC_NAME/api/v2/logs
Primary Datadog-compatible log intake endpoint.
This is the preferred route for Datadog Agents configured with use_v2_api: true.
Path Parameters
topic
string
yes
Destination Kafka topic name
Request Body (JSON)
The request body must be one of:
[{...}, {...}]
A JSON array of log objects. Each array element becomes one Kafka record value.
{}
Connectivity probe. Accepted but does not produce any records.
The Agent treats each array element as an opaque JSON object. Common Datadog fields like message, service, ddsource, ddtags, hostname, status, and timestamp are preserved exactly as sent.
Example Request
Success Response (200 OK)
POST /dd/$TOPIC_NAME/v1/input
Compatibility alias for Datadog Agents configured with use_v2_api: false.
This endpoint has the same authentication, authorization, request-body, partitioning, and response semantics as /dd/$TOPIC_NAME/api/v2/logs.
Example Request
Success Response (200 OK)
Connectivity Probe
The Datadog Agent may send an empty JSON object to check HTTP connectivity:
This is accepted and returns 200 OK with an empty JSON response body:
No Kafka records are produced for connectivity probes.
Request Compression
These endpoints support compressed request bodies via Content-Encoding.
Supported encodings for Datadog-style traffic:
gzipzstd
The 64 MiB request-size limit is enforced after decompression.
Error Codes
The code field in error responses maps either to Kafka protocol error codes or endpoint-specific validation errors.
400
INVALID_REQUEST
Malformed JSON, unsupported content type, non-empty top-level object, trailing JSON tokens, or other request-shape validation failure
400
INVALID_TOPIC_EXCEPTION
Invalid topic name or topic does not exist
401
SASL_AUTHENTICATION_FAILED
Missing, malformed, or invalid DD-API-KEY when authentication is required
403
TOPIC_AUTHORIZATION_FAILED
ACL denied write access to the topic
413
PAYLOAD_TOO_LARGE
Request body exceeds 64 MiB after decompression
413
MESSAGE_TOO_LARGE
One or more produced records exceed the Agent's maximum record size
500
KAFKA_STORAGE_ERROR
Internal metadata lookup, authorization, or produce failure
Example Error Response
Notes
These endpoints are intended for Datadog-compatible log ingestion. For general-purpose Kafka-over-HTTP produce, see the HTTP Produce APIs above.
Partitioning is request-scoped: all records in one HTTP request go to one partition.
Partition selection starts from a random partition per topic and rotates round-robin over time based on accumulated request bytes.
If you need different routing, use a different
$TOPIC_NAMEpath prefix for each Datadog sender configuration.
Last updated
Was this helpful?