Skip to main content
POST
/
snippets
Create a new snippet
curl --request POST \
  --url https://api.getfernand.com/snippets \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "title": "Welcome Message",
  "actions": [
    {
      "name": "status",
      "data": {
        "status": "closed"
      }
    },
    {
      "name": "reply",
      "data": {
        "content": "Thank you for contacting us!"
      }
    }
  ]
}
'
{
  "id": 42,
  "title": "Welcome Message",
  "created": "2024-01-15T10:30:00Z",
  "applied_count": 15,
  "categories": [
    1,
    3
  ],
  "actions": [
    {
      "id": 1,
      "name": "status",
      "data": {
        "status": "closed"
      },
      "sort": 0
    }
  ],
  "shortcut": "welcome",
  "last_applied_at": "2023-11-07T05:31:56Z"
}
Creates a new snippet. The snippet can be used to quickly insert pre-defined content and apply automated actions to conversations. Actions are validated to ensure they are supported (status, assign, snooze, reply, note, tag) with a maximum of 10 actions per snippet.

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.

Body

application/json
title
string
required

Title of the snippet (required).

Maximum string length: 50
Example:

"Welcome Message"

actions
object[]
required

Array of actions to apply when snippet is used (1-10 actions required).

Required array length: 1 - 10 elements
Example:
[
{
"name": "status",
"data": { "status": "closed" }
},
{
"name": "reply",
"data": { "content": "Thank you for contacting us!" }
}
]
shortcut
string | null

Optional keyboard shortcut (lowercase, numbers, and dashes only).

Maximum string length: 40
Example:

"welcome"

categories
integer[] | null

Array of category IDs to assign this snippet to.

Example:
[1, 3]

Response

Snippet created successfully.

id
integer<int32>
required

Unique identifier for the snippet

Example:

42

title
string
required

Title of the snippet

Maximum string length: 250
Example:

"Welcome Message"

created
string<date-time>
required

Timestamp when the snippet was created (UTC)

Example:

"2024-01-15T10:30:00Z"

applied_count
integer<int32>
required

Number of times this snippet has been applied

Example:

15

categories
integer[]
required

Array of category IDs this snippet belongs to (0 represents root category)

Example:
[1, 3]
actions
object[]
required

Array of actions to be applied when the snippet is used

Example:
[
{
"id": 1,
"name": "status",
"data": { "status": "closed" },
"sort": 0
}
]
shortcut
string | null

Optional keyboard shortcut to quickly insert the snippet (lowercase, numbers, and dashes only)

Maximum string length: 40
Example:

"welcome"

last_applied_at
string<date-time> | null

Timestamp when the snippet was last applied to a conversation (UTC)