Import a ticket with its history from another help desk
const url = 'https://api.motenya.app/v1/products/example/tickets/import';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Where the tickets come from, e.g. zendesk; with externalId it identifies the ticket. Case is ignored: the ticket shows importedFrom as api:zendesk.
Example
zendeskOne of the product’s email channels, for replies sent from Motenya; omitted, the ticket keeps its history but cannot be answered by email.
object
Your user id, as the widget’s sign-in would send it.
CLOSED when omitted. A blocked sender’s new ticket starts as SPAM.
With SNOOZED: when it opens again. Without one, or one already past, the ticket comes in OPEN.
Example
2026-11-21T09:30:00ZMatched to a teammate’s email; otherwise unassigned.
Up to 20 of at most 50 characters are kept.
ISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00ZWhen 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.
Example
2026-11-21T09:30:00ZOldest 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.
object
Its id where it comes from; importing it again adds nothing.
CUSTOMER: from the customer. REPLY: sent to them by the team. NOTE: internal.
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.
Kept as sent; when bodyText is omitted the text is taken from it (cut at 50,000 characters).
ISO-8601 date-time, e.g. 2026-11-21T09:30:00Z.
Example
2026-11-21T09:30:00Zobject
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).
Responses
Section titled “Responses”Success
object
False when an earlier import of it was brought up to date.
Example generated
{ "ticketId": "example", "number": 1, "created": true, "messagesAdded": 1}Invalid request
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing, invalid, revoked or expired API key
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing scope, API turned off, published article without publish scope, or account suspended
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Not found, or outside the knowledge bases this key may use
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Slug or translation already exists
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rejected by validation (e.g. unknown language or category)
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Rate limited; see Retry-After
object
object
object
Example
{ "error": { "code": "SLUG_TAKEN" }}Internal error