Produce messages to a topic.

POST /topics/{topic_name}

Path parameters

  • topic_name string Required

Body

  • records array[object]
    Hide records attributes Show records attributes object
    • key string
    • value string
    • partition integer

Body

  • records array[object]
    Hide records attributes Show records attributes object
    • key string
    • value string
    • partition integer

Responses

  • 200 application/vnd.kafka.v2+json
    Hide response attribute Show response attribute object
    • offsets array[object]
      Hide offsets attributes Show offsets attributes object
      • partition integer
      • offset integer
POST /topics/{topic_name}
curl \
 --request POST 'http://{{Host}}/topics/{topic_name}' \
 --header "Content-Type: application/vnd.kafka.json.v2+json"
curl \
 --request POST 'http://{{Host}}/topics/{topic_name}' \
 --header "Content-Type: application/vnd.kafka.binary.v2+json"
Request examples
{
  "records": [
    {
      "key": "string",
      "value": "string",
      "partition": 42
    }
  ]
}
Request examples
{
  "records": [
    {
      "key": "string",
      "value": "string",
      "partition": 42
    }
  ]
}
Response examples (200)
{
  "offsets": [
    {
      "partition": 42,
      "offset": 42
    }
  ]
}