--- title: "トピックの更新" slug: "datastream-puttopicid" updated: 2026-09-17T09:57:39Z published: 2026-09-17T09:57:39Z canonical: "api.ncloud-docs.com/datastream-puttopicid" --- > ## 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. # トピックの更新 VPC環境で利用できます。 トピック情報を更新します。 ## リクエスト リクエスト形式を説明します。リクエスト形式は次の通りです。 | メソッド | URI | | --- | --- | | PUT | /api/v1/topics/{topicId} | ### リクエストヘッダ Data Stream APIで共通して使用されるヘッダの詳細は、[Data Streamのリクエストヘッダ](/docs/ja/datastream-overview#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94)をご参照ください。 ### リクエストパスパラメータ リクエストパスパラメータの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `topicId` | String | Required | トピック ID - [トピックリストの照会](/docs/ja/datastream-gettopic)を参照 | ### リクエストボディ リクエストボディの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `description` | String | Required | トピックの説明 (最大200文字) | | `partitions` | Number | Required | トピックパーティション数 - 1~16 (デフォルト: 1) - 作成時に設定した数から減らすことはできず、追加のみ可能 | | `retentionMs` | Number | Required | トピックパーティションメッセージの保存期間(ミリ秒) - 3600000~1296000000 (デフォルト: 86400000) | ### リクエスト例 リクエストのサンプルコードは次の通りです。 ``` curl --location --request PUT 'https://datastream.apigw.ntruss.com/api/v1/topics/mgNWA*****' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \ --data '{ "description": "This is a description", "partition": 3, "retentionMs": 86400000 }' ``` ## レスポンス レスポンス形式を説明します。 ### レスポンスボディ レスポンスボディの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `topicId` | String | - | トピック ID | | `topicName` | String | - | トピック名 | | `description` | String | - | トピックの説明 | | `partitions` | Number | - | トピックパーティション数 | | `retentionMs` | Number | - | トピックパーティションデータの保存期間(ミリ秒) | | `status` | String | - | トピックの状態 - `CREATED` (有効値) - トピック作成完了、正常に動作(有効化) | | `tcpEndpoint` | String | - | TCPエンドポイント | | `createdDate` | String | - | トピック作成日時 - ISO 8601形式 - `YYYY-MM-DDThh:mm:ssZ` | | `updatedDate` | String | - | トピック更新日時 - ISO 8601形式 - `YYYY-MM-DDThh:mm:ssZ` | ### レスポンスステータスコード Data Stream APIで共通して使用されるレスポンスステータスコードの詳細は、[Data Streamのレスポンスステータスコード](/docs/ja/datastream-overview#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C)をご参照ください。 ### レスポンス例 レスポンスのサンプルコードは次の通りです。 ``` { "topicId": "mgNWA*****", "topicName": "h4j6l-ds001", "description": "This is a description", "partitions": 3, "retentionMs": 86400000, "status": "CREATED", "tcpEndpoint": "cluster-1.datastream.naverncp.com:30010", "createdDate": "2025-06-02T15:20:18Z", "updatedDate": "2025-06-05T09:27:47Z" } ```