Skip to main content
POST
/
conversations
/
{conversation_id}
/
drafts
Create a new draft
curl --request POST \
  --url https://api.getfernand.com/v3/conversations/{conversation_id}/drafts \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "content": "<string>",
  "author_id": 123,
  "author_email": "<string>",
  "target_id": 123,
  "target_email": "<string>",
  "title": "<string>"
}
'
{
  "created": "2023-11-07T05:31:56Z",
  "last_updated": "2023-11-07T05:31:56Z",
  "conversation_id": 123,
  "id": 123,
  "title": "<string>",
  "content": {},
  "author_id": 123,
  "target_id": 123
}
Creates a message draft within the specified conversation, allowing the author and optional target agent to be set by ID or email. The draft includes a title and content, and validates the existence of referenced agents. If agent details are missing or invalid, appropriate errors are returned. The draft is saved and returned upon successful creation.

Authorizations

X-API-Key
string
header
required

Authenticate your account by including your secret key in API requests. You can manage your API keys in the Dashboard.

Authentication to the API is performed by using the HTTP Header X-API-Key.

Path Parameters

conversation_id
integer
required

ID of the conversation to create the draft in.

Body

application/json
content
string
required

Content of the draft (required).

author_id
integer

ID of the agent authoring the draft (optional if author_email is provided).

author_email
string

Email of the agent authoring the draft (optional if author_id is provided).

target_id
integer

ID of the agent the draft is targeted to (optional).

target_email
string

Email of the agent the draft is targeted to (optional).

title
string

Title of the draft (optional).

Response

Draft created successfully.

created
string<date-time>
required

Timestamp when the draft was created (UTC)

last_updated
string<date-time>
required

Timestamp when the draft was last updated (UTC)

conversation_id
integer<int64>
required

Conversation ID this draft belongs to

id
integer<int64>

Unique identifier for the message draft

title
string | null

Optional title for the draft

Maximum string length: 250
content
object

JSON object containing the draft content and metadata. Example: { "content": "string", "message-id": "string", "attachments": [ { "type": "string", "name": "string", "content": "string" } ], "inlines": [ { "type": "string", "name": "string", "content": "string", "cid": "string" } ], "actions": [ { "name": "string", "snippet_id": 123, "data": {} } ] }

author_id
integer<int64> | null

Agent ID who created the draft

target_id
integer<int64> | null

Agent ID to whom the draft is targeted (null means everyone)