Ir al contenido principal
Conversations

Create a conversation

Creates a new conversation. Supports both contact-initiated (customer/lead) and admin-initiated (outreach) conversations.

POST
/v2/conversations

Contact-Initiated Conversation

For conversations started by a customer or lead:

FieldTypeRequiredDescription
from.typestringYesMust be "contact"
from.idstringYesThe Featurebase contact ID (24-character ObjectId)
bodyMarkdownstringYesThe initial message content in markdown format. Images referenced by URL or as base64 data URIs will be automatically uploaded and stored.
channelstringNoThe channel: "desktop" (default) or "email"
createdAtstringNoISO timestamp for migrations

Example Contact-Initiated Request

{
  "from": {
    "type": "contact",
    "id": "676f0f6765bdaa7d7d760f88"
  },
  "bodyMarkdown": "Hello, I have a question about your product.",
  "channel": "desktop"
}

Admin-Initiated Outreach

For outreach conversations started by an admin:

FieldTypeRequiredDescription
from.typestringYesMust be "admin"
from.idstringYesThe Featurebase admin ID (24-character ObjectId)
bodyMarkdownstringYesThe initial message content in markdown format. Images referenced by URL or as base64 data URIs will be automatically uploaded and stored.
channelstringNoThe channel: "desktop" (default) or "email"
recipientsobjectYesRecipients for the outreach
recipients.toobjectYesPrimary recipients
recipients.to.emailsstring[]No*Email addresses
recipients.to.idsstring[]No*Featurebase contact IDs
recipients.ccobjectNoCC recipients (same structure as "to")
recipients.bccobjectNoBCC recipients (same structure as "to")
subjectstringNo**Email subject line
createdAtstringNoISO timestamp for migrations

*At least one email or ID is required in recipients.to **Required when channel is "email"

Example Admin Outreach (In-App)

{
  "from": {
    "type": "admin",
    "id": "507f1f77bcf86cd799439011"
  },
  "bodyMarkdown": "Hi! Just following up on your inquiry.",
  "channel": "desktop",
  "recipients": {
    "to": {
      "ids": ["676f0f6765bdaa7d7d760f88"]
    }
  }
}

Example Admin Outreach (Email)

{
  "from": {
    "type": "admin",
    "id": "507f1f77bcf86cd799439011"
  },
  "bodyMarkdown": "Hi! Just following up on your inquiry.",
  "channel": "email",
  "subject": "Following up on your inquiry",
  "recipients": {
    "to": {
      "emails": ["john@example.com"]
    },
    "cc": {
      "emails": ["manager@example.com"]
    }
  }
}

Response

Returns the created conversation object with a 201 Created status.

Example Response

{
  "object": "conversation",
  "id": "12345",
  "state": "open",
  "priority": false,
  "adminAssigneeId": null,
  "participants": [
    { "type": "customer", "id": "676f0f6765bdaa7d7d760f88" }
  ],
  "source": {
    "channel": "desktop",
    "deliveredAs": "customer_initiated",
    "bodyHtml": "<p>Hello, I have a question about your product.</p>",
    "bodyMarkdown": "Hello, I have a question about your product.",
    "author": { "type": "customer", "id": "676f0f6765bdaa7d7d760f88" }
  },
  "createdAt": "2025-01-15T10:30:00.000Z",
  "updatedAt": "2025-01-15T10:30:00.000Z"
}

Version Availability

This endpoint is only available in API version 2026-01-01.nova and newer.

Authorizationstringheaderobligatorio

API key as Bearer token. Use: Authorization: Bearer sk_...

Featurebase-Versionenum<string>header

API version for this request. Defaults to your organization's configured API version if not specified.

Opciones disponibles: 2026-08-19.orbit, 2026-01-01.nova, 2025-12-12.clover
Ejemplo: 2026-08-19.orbit

Cuerpo

application/json
bodyMarkdownstringobligatorio

The content of the initial message in markdown format. Images referenced by URL or as base64 data URIs will be automatically uploaded and stored.

Minimum string length: 1
Ejemplo: Hello, I have a question about your product. ![screenshot](https://example.com/image.png)
channelenum<string>default:desktop

The channel for the conversation. Defaults to "desktop" (SDK/widget).

Opciones disponibles: desktop, email
Ejemplo: desktop
createdAtstring | null

The time the conversation was created as an ISO timestamp. If not provided, the current time will be used. This field is recommended for migrating past conversations from another source.

Ejemplo: 2025-01-15T10:30:00.000Z
fromobjectobligatorio

The author initiating the conversation. Use type "contact" for customer/lead or "admin" for outreach.

Conversation initiated by a contact

recipientsobject

Recipients for admin-initiated outreach. Required when from.type is "admin". Specify at least one recipient in the "to" field.

skipNotificationsbooleandefault:false

Skip admin notifications (push and activity email) for a conversation started by a contact (default: false). Useful for bulk imports.

Ejemplo: false
subjectstring

Subject line for the email. Required when channel is "email" and from.type is "admin".

Maximum string length: 500
Ejemplo: Following up on your inquiry

Respuesta

application/json

Created

adminAssigneeIdstring | nullobligatorio

ID of the assigned admin

Ejemplo: 507f1f77bcf86cd799439011
awaitingCustomerReplyboolean

Whether we are awaiting a customer reply

Ejemplo: true
botConversationStateenum<string>

State of AI agent handling for this conversation

Opciones disponibles: active, handed_off_to_human, resolved
Ejemplo: active
botConversationStateLastUpdatedAtstring | nullobligatorio

ISO timestamp when bot state last changed

Ejemplo: 2025-01-15T10:30:00.000Z
brandIdstring | nullobligatorio

ID of the brand associated with this conversation

Ejemplo: 507f1f77bcf86cd799439011
conversationPartsobject[]

Array of conversation parts (messages). Only included when fetching a single conversation by ID.

createdAtstringobligatorio

ISO timestamp when conversation was created

Ejemplo: 2025-01-15T10:30:00.000Z
csatDebugobject

Minimal CSAT diagnostics for the current effective request.

csatHistoryobject[]

Historical CSAT requests for this conversation, ordered newest first.

csatSummaryobject

Derived CSAT summary for this conversation when a rating request or rating exists.

customAttributeValuesobject[]

Custom conversation attribute values expanded with definition metadata. Returned only when include=customAttributeDefinitions is provided.

customAttributesobject

Custom conversation attributes keyed by custom attribute ID. Only org-defined, non-archived conversation attributes are returned; internal workflow metadata is omitted.

disableCustomerReplyboolean

Whether customer replies are disabled

Ejemplo: false
hasAdminOverriddenLanguagebooleanobligatorio

Whether an admin has manually overridden the language for this conversation. When true, automatic language detection is disabled.

Ejemplo: false
idstringobligatorio

Unique conversation identifier

Ejemplo: 12345
isBlockedbooleanobligatorio

Whether the user is blocked

Ejemplo: false
lastActivityAtstring | nullobligatorio

ISO timestamp of last activity

Ejemplo: 2025-01-15T12:30:00.000Z
objectenum<string>obligatorio

Object type identifier

Opciones disponibles: conversation
Ejemplo: conversation
participantsobject[]obligatorio

Participants in this conversation

prioritybooleanobligatorio

Whether this conversation is marked as priority

Ejemplo: false
prioritySetAtstring | nullobligatorio

ISO timestamp when priority was set

Ejemplo: 2025-01-15T10:30:00.000Z
readReceiptsobject[]

Read receipts indicating how far each participant has read in the conversation. Each receipt maps a user to their last-read conversation part. The tracked position reflects the system read state and may reference parts the user cannot directly view (e.g., a contact's read position may point to an internal admin note). Use these receipts to render read indicators and typing awareness, not to infer content access.

snoozedUntilstring | nullobligatorio

ISO timestamp until which conversation is snoozed

Ejemplo: 2025-01-16T09:00:00.000Z
sourceobject
stateenum<string>obligatorio

Current state of the conversation

Opciones disponibles: open, closed, snoozed
Ejemplo: open
tagsobject[]obligatorio

Current tags applied anywhere in this conversation

teamAssigneeIdstring | nullobligatorio

ID of the assigned team

Ejemplo: 507f1f77bcf86cd799439012
titlestring

Conversation title

Ejemplo: Question about pricing
updatedAtstringobligatorio

ISO timestamp when conversation was last updated

Ejemplo: 2025-01-15T12:30:00.000Z
userPreferredLanguagestringobligatorio

User's preferred language

Ejemplo: en
waitingSincestring | nullobligatorio

ISO timestamp when conversation started waiting

Ejemplo: 2025-01-15T10:30:00.000Z