---
updatedAt: 2025-08-04T06:10:06.000Z
agentTools:
  projectIndex: https://developer.chatwork.com/llms.txt
---

# チャットのメッセージを更新する

チャットのメッセージを更新します。

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Chatwork API",
    "version": "v2",
    "description": "クラウド型ビジネスチャットツール「Chatwork」の開発者向けAPI",
    "license": {
      "name": "MIT",
      "url": "https://github.com/chatwork/chatwork-api-spec/blob/main/LICENSE"
    },
    "termsOfService": "https://go.chatwork.com/ja/terms/api.html"
  },
  "servers": [
    {
      "url": "https://api.chatwork.com/v2"
    }
  ],
  "paths": {
    "/rooms/{room_id}/messages/{message_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/room_id"
        },
        {
          "$ref": "#/components/parameters/message_id"
        }
      ],
      "put": {
        "summary": "チャットのメッセージを更新する",
        "operationId": "put-rooms-room_id-messages-message_id",
        "responses": {
          "200": {
            "description": "成功した",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_id": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/message_id"
                        },
                        {
                          "description": "更新したメッセージのID"
                        }
                      ]
                    }
                  },
                  "required": [
                    "message_id"
                  ]
                },
                "examples": {
                  "成功した": {
                    "value": {
                      "message_id": "1234"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/x_rate-limit_limit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/x_rate-limit_remaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/x_rate-limit_reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/invalid_parameter"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden_put_room_message"
          },
          "404": {
            "$ref": "#/components/responses/not_found_message"
          },
          "429": {
            "$ref": "#/components/responses/api_rate_limit_exceeded"
          }
        },
        "description": "チャットのメッセージを更新します。",
        "security": [
          {
            "chatwork_token": []
          },
          {
            "oauth_2_0": [
              "rooms.all:read_write",
              "rooms.all:write",
              "rooms.messages:write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/message_body"
                      },
                      {
                        "description": "更新するメッセージ本文"
                      }
                    ],
                    "example": "Hello Chatwork!"
                  }
                },
                "required": [
                  "body"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "errors": {
        "title": "errors",
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "errors"
        ],
        "description": "エラーメッセージ"
      },
      "message_body": {
        "type": "string",
        "title": "message_body",
        "minLength": 1,
        "maxLength": 65535,
        "example": "Hello Chatwork!",
        "description": "メッセージ本文"
      },
      "message_id": {
        "title": "message_id",
        "type": "string",
        "description": "メッセージID"
      },
      "room_id": {
        "title": "room_id",
        "type": "integer",
        "description": "ルームID"
      },
      "time": {
        "title": "time",
        "type": "integer"
      }
    },
    "parameters": {
      "room_id": {
        "name": "room_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/room_id"
        },
        "description": "ルームID"
      },
      "message_id": {
        "name": "message_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/message_id"
        },
        "description": "メッセージID"
      }
    },
    "responses": {
      "unauthorized": {
        "description": "認証に失敗した",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errors"
            },
            "examples": {
              "認証に失敗した": {
                "value": {
                  "errors": [
                    "Invalid API token"
                  ]
                }
              }
            }
          }
        }
      },
      "api_rate_limit_exceeded": {
        "description": "APIの利用回数制限を超過した",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errors"
            },
            "examples": {
              "APIの利用回数制限を超過した": {
                "$ref": "#/components/examples/api_rate_limit_exceeded"
              }
            }
          }
        },
        "headers": {
          "x-ratelimit-limit": {
            "$ref": "#/components/headers/x_rate-limit_limit"
          },
          "x-ratelimit-remaining": {
            "$ref": "#/components/headers/x_rate-limit_remaining",
            "example": 0
          },
          "x-ratelimit-reset": {
            "$ref": "#/components/headers/x_rate-limit_reset"
          }
        }
      },
      "invalid_parameter": {
        "description": "リクエストまたはアクセストークンのパラメーターが不足している、および不正な値が指定されている",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errors"
            },
            "examples": {
              "アクセストークンのパラメーターが不足している": {
                "value": {
                  "errors": [
                    "Invalid Request"
                  ]
                }
              },
              "リクエストのパラメーターが不足している": {
                "value": {
                  "errors": [
                    "Parameter 'xxx' is required"
                  ]
                }
              },
              "リクエストのパラメーターに不正な値が指定されている": {
                "value": {
                  "errors": [
                    "Parameter 'xxx' is invalid"
                  ]
                }
              }
            }
          }
        },
        "headers": {
          "x-ratelimit-limit": {
            "$ref": "#/components/headers/x_rate-limit_limit"
          },
          "x-ratelimit-remaining": {
            "$ref": "#/components/headers/x_rate-limit_remaining"
          },
          "x-ratelimit-reset": {
            "$ref": "#/components/headers/x_rate-limit_reset"
          }
        }
      },
      "not_found_message": {
        "description": "メッセージが存在しない",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errors"
            },
            "examples": {
              "メッセージが存在しない": {
                "value": {
                  "errors": [
                    "The message is not found."
                  ]
                }
              }
            }
          }
        },
        "headers": {
          "x-ratelimit-limit": {
            "$ref": "#/components/headers/x_rate-limit_limit"
          },
          "x-ratelimit-remaining": {
            "$ref": "#/components/headers/x_rate-limit_remaining"
          },
          "x-ratelimit-reset": {
            "$ref": "#/components/headers/x_rate-limit_reset"
          }
        }
      },
      "forbidden_put_room_message": {
        "description": "メッセージを変更する権限がない",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/errors"
            },
            "examples": {
              "アクセストークンのスコープが不足している": {
                "$ref": "#/components/examples/insufficient_token_scope"
              },
              "自分が所属していない、または権限が不足しているチャットのメッセージを変更する": {
                "value": {
                  "errors": [
                    "You don't have permission to send/edit message."
                  ]
                }
              },
              "自分以外が投稿したメッセージを変更する": {
                "value": {
                  "errors": [
                    "You can only edit the message you sent."
                  ]
                }
              },
              "システムメッセージを変更する": {
                "value": {
                  "errors": [
                    "You cannot update system message."
                  ]
                }
              }
            }
          }
        },
        "headers": {
          "x-ratelimit-limit": {
            "$ref": "#/components/headers/x_rate-limit_limit"
          },
          "x-ratelimit-remaining": {
            "$ref": "#/components/headers/x_rate-limit_remaining"
          },
          "x-ratelimit-reset": {
            "$ref": "#/components/headers/x_rate-limit_reset"
          }
        }
      }
    },
    "securitySchemes": {
      "chatwork_token": {
        "name": "x-chatworktoken",
        "type": "apiKey",
        "in": "header"
      },
      "oauth_2_0": {
        "type": "oauth2",
        "description": "Chatwork APIはOAuth2.0 Bearer Token Usageをサポートしています。",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://www.chatwork.com/packages/oauth2/login.php",
            "tokenUrl": "https://oauth.chatwork.com/token",
            "refreshUrl": "https://oauth.chatwork.com/token",
            "scopes": {
              "offline_access": "永続的なAPIアクセスの許可",
              "users.all:read": "自分のアカウントに紐づく情報の取得",
              "users.profile.me:read": "自分のプロフィール情報の取得",
              "users.status.me:read": "自分の未既読数の取得",
              "users.tasks.me:read": "自分のタスク一覧の取得",
              "rooms.all:read_write": "チャットルームに紐づくメッセージ・タスク・ファイル・概要・メンバー情報の操作/取得",
              "rooms.all:read": "チャットルームに紐づくメッセージ・タスク・ファイル・概要・メンバー情報の取得",
              "rooms.info:read": "自分が参加しているチャットルーム一覧の取得",
              "rooms.members:read": "自分が参加しているチャットルームのメンバーの取得",
              "rooms.messages:read": "自分が参加しているチャットルームのメッセージ取得",
              "rooms.tasks:read": "自分が参加しているチャットルームのタスク取得",
              "rooms.files:read": "自分が参加しているチャットルームにアップロードされているファイル情報を取得",
              "rooms.all:write": "チャットルームに紐づくメッセージ・タスク・ファイル・概要・メンバー情報の操作",
              "rooms:write": "チャットルームの作成と参加しているチャットルームの削除",
              "rooms.info:write": "自分が参加しているチャットルーム情報の更新",
              "rooms.members:write": "自分が参加しているチャットルームのメンバーの追加/削除/権限変更",
              "rooms.messages:write": "自分が参加しているチャットルームへのメッセージ投稿",
              "rooms.tasks:write": "自分が参加しているチャットルームでタスクを作成",
              "rooms.files:write": "自分が参加しているチャットルームへのファイルのアップロード",
              "contacts.all:read_write": "自分のコンタクト、及びコンタクト承認依頼情報の取得/操作",
              "contacts.all:read": "自分のコンタクト、及びコンタクト承認依頼情報の取得",
              "contacts.all:write": "自分あてのコンタクト承認依頼情報を操作"
            }
          }
        }
      }
    },
    "headers": {
      "x_rate-limit_limit": {
        "description": "一定期間におけるAPIの最大利用回数",
        "schema": {
          "type": "integer"
        },
        "example": 300
      },
      "x_rate-limit_remaining": {
        "description": "一定期間におけるAPIの残り利用回数",
        "schema": {
          "type": "integer"
        },
        "example": 244
      },
      "x_rate-limit_reset": {
        "description": "API利用回数制限が次にリセットされる時間。\nUnix時間（秒）で示されます。",
        "schema": {
          "$ref": "#/components/schemas/time"
        },
        "example": 1390941626
      }
    },
    "examples": {
      "insufficient_token_scope": {
        "description": "アクセストークンのスコープが不足している",
        "value": {
          "errors": [
            "Access token has insufficient scope"
          ]
        }
      },
      "api_rate_limit_exceeded": {
        "description": "APIの利用回数制限を超過した",
        "value": {
          "errors": [
            "Rate limit exceeded"
          ]
        }
      }
    }
  },
  "security": [
    {
      "chatwork_token": []
    }
  ],
  "x-readme": {
    "proxy-enabled": false
  }
}
```