Docs menu

Create conversation legacy

POST /v1/organisations/{organisation_id}/workspaces/{workspace_id}/conversations Deprecated

Starts an empty chat for the caller in the space. Without a body, a chat with the space's built-in assistant; with participants, a conversation with those space members and agents (a DM with one of them, a group with more). A space whose agent conversations are shared creates a conversation with an agent as a shared thread.

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
  • workspace_id path string required

Request body

application/json CreateConversation | null

Responses

  • 201 application/json Conversation

    The chat, private to the caller (or, with participants, to them and the participants)

  • 401 application/json ErrorBody

    unauthenticated

  • 403 application/json ErrorBody

    workspace_content_restricted, invalid_origin, insufficient_scope (also for an API key naming a person: keys never reach people); no_channel_grant: an API key starting a thread in an invited channel no member granted it; not_a_channel_member: the caller reads this open channel but hasn't joined it, and only members post (join with addChannelMembers)

  • 404 application/json ErrorBody

    No such space, or the caller can't see it; with channel_id, no such channel the caller reads

  • 409 application/json ErrorBody

    workspace_archived; channel_archived

  • 422 application/json ErrorBody

    validation_failed, also for participants or visibility while conversations with people are off, and for channel_id while channels are off; not_a_workspace_member; agent_not_enabled

  • 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 workspace_content_restrictedinvalid_origininsufficient_scopeno_channel_grantnot_a_channel_member
  • 404 not_found generic code for this status
  • 409 workspace_archivedchannel_archived
  • 422 validation_failedvisibilitynot_a_workspace_memberagent_not_enabled
  • 429 rate_limited
  • 500 internal
  • 503 unavailable

Examples

curl
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/workspaces/$WORKSPACE_ID/conversations" \
  -H "Authorization: Bearer $IVY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "channel_123",
    "participants": [
      "string"
    ],
    "title": "string",
    "visibility": "private"
  }'
JavaScript SDK
import { client, createConversationLegacy } 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 createConversationLegacy({
  path: { organisation_id: organisationId, workspace_id: workspaceId },
  body: {
    channel_id: "channel_123",
    participants: [
      "string"
    ],
    title: "string",
    visibility: "private"
  },
});
Example request body
{
  "channel_id": "channel_123",
  "participants": [
    "string"
  ],
  "title": "string",
  "visibility": "private"
}
Example response (201)
{
  "agent_id": "agent_123",
  "answer_mode": "every_message",
  "archived_at": "2026-01-15T09:30:00Z",
  "assignee": "string",
  "can_post": false,
  "channel_id": "channel_123",
  "chat_origin": {
    "binding_id": "binding_123",
    "channel_name": "Ada Lovelace",
    "platform": "slack"
  },
  "created_at": "2026-01-15T09:30:00Z",
  "created_by": {
    "id": "id_123",
    "type": "user"
  },
  "id": "id_123",
  "kind": "direct",
  "last_message_at": "2026-01-15T09:30:00Z",
  "last_read": 1,
  "last_reply_at": "2026-01-15T09:30:00Z",
  "last_reply_by": {
    "id": "id_123",
    "type": "user"
  },
  "latest_replies": [
    {
      "author": {
        "id": "id_123",
        "type": {}
      },
      "author_name": "Ada Lovelace",
      "author_platform": "slack",
      "created_at": "2026-01-15T09:30:00Z",
      "excerpt": "string",
      "mentions": [
        "string"
      ],
      "message_id": "message_123",
      "text": "Hello, Ivy",
      "text_cut": false
    }
  ],
  "mentioned": false,
  "notify": "all",
  "participant_keys": [
    "string"
  ],
  "peer_key": "string",
  "pinned": false,
  "post": {
    "author": {
      "id": "id_123",
      "type": {}
    },
    "author_name": "Ada Lovelace",
    "author_platform": "slack",
    "created_at": "2026-01-15T09:30:00Z",
    "excerpt": "string",
    "mentions": [
      "string"
    ],
    "message_id": "message_123",
    "text": "Hello, Ivy",
    "text_cut": false
  },
  "reply_count": 0,
  "run_state": "working",
  "space_id": "space_123",
  "status": "open",
  "title": "string",
  "unread_count": 0,
  "updated_at": "2026-01-15T09:30:00Z",
  "visibility": "private",
  "workspace_id": "workspace_123"
}