{ "openapi": "3.0.3", "info": { "title": "Acme Helpdesk API", "description": "Support ticketing for the Acme internal helpdesk. Every response body is documented here; if the code and the docs disagree, the docs are wrong.\n", "version": "1.4.0", "contact": { "name": "Acme Platform Team", "email": "platform@acme.example" } }, "servers": [ { "url": "https://api.acme.example/v1", "description": "Production" }, { "url": "https://api.staging.acme.example/v1", "description": "Staging" } ], "tags": [ { "name": "tickets", "description": "Create and read support tickets" } ], "paths": { "/tickets": { "get": { "tags": ["tickets"], "summary": "List tickets", "operationId": "listTickets", "parameters": [ { "name": "status", "in": "query", "description": "Only return tickets in this status.", "required": false, "schema": { "$ref": "#/components/schemas/TicketStatus" } }, { "name": "assignedTo", "in": "query", "description": "Filter by the assignee's username. Omit for all tickets.", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 1, "default": 1 } }, { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 1, "maximum": 100, "default": 25 } } ], "responses": { "200": { "description": "A page of tickets.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TicketList" } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/ticket/{id}": { "get": { "tags": ["tickets"], "summary": "Get a single ticket", "operationId": "getTicketById", "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The numeric ticket id.", "schema": { "type": "integer", "format": "int32", "minimum": 1 } } ], "responses": { "200": { "description": "The requested ticket.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Ticket" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/ticket": { "post": { "tags": ["tickets"], "summary": "Open a new ticket", "operationId": "createTicket", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTicketRequest" } } } }, "responses": { "201": { "description": "The newly created ticket.", "headers": { "Location": { "description": "URL of the created ticket.", "schema": { "type": "string" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Ticket" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "422": { "$ref": "#/components/responses/ValidationFailed" } } } } }, "components": { "responses": { "BadRequest": { "description": "The request could not be understood.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } }, "NotFound": { "description": "No ticket with that id exists.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } }, "ValidationFailed": { "description": "The body was well-formed but failed validation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } } } }, "schemas": { "TicketStatus": { "type": "string", "description": "Where the ticket sits in the support workflow.", "enum": ["open", "waiting", "closed"] }, "TicketPriority": { "type": "string", "description": "How badly the requester wants this handled.", "enum": ["low", "normal", "high"] }, "Ticket": { "type": "object", "required": [ "id", "subject", "status", "openedOn", "priority", "assignedTo" ], "properties": { "id": { "type": "integer", "format": "int32", "description": "Server-assigned identifier.", "example": 4711 }, "subject": { "type": "string", "minLength": 1, "maxLength": 120, "description": "One-line summary of the problem.", "example": "Printer on 3rd floor is offline" }, "status": { "$ref": "#/components/schemas/TicketStatus" }, "openedOn": { "type": "string", "format": "date-time", "description": "When the ticket was opened, in UTC.", "example": "2026-08-14T09:32:11Z" }, "priority": { "$ref": "#/components/schemas/TicketPriority" }, "assignedTo": { "type": "string", "nullable": true, "description": "Username of the agent who owns this ticket, or null if unassigned.", "example": "bpetersen" } } }, "TicketList": { "type": "object", "required": ["data", "page", "pageSize", "total"], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Ticket" } }, "page": { "type": "integer", "format": "int32", "example": 1 }, "pageSize": { "type": "integer", "format": "int32", "example": 25 }, "total": { "type": "integer", "format": "int32", "description": "Total number of tickets matching the filter.", "example": 137 } } }, "CreateTicketRequest": { "type": "object", "required": ["subject"], "properties": { "subject": { "type": "string", "minLength": 1, "maxLength": 120, "example": "VPN drops every ten minutes" }, "priority": { "allOf": [ { "$ref": "#/components/schemas/TicketPriority" } ], "default": "normal" }, "assignedTo": { "type": "string", "nullable": true, "description": "Optional. Leave off to drop the ticket in the unassigned queue." } } }, "ApiError": { "type": "object", "required": ["code", "message"], "properties": { "code": { "type": "string", "example": "ticket_not_found" }, "message": { "type": "string", "example": "No ticket with id 4711." }, "details": { "type": "array", "description": "Per-field problems, when the failure was a validation failure.", "items": { "type": "object", "required": ["field", "issue"], "properties": { "field": { "type": "string", "example": "subject" }, "issue": { "type": "string", "example": "must not be empty" } } } } } } } } }