LemuAIDocs

Tickets · 4 min read

Create a Ticket

Create a ticket in a LemuTickets project, with its requester, priority, assignee and custom fields

Open in ChatGPTOpen in ClaudeMarkdown

Creates a ticket in a project. The ticket starts in the workflow's first status unless you choose one, and gets the next number in the project (for example SUP-1042).

After it is created, the project's assignment rules, SLA policy and AI triage run as they do for tickets made in the app.

POST/v1/tickets

Needs the tickets.write scope in the project.

Headers#

NameRequiredDescription
Idempotency-KeyNo, but recommendedA unique value for this ticket, for example your own record id. Sending the same request again returns the first response instead of a second ticket. See idempotency keys.

Request body#

FieldTypeRequiredDescription
projectstringYesProject key (SUP) or id.
titlestringYes1 to 500 characters.
descriptionstringNoThe body of the ticket.
typestringNoTicket type name (Complaint) or id. Defaults to the project's default type.
prioritystringNop1, p2, p3 or p4. Default p3.
severitystringNoOptional severity, for incidents.
statusstringNoStatus name or id to start in. Defaults to the workflow's first status.
sourcestringNoWhere the ticket came from. Default api. One of voice, whatsapp, web_chat, email, slack, teams, api, portal, web_form, manual, lemu_copilot, automation, journey.
source_refstringNoThe id of the item in the source system. If a ticket with the same source and source_ref exists, it is returned instead of creating a new one.
external_idstringNoYour own id for the ticket. Must be unique: a second ticket with the same value fails with 409.
requester_idstring (UUID)NoAn existing requester.
requesterobjectNoFind or create the requester inline (see below). Used when requester_id is not sent.
account_idstring (UUID)NoThe customer account. Defaults to the requester's account.
assignee_user_idstring (UUID)NoAssign to this person. They must be an active member of your organization.
assignee_team_idstring (UUID)NoAssign to this team. Defaults to the project's default team when no person is set.
labelsarray of stringsNoLabels to add.
due_atstring (date-time)NoA due date, separate from SLA deadlines.
custom_fieldsobjectNoValues for the project's custom fields, by key. Required custom fields must be sent.
parent_idstring (UUID)NoMake this a sub-task of another ticket.
restrictedbooleanNoOnly the assignee, the reporter, admins and people it is shared with can see it. Default false.
watchersarray of UUIDsNoUsers to notify about changes.
estimate_minutesintegerNoAn estimate of the work.
auto_assignbooleanNoRun the project's assignment rules. Default true.
auto_triagebooleanNoLet the AI classify the ticket. Default true.

Inline requester#

Send requester to link the ticket to a customer without looking them up first. LemuTickets finds an existing requester by lemu_contact_id, email, phone, WhatsApp id or external_id, in that order, and creates one if there is no match. Details on an existing requester are only filled in where they are empty, never overwritten.

FieldTypeDescription
namestringFull name.
emailstringEmail address.
phonestringPhone number. Numbers without a country code are read as Indian (+91).
whatsapp_idstringWhatsApp number.
external_idstringYour own id for the customer.
lemu_contact_idintegerThe contact's id in Lemu AI, if you use both products.
languagestringPreferred language, for example hi or en.

A new requester whose email domain matches an account is added to that account.

Example request:

cURL
curl -X POST https://api.tickets.lemuai.com/v1/tickets \
  -H "Authorization: Bearer ltk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ERP-CMP-58213" \
  -d '{
    "project": "SUP",
    "type": "Complaint",
    "title": "Refund not received for order 58213",
    "description": "Customer paid on 12 November and the order was cancelled the same day.",
    "priority": "p2",
    "external_id": "ERP-CMP-58213",
    "labels": ["refund"],
    "custom_fields": { "order_id": "58213" },
    "requester": {
      "name": "Priya Sharma",
      "email": "priya@example.com",
      "phone": "+919876543210",
      "external_id": "CUST-20931"
    }
  }'

Response#

201 with the new ticket. The ETag header holds its version.

JSON
{
  "id": "2f9c7e1a-5b3d-4c8e-9a6f-1d0e2b4c6a8f",
  "key": "SUP-1042",
  "number": 1042,
  "project": { "id": "3b0f6c1e-8a2d-4f5b-9c71-0e4d2a6b8f13", "key": "SUP", "name": "Customer Support" },
  "type": { "id": "9d2e4f60-1b3a-4c8d-a7e5-6f0b2c9d1e47", "name": "Complaint", "icon": "message-square-warning", "color": "red" },
  "title": "Refund not received for order 58213",
  "description": "Customer paid on 12 November and the order was cancelled the same day.",
  "status": { "id": "4d7b9e1f-3a5c-4e8b-a0d2-f4b6c8e0a1d3", "name": "New", "category": "new", "color": "sky" },
  "status_category": "new",
  "priority": "p2",
  "severity": null,
  "source": "api",
  "source_ref": null,
  "requester": {
    "id": "8b4d6f2a-0c1e-4a3b-9d5f-7e6a8c0b2d4f",
    "name": "Priya Sharma",
    "email": "priya@example.com",
    "phone": "+919876543210",
    "is_vip": false,
    "account_id": null
  },
  "account_id": null,
  "assignee": null,
  "team": { "id": "1c3e5a7b-9d2f-4e6a-b8c0-a2e4f6b8d0c1", "name": "L1 Support" },
  "reporter": {
    "id": "d1f3b5a7-c9e2-4b4d-8f6a-0c2e4a6b8d0f",
    "name": "API: ERP sync",
    "email": "ltk_live_ab12cd34@bots.lemutickets",
    "avatar_url": null
  },
  "parent_id": null,
  "labels": ["refund"],
  "due_at": null,
  "restricted": false,
  "sla": {
    "policy_id": "7e9a1c3b-5d2f-4a6e-8b0c-1d3f5a7c9e2b",
    "targets": {
      "first_response": {
        "minutes": 240.0,
        "business_hours": true,
        "status": "running",
        "started_at": "2026-11-25T09:12:40.512000+00:00",
        "due_at": "2026-11-25T13:12:40.512000+00:00",
        "met_at": null,
        "breached_at": null
      }
    },
    "paused": false,
    "next_due_at": "2026-11-25T13:12:40.512000+00:00",
    "breached": false
  },
  "sla_next_due_at": "2026-11-25T13:12:40.512000+00:00",
  "sla_breached": false,
  "escalation_level": 0,
  "first_response_at": null,
  "resolved_at": null,
  "closed_at": null,
  "reopened_count": 0,
  "csat_score": null,
  "time_spent_minutes": 0,
  "estimate_minutes": null,
  "custom_fields": { "order_id": "58213" },
  "ai": {},
  "lemu": {},
  "channel_thread": {},
  "external_id": "ERP-CMP-58213",
  "merged_into_id": null,
  "version": 1,
  "created_at": "2026-11-25T09:12:40.512000+00:00",
  "updated_at": "2026-11-25T09:12:40.512000+00:00"
}

See the ticket object for every field. Assignment, SLA and triage can still change the ticket right after it is created, so version and the assignee may move on quickly.

200 with the existing ticket, when a ticket with the same source and source_ref already exists.

Errors#

StatuscodeWhen
404project_not_foundNo project with that key or id, or the key cannot access it
409duplicate_external_idA ticket with this external_id exists. data.key is its key
409idempotency_mismatchThe Idempotency-Key was used before with a different body
422project_archivedThe project is archived
422invalid_type, invalid_statusThe type or status does not exist in this project
422invalid_assignee, invalid_team, invalid_requesterThe assignee, team or requester does not exist
422invalid_sourcesource is not one of the allowed values
422invalid_custom_fieldsA custom field value is wrong or a required one is missing. See field_errors
422invalid_fieldsA field has the wrong type or length. See field_errors