{"openapi":"3.1.0","info":{"title":"FastESM API","description":"Open integration access to FastESM services, requests, knowledge, and departments.\n\n**Access model:** reads are public. Selected writes are implemented but disabled unless the deployment configures `FASTSME_API_TOKEN`; write clients then send it as a bearer token.","contact":{"name":"FastSME","url":"https://fastsme.com/"},"license":{"name":"MIT"},"version":"1.0.0"},"servers":[{"url":"https://esm.fastsme.com/api","description":"Production"}],"paths":{"/":{"get":{"tags":["System"],"summary":"Api Index","operationId":"api_index__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Api Index  Get"}}}}}}},"/v1/health":{"get":{"tags":["System"],"summary":"Api Health","operationId":"api_health_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/services":{"get":{"tags":["Services"],"summary":"List services","description":"Published enterprise service catalogue entries.","operationId":"list_services","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive text search","title":"Q"},"description":"Case-insensitive text search"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServicesCollection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/services/{item_id}":{"get":{"tags":["Services"],"summary":"Get one services record","operationId":"get_services","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServicesResource"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests":{"get":{"tags":["Requests"],"summary":"List requests","description":"Enterprise service requests and their workflow state.","operationId":"list_requests","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive text search","title":"Q"},"description":"Case-insensitive text search"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestsCollection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Requests"],"summary":"Create a requests record","description":"Implemented for token-authenticated integrations. Production writes remain disabled until FASTSME_API_TOKEN is configured.","operationId":"create_requests","security":[{"FastSME API token":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestsCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestsResource"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Unprocessable Entity"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Service Unavailable"}}}},"/v1/requests/{item_id}":{"get":{"tags":["Requests"],"summary":"Get one requests record","operationId":"get_requests","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestsResource"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/knowledge":{"get":{"tags":["Knowledge articles"],"summary":"List knowledge articles","description":"Service knowledge articles.","operationId":"list_knowledge","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive text search","title":"Q"},"description":"Case-insensitive text search"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgearticlesCollection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/knowledge/{item_id}":{"get":{"tags":["Knowledge articles"],"summary":"Get one knowledge articles record","operationId":"get_knowledge","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgearticlesResource"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/departments":{"get":{"tags":["Departments"],"summary":"List departments","description":"Departments that own and fulfil services.","operationId":"list_departments","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive text search","title":"Q"},"description":"Case-insensitive text search"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentsCollection"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/departments/{item_id}":{"get":{"tags":["Departments"],"summary":"Get one departments record","operationId":"get_departments","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentsResource"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DepartmentsCollection":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DepartmentsResource"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"DepartmentsCollection"},"DepartmentsResource":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"name":{"type":"string","title":"Name"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"}},"type":"object","required":["name"],"title":"DepartmentsResource"},"ErrorDetail":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"details":{"additionalProperties":true,"type":"object","title":"Details"}},"type":"object","required":["code","message"],"title":"ErrorDetail","description":"Machine-readable API error."},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"type":"object","required":["error"],"title":"ErrorEnvelope","description":"Consistent error response envelope."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"product":{"type":"string","title":"Product"},"version":{"type":"string","title":"Version"},"writes_enabled":{"type":"boolean","title":"Writes Enabled"}},"type":"object","required":["status","product","version","writes_enabled"],"title":"HealthResponse","description":"API health response."},"KnowledgearticlesCollection":{"properties":{"data":{"items":{"$ref":"#/components/schemas/KnowledgearticlesResource"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"KnowledgearticlesCollection"},"KnowledgearticlesResource":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"title":{"type":"string","title":"Title"},"category_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Category Id"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"status":{"type":"string","title":"Status"},"views":{"type":"integer","title":"Views"},"published_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Published On"}},"type":"object","required":["title","status","views"],"title":"KnowledgearticlesResource"},"PaginationMeta":{"properties":{"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["total","limit","offset"],"title":"PaginationMeta","description":"Offset pagination metadata."},"RequestsCollection":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RequestsResource"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"RequestsCollection"},"RequestsCreate":{"properties":{"title":{"type":"string","title":"Title"},"service_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Service Id"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"requester_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requester Id"},"status":{"type":"string","title":"Status"},"priority":{"type":"string","title":"Priority"},"form_data":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Form Data"}},"additionalProperties":false,"type":"object","required":["title","status","priority"],"title":"RequestsCreate"},"RequestsResource":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"},"title":{"type":"string","title":"Title"},"service_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Service Id"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"requester_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requester Id"},"assignee_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignee Id"},"approver_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approver Id"},"status":{"type":"string","title":"Status"},"priority":{"type":"string","title":"Priority"},"form_data":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Form Data"},"created":{"type":"string","title":"Created"},"response_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response By"},"resolution_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution By"},"first_responded_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Responded On"},"approved_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved On"},"resolved_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved On"},"feedback_rating":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Feedback Rating"}},"type":"object","required":["title","status","priority","created"],"title":"RequestsResource"},"ServicesCollection":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ServicesResource"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"ServicesCollection"},"ServicesResource":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"name":{"type":"string","title":"Name"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"sla_hours":{"type":"integer","title":"Sla Hours"},"requires_approval":{"type":"integer","title":"Requires Approval"},"form_schema":{"type":"string","title":"Form Schema"},"is_active":{"type":"integer","title":"Is Active"}},"type":"object","required":["name","sla_hours","requires_approval","form_schema","is_active"],"title":"ServicesResource"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"FastSME API token":{"type":"http","description":"Selected writes require `Authorization: Bearer <token>`. Reads are public. Set FASTSME_API_TOKEN to enable writes.","scheme":"bearer"}}}}