--- title: "Send message" slug: "datastream-postproduce" updated: 2026-09-17T09:47:59Z published: 2026-09-17T09:47:59Z canonical: "api.ncloud-docs.com/datastream-postproduce" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Send message Available in VPC Send a message (data) to a topic. You can check the delivery result by clicking the **Topic** > **[Data]** tab menu in the Data Stream service in the NAVER Cloud Platform console. Note - For more information on how to connect to an Apache Kafka cluster via a TCP endpoint to product and consume messages, see the Data Stream user guide. - [Producer example code](https://guide.ncloud-docs.com/docs/en/datastream-procedure-example-vpc) - [Consumer example code](https://guide.ncloud-docs.com/docs/en/datastream-consumer-example-vpc) - It supports sending messages of the `STRING` type. Support for sending messages of other data types is planned for future updates. ## Request This section describes the request format. The method and URI are as follows: | Method | URI | | --- | --- | | POST | /api/produce | ### Request headers For information about the headers common to all Data Stream APIs, see [Data Stream request headers](/docs/en/datastream-overview#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94). Caution For security reasons, the access key and secret key of the main account on the NAVER Cloud Platform cannot be used for authentication. Therefore, you must create a sub account and use the access key and secret key of the sub account. For more information on how to create a sub account and check the access key and secret key, see the [Sub Account user guides](https://guide.ncloud-docs.com/docs/en/subaccount-overview). ### Request body You can include the following data in the body of your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `topic` | String | Required | Topic name - See [Get topic list](/docs/en/datastream-gettopic). | | `key` | String | Required | Message key | | `value` | String | Required | Message value (content) | | `partition` | Number | Optional | Topic partition index to send messages to - Send to random partition on no input. | ### Request example The request example is as follows: #### Unpartitioned The following is a sample request when sending without specifying a partition. ``` curl --location --request POST 'https://api.datastream.naverncp.com/api/produce' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \ --data '{ "topic": "{TopicName}", "key": "test-key", "value": "this is a test (body)" }' ``` #### Partitioned The following is a sample request when sending by specifying a partition. ``` curl --location --request POST 'https://api.datastream.naverncp.com/api/produce' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \ --data '{ "topic": "{TopicName}", "key": "test-key", "value": "this is a test (body)", "partition": 0 }' # Partition numbers start from 0 ``` ## Response This section describes the response format. ### Response body The response body includes the following data: | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | Number | Required | [Response status codes](/docs/en/datastream-postproduce#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C) | | `detail` | String | Required | [Response status code message](/docs/en/datastream-postproduce#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C) | #### Response status codes The following describes the response status codes. | HTTP status code | Code | Message | Description | | --- | --- | --- | --- | | 200 | - | OK | Request succeeded | | 400 | - | Bad Request | Invalid request or body values | | 400 | - | Bad Request, Invalid headers | Invalid header request | | 400 | - | Bad Request, Invalid topic partition | Invalid partition request | | 401 | - | Unauthorized | Authentication failed | | 403 | - | Forbidden | Unauthorized | | 500 | - | Internal Server Error | Unresolved error | ### Response example The response example is as follows: ``` { "status": "200", "detail" : "OK" } ```