Docs menu

Edit conversation message

PATCH /v1/organisations/{organisation_id}/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}

Changes the text of your own message where it is, marked edited, without a turn. Later compaction summaries are discarded so no turn reads the old text.

Authentication

Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work

Scope the API key needs: conversations:write

Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)

Parameters

  • organisation_id path string required
  • space_id path string required
  • conversation_id path string required
  • message_id path string required

Request body

application/json UpdateChatMessage required

Responses

  • 200 application/json ChatMessage

    The message, edited in every version that holds it

  • 401 application/json ErrorBody

    unauthenticated

  • 403 application/json ErrorBody

    Not the caller's message; not_a_participant; insufficient_scope; workspace_content_restricted, invalid_origin

  • 404 application/json ErrorBody

    No such conversation or message, or conversations with people are off

  • 409 application/json ErrorBody

    edit_creates_branch: only agent replies follow the message (or nobody else takes part), so editAgentMessage edits it and the agent answers again; edit_on_platform: written in Slack or Teams, it is edited there and Ivy follows; invite_required (details.participants); workspace_archived; channel_archived: the channel is archived and read-only

  • 422 application/json ErrorBody

    validation_failed (reason not_quotable for a quote that isn't an earlier message of this conversation still in it); not_a_workspace_member, agent_not_enabled for a mention

  • 429 application/json ErrorBody

    rate_limited: the API key's requests per minute are used up; retry after Retry-After seconds

  • 500 application/json ErrorBody

    internal

  • 503 application/json ErrorBody

    unavailable: the database is briefly unavailable; retry after Retry-After seconds

Error codes

Errors come back as an ErrorBody whose code is one of these.

  • 401 unauthenticated
  • 403 not_a_participantinsufficient_scopeworkspace_content_restrictedinvalid_origin
  • 404 not_found generic code for this status
  • 409 edit_creates_branchedit_on_platforminvite_requiredworkspace_archivedchannel_archived
  • 422 validation_failednot_a_workspace_memberagent_not_enabled
  • 429 rate_limited
  • 500 internal
  • 503 unavailable

Examples

curl
curl -X PATCH "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/spaces/$SPACE_ID/conversations/$CONVERSATION_ID/messages/$MESSAGE_ID" \
  -H "Authorization: Bearer $IVY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello, Ivy"}'
JavaScript SDK
import { client, editConversationMessage } from "@spacivapp/ivy-sdk";

client.setConfig({
  baseUrl: process.env.IVY_API_URL,
  headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});

const { data, error, response } = await editConversationMessage({
  path: { organisation_id: organisationId, space_id: spaceId, conversation_id: conversationId, message_id: messageId },
  body: {
    text: "Hello, Ivy"
  },
});
Example request body
{
  "quote": {
    "message_id": "message_123"
  },
  "text": "Hello, Ivy"
}
Example response (200)
{
  "acting_for": {
    "id": "id_123",
    "type": "user"
  },
  "ask_id": "ask_123",
  "attachments": [
    {
      "file_id": "file_123",
      "name": "Ada Lovelace"
    }
  ],
  "author": {
    "id": "id_123",
    "type": "user"
  },
  "author_name": "Ada Lovelace",
  "branch": {
    "count": 0,
    "index": 0
  },
  "created_at": "2026-01-15T09:30:00Z",
  "deleted_at": "2026-01-15T09:30:00Z",
  "edited_at": "2026-01-15T09:30:00Z",
  "feedback": "up",
  "file_links": [
    {
      "file_id": "file_123",
      "name": "Ada Lovelace",
      "path": "string",
      "space_id": "space_123",
      "version": 1,
      "workspace_id": "workspace_123"
    }
  ],
  "id": "id_123",
  "in_reply_to": "string",
  "mentions": [
    "string"
  ],
  "model": "string",
  "notice": {
    "actor": {
      "id": "id_123",
      "type": {}
    },
    "channel_id": "channel_123",
    "conversation_id": "conversation_123",
    "kind": "invited",
    "participants": [
      "string"
    ],
    "title": "string"
  },
  "origin": {
    "platform_message_id": "platform_message_123",
    "source": "web"
  },
  "parts": [
    {
      "text": "Hello, Ivy",
      "type": "text"
    }
  ],
  "quote": {
    "author": {
      "id": "id_123",
      "type": {}
    },
    "author_name": "Ada Lovelace",
    "created_at": "2026-01-15T09:30:00Z",
    "deleted": false,
    "excerpt": "string",
    "message_id": "message_123"
  },
  "reactions": [
    {
      "emoji": "string",
      "participants": [
        "string"
      ]
    }
  ],
  "read_through": "string",
  "role": "user",
  "stopped_by": {
    "id": "id_123",
    "type": "user"
  },
  "thinking": [
    {
      "before_part": 0,
      "duration_ms": 0,
      "text": "Hello, Ivy"
    }
  ]
}