Skip to content

Open a ticket for a customer

POST
/products/{productId}/tickets
curl --request POST \
--url https://api.motenya.app/v1/products/example/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "channelAddress": "example", "customer": { "email": "example", "name": "example" }, "subject": "example", "message": "example", "reply": { "body": "example", "solve": true }, "priority": "LOW", "assigneeUserId": "example", "tags": [ "example" ], "notify": true }'

For a request that reached you another way (a call, your own form, an AI agent’s hand-off), on one of the product’s email channels. message records what the customer asked; reply is this key’s first answer and leaves the ticket PENDING (or SOLVED with solve). Nothing is sent unless notify is true, which emails reply. The customer’s answers thread back onto the ticket.

Requires tickets:write.

productId
required
string
>= 1 characters <= 64 characters
Media typeapplication/json
object
channelAddress
required

The inbound address of one of the product’s email channels; replies go out from it.

string
<= 254 characters
customer
required
object
email
required

The customer; replies are emailed here.

string
<= 254 characters
name
string | null
<= 200 characters
subject
string | null
<= 500 characters
message

What the customer asked (Markdown), recorded as their message. Nothing is sent for it.

string | null
<= 50000 characters
reply

A first reply from this key. Give message, reply or both.

object
body
required

Markdown; emailed to the customer from the channel only when notify is true.

string
>= 1 characters <= 50000 characters
solve

Mark the ticket solved with this reply.

boolean
priority
string
Allowed values: LOW NORMAL HIGH URGENT
assigneeUserId

A teammate with ticket write access.

string | null
<= 64 characters
tags
Array<string>
<= 20 items
notify

Email reply to the customer. Default false: the ticket and its reply are recorded, nothing is sent. Without reply there is nothing to send.

boolean

Success

Media typeapplication/json
object
ticket
required
object
id
required
string
>= 1 characters <= 64 characters
productId
required
string
>= 1 characters <= 64 characters
number
required
integer
subject
required
string | null
status
required
string
Allowed values: OPEN PENDING SOLVED CLOSED SNOOZED SPAM IGNORED
snoozedUntil
string | null
priority
required
string
Allowed values: LOW NORMAL HIGH URGENT
source
required
string
Allowed values: EMAIL HELP_CENTER WIDGET CHAT
channelId
required
string | null
requester
required
object
id
required
string
>= 1 characters <= 64 characters
email
required

Null for someone the site signed in to the widget by user id alone: replies reach them in the widget, not by email.

string | null
name
required
string | null
externalUserId

The tenant’s own user id, from the widget’s JWT sign-in.

string | null
contactId
required

The CRM contact; null for a lead.

string | null
>= 1 characters <= 64 characters
storeIds
required
Array<string>
assigneeUserId
required
string | null
tags
required
Array<string>
mergedIntoTicketId
required
string | null
>= 1 characters <= 64 characters
importedFrom

Where an imported ticket came from: intercom:<integration id, lowercase> or api:<source, lowercase>.

string | null
createdAt
required
string
updatedAt
required
string
lastActivityAt
required
string
key
additional properties
messages
required
Array<object>

REPLY adds sendState and sendError; EVENT adds change, merge and automatedReason.

object
id
required
string
>= 1 characters <= 64 characters
kind
required
string
Allowed values: CUSTOMER REPLY NOTE EVENT
fromAddress
required
string | null
fromName
required
string | null
authorUserId
required

The teammate, or apikey:<id> for a key.

string | null
subject
required
string | null
bodyText
required
string | null
bodyHtml
required
string | null
attachments
required
Array<object>
object
id
required
string
>= 1 characters <= 64 characters
filename
required
string | null
contentType
required
string
size
required
integer
key
additional properties
createdAt
required
string
key
additional properties
previousTicket
required
object
id
required
string
>= 1 characters <= 64 characters
number
required
integer
subject
required
string | null
mergedInto
required
object
id
required
string
>= 1 characters <= 64 characters
number
required
integer
subject
required
string | null

Example

{
"ticket": {
"status": "OPEN",
"priority": "LOW",
"source": "EMAIL"
},
"messages": [
{
"kind": "CUSTOMER"
}
]
}

Invalid request

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Missing, invalid, revoked or expired API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Missing scope, API turned off, published article without publish scope, or account suspended

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Not found, or outside the knowledge bases this key may use

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Slug or translation already exists

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Rejected by validation (e.g. unknown language or category)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Rate limited; see Retry-After

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string

Example

{
"error": {
"code": "SLUG_TAKEN"
}
}

Internal error