Create your first ticket with curl
This tutorial shows the complete path: sign-in, tenant context, POST request with an idempotency key, and what the server response looks like.
Prerequisites
- Account with the
ticket_createpermission in the target tenant. - A second factor set up (required for session cookies) — or an API key, see Auth & sessions.
Sign-in. Codemeta OS responds to a successful sign-in with a Set-Cookie header.
-c cookies.txtstores it locally.curl -X POST https://os.codemeta.de/api/auth/sign-in/email \ -H "Content-Type: application/json" \ -c cookies.txt \ -d '{"email":"alice@example.com","password":"…"}'Set the tenant.
export TENANT="0192f2c0-8d1c-7a3b-9e4f-d3e7f1a2b5c8"You can see which tenant IDs are available to your account in the web interface under Profile or via the profile endpoint.
Generate an idempotency key. On macOS/Linux:
export IDEM_KEY=$(uuidgen)The key is a client-side property. You can send the same key multiple times; on the second call the backend responds with the same result without creating a second record.
Create the ticket.
curl -X POST https://os.codemeta.de/api/v1/tickets \ -H "X-Tenant-Id: $TENANT" \ -H "Content-Type: application/json" \ -H "X-Idempotency-Key: $IDEM_KEY" \ -b cookies.txt \ -d '{ "title": "Printer stuck in the lobby", "description": "Paper jam, cannot be cleared.", "priority": "normal" }'Read the response. On success you get 201 Created with the newly created ticket in the body:
{ "id": "01938421-…", "number": "T-2026-00042", "tenantId": "0192f2c0-…", "schema": "ticket", "version": 1, "title": "Printer stuck in the lobby", "priority": "normal", "status": "open", "createdAt": "2026-05-01T09:14:22.531Z", "createdBy": "0193…" }Note down
id(for API calls) andnumber(for communication with users). Learn more under Sequence numbers.
Where to go from here
- Read the audit history – see how the ticket you just created looks in the audit trail.
- Secure webhooks – if you would rather receive events than poll.
- Concept: Optimistic locking – when you edit the ticket next.