API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console

Create ticket

POST/v1/tickets

Creates a new ticket in the current tenant. The sequence number (e.g. T-2026-00042) is assigned by the server and cannot be overwritten. An audit entry (JSON patch) is written in the same transaction.

If assigneeId is passed, the API checks that the person belongs to the same tenant — otherwise it responds with 422. If no SLA policy is specified, the default policy from the party’s contract is applied.

Data model

This operation works on the entity Ticket (ticket). All 91 fields — type, validation, required status, relationships — are listed in the schema reference.

  • Required fields: title, status, priority
  • Server-managed: _id, schema, schemaVersion, tenantId, version, createdAt, updatedAt, createdBy, updatedBy, deletedAt, deletedBy, ticketNumber, dispatch, aiSummary, aiSummaryAttemptedAt, aiFeedSummary, budget.consumedMinutes, budget.locked, budget.lockedAt, budget.lockedReason, budget.unlockRequestId, budget.capHistory, salesOrderId, salesOrderItemId, salesOrderItemSource, standaloneBilling.enabledBy, standaloneBilling.enabledAt, standaloneBilling.performanceRecordId, standaloneBilling.performanceRecordNumber, standaloneBilling.invoicedAt, handlingTier, handedToCustomerAt, slaPausedMs, handoverPreviousAssigneeId, convertedTo, convertedFrom, aiReopenSuggestion, aiReopenDecision, aiReopenConfidence, aiReopenBasis, aiReopenConfirmedBy, unlinkedTicketRef, followupOrigin, externalOwnership, externalOwnershipTakenAt, externalOwnershipTakenBy, externalOwnershipTag, closeEmail — the platform assigns these fields; they are discarded in the request.

Example

curl -X POST https://api.codemeta-os.de/v1/tickets \
  -H "X-Tenant-Id: $TENANT" \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
  "title": "Drucker im OG2 wirft Fehler 0xC4",
  "partyId": "{{sandbox.partyId}}",
  "priority": "high"
}'
const result = await cm.tickets.post({
  "title": "Drucker im OG2 wirft Fehler 0xC4",
  "partyId": "{{sandbox.partyId}}",
  "priority": "high"
});

Best practice

Use Idempotency-Key (UUIDv4) when you mirror tickets from another system (email webhook, weclapp order, asset alarm). A second request with the same key returns the original ticket without creating a new one.

Response codes

HTTP Meaning
200 Default Response

Search