Skip to content

Import a ticket with its history from another help desk

POST
/products/{productId}/tickets/import
curl --request POST \
--url https://api.motenya.app/v1/products/example/tickets/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "source": "zendesk", "externalId": "example", "channelAddress": "example", "customer": { "email": "example", "name": "example", "externalUserId": "example" }, "subject": "example", "status": "OPEN", "snoozedUntil": "2026-11-21T09:30:00Z", "priority": "LOW", "assigneeEmail": "example", "tags": [ "example" ], "createdAt": "2026-11-21T09:30:00Z", "updatedAt": "2026-11-21T09:30:00Z", "messages": [ { "externalId": "example", "kind": "CUSTOMER", "authorEmail": "example", "authorName": "example", "bodyText": "example", "bodyHtml": "example", "createdAt": "2026-11-21T09:30:00Z", "attachments": [ { "url": "example", "filename": "example", "contentType": "example" } ] } ] }'

Writes the conversation as it happened: its times, authors, status, assignee and tags. Nothing is emailed or notified, and history doesn’t show as unread. Files are copied from their URLs. Import the same source + externalId again to add the messages it lacks; the source’s status, assignee and tags apply only if no one changed the ticket in Motenya since. Intercom has a ready-made integration (POST …/integrations with type intercom).

Requires tickets:write.

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

Where the tickets come from, e.g. zendesk; with externalId it identifies the ticket. Case is ignored: the ticket shows importedFrom as api:zendesk.

string
>= 1 characters <= 40 characters /^[a-zA-Z0-9_.-]+$/

Example

zendesk
externalId
required
string
>= 1 characters <= 200 characters
channelAddress

One of the product’s email channels, for replies sent from Motenya; omitted, the ticket keeps its history but cannot be answered by email.

string | null
<= 254 characters
customer
required
object
email
string | null
<= 254 characters
name
string | null
<= 200 characters
externalUserId

Your user id, as the widget’s sign-in would send it.

string | null
<= 200 characters
subject
string | null
<= 500 characters
status

CLOSED when omitted. A blocked sender’s new ticket starts as SPAM.

string
Allowed values: OPEN PENDING SOLVED CLOSED SNOOZED
snoozedUntil

With SNOOZED: when it opens again. Without one, or one already past, the ticket comes in OPEN.

string | null
<= 40 characters

Example

2026-11-21T09:30:00Z
priority
string
Allowed values: LOW NORMAL HIGH URGENT
assigneeEmail

Matched to a teammate’s email; otherwise unassigned.

string | null
<= 254 characters
tags

Up to 20 of at most 50 characters are kept.

Array<string>
<= 100 items
createdAt
required

ISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.

string
<= 40 characters

Example

2026-11-21T09:30:00Z
updatedAt

When it last changed where it comes from; send it on every import. Imported again, the ticket takes the source’s subject, status, priority, assignee and tags when this is at or after its last change in Motenya. A ticket marked SPAM or IGNORED in Motenya keeps that.

string
<= 40 characters

Example

2026-11-21T09:30:00Z
messages
required

Oldest first is not required; at least one for a new ticket. At most 100 files in all; send a longer thread in parts, with the same externalId.

Array<object>
<= 500 items
object
externalId
required

Its id where it comes from; importing it again adds nothing.

string
>= 1 characters <= 200 characters
kind
required

CUSTOMER: from the customer. REPLY: sent to them by the team. NOTE: internal.

string
Allowed values: CUSTOMER REPLY NOTE
authorEmail

A team member’s email links REPLY and NOTE messages to that teammate; anyone else keeps their name. CUSTOMER messages are always the ticket’s customer’s.

string | null
<= 254 characters
authorName
string | null
<= 200 characters
bodyText
string | null
<= 50000 characters
bodyHtml

Kept as sent; when bodyText is omitted the text is taken from it (cut at 50,000 characters).

string | null
<= 500000 characters
createdAt
required

ISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.

string
<= 40 characters

Example

2026-11-21T09:30:00Z
attachments
Array<object>
<= 20 items
object
url
required

An https URL the file can be read from now; it is copied, up to 25 MB. One that cannot be read is kept as unavailable (UNREADABLE).

string
<= 2000 characters /^https:\/\//
filename
string | null
<= 255 characters
contentType
string | null
<= 100 characters

Success

Media typeapplication/json
object
ticketId
required
string
>= 1 characters <= 64 characters
number
required
integer
created
required

False when an earlier import of it was brought up to date.

boolean
messagesAdded
required
integer

Example generated

{
"ticketId": "example",
"number": 1,
"created": true,
"messagesAdded": 1
}

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