{"openapi":"3.1.0","info":{"title":"SequenceQMS API","version":"1.0.0","description":"Read access to your SequenceQMS workspace.\n\nAuthentication: send your key as `Authorization: Bearer <key>`. A key belongs to exactly\none workspace, carries an explicit scope list, expires, and can be revoked at any time.\n\nThis API cannot apply a 21 CFR Part 11 electronic signature, and cannot publish, approve,\nor complete a record. Those actions require a person and are not present on this surface.\nEvery request is recorded, and every action is attributed in the audit trail to the person\nthe key is assigned to."},"servers":[{"url":"/api/v1"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your SequenceQMS API key."}},"schemas":{"Document":{"type":"object","properties":{"id":{"type":"integer"},"documentNumber":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"classification":{"type":["string","null"]},"category":{"type":["string","null"]},"currentVersion":{"type":["string","null"]},"effectiveDate":{"type":["string","null"]},"ownerId":{"type":["integer","null"]}}},"Capa":{"type":"object","properties":{"id":{"type":"integer"},"capaNumber":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"source":{"type":"string"},"classification":{"type":"string"},"severity":{"type":"string"},"riskPriority":{"type":"string"},"status":{"type":"string"},"dueDate":{"type":["string","null"]},"closedDate":{"type":["string","null"]}}},"ChangeOrder":{"type":"object","properties":{"id":{"type":"integer"},"changeNumber":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["open","routing","awaiting_review","completed","canceled"]},"priority":{"type":["string","null"]},"impact":{"type":["string","null"]},"reason":{"type":["string","null"]},"areaImpacted":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":["string","null"]},"completedDate":{"type":["string","null"]},"canceled":{"type":"boolean"},"approvalsSigned":{"type":"boolean","description":"Every final-round approval carries a 21 CFR Part 11 signature binding (derived; signature content is never exposed)"},"documents":{"type":"array","items":{"type":"object","properties":{"documentId":{"type":"integer"},"documentNumber":{"type":["string","null"]},"title":{"type":"string"},"revisionId":{"type":["integer","null"]},"revisionStatus":{"type":["string","null"]},"frozen":{"type":["integer","null"]}}}}}},"Supplier":{"type":"object","properties":{"id":{"type":"integer"},"supplierNumber":{"type":"string"},"name":{"type":"string"},"category":{"type":["string","null"]},"qualificationStatus":{"type":"string","enum":["pending","qualified","conditionally_qualified","disqualified"]},"riskLevel":{"type":["string","null"]},"lastAuditDate":{"type":["string","null"]},"nextAuditDate":{"type":["string","null"]},"approvedDate":{"type":["string","null"]},"status":{"type":"string","enum":["active","inactive"]},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]}}},"AuditFinding":{"type":"object","properties":{"id":{"type":"integer"},"findingNumber":{"type":"string"},"auditId":{"type":"integer"},"type":{"type":"string"},"description":{"type":"string"},"requirement":{"type":["string","null"]},"status":{"type":"string"},"dueDate":{"type":["string","null"]},"capaId":{"type":["integer","null"]},"closedAt":{"type":["string","null"]}}},"Error":{"type":"object","properties":{"message":{"type":"string"}}}},"parameters":{"limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"offset":{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}},"responses":{"Unauthorized":{"description":"Missing, invalid, expired, or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The key does not hold the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such record in this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BadRequest":{"description":"The request is missing a required field or has none to change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"The document is not a draft, the number is taken, or the open-draft quota is reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Rate limit exceeded; see the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"security":[{"bearerAuth":[]}],"x-scopes":{"documents:read":"documents:read","documents:write":"documents:write","attachments:write":"attachments:write","capa:read":"capa:read","capa:write":"capa:write","nonconformance:read":"nonconformance:read","nonconformance:write":"nonconformance:write","complaints:read":"complaints:read","complaints:write":"complaints:write","audits:read":"audits:read","design:read":"design:read","risk:read":"risk:read","training:read":"training:read","suppliers:read":"suppliers:read","change_orders:read":"change_orders:read","audit-trail:read":"audit-trail:read"},"paths":{"/whoami":{"get":{"summary":"Verify a key: its workspace, scopes, and the person it is attributed to","responses":{"200":{"description":"Key context"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/documents":{"post":{"summary":"Create a draft document","x-required-scope":"documents:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","type"],"properties":{"title":{"type":"string","maxLength":300},"type":{"type":"string","maxLength":60},"documentNumber":{"type":"string","description":"Optional; the next number is minted when omitted"},"description":{"type":"string"},"classification":{"type":"string"},"category":{"type":"string"}}}}}},"responses":{"201":{"description":"The new draft document"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}}},"get":{"summary":"List documents","x-required-scope":"documents:read","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"}},null,{"name":"documentNumber","in":"query","schema":{"type":"string"},"description":"Exact document number lookup; results carry the revision container (FR-API-016)"},{"name":"updatedSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return only documents updated on or after this ISO timestamp (revision releases bump it) - the changed-since sync feed."}],"responses":{"200":{"description":"A page of documents","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/documents/{id}":{"patch":{"summary":"Update a draft document","x-required-scope":"documents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":300},"description":{"type":"string"},"classification":{"type":"string"},"category":{"type":"string"}}}}}},"responses":{"200":{"description":"The changed fields"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}},"delete":{"summary":"Delete an unsigned draft document","x-required-scope":"documents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}},"get":{"summary":"Get one document","x-required-scope":"documents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/attachments/{id}/download":{"get":{"summary":"Download one of a document's files (X-Content-SHA256 carries the recorded hash)","x-required-scope":"documents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The file bytes"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"410":{"description":"The file is no longer on storage"}}}},"/documents/{id}/submit-for-review":{"post":{"summary":"Submit a draft for review (a person routes and signs it)","x-required-scope":"documents:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The document is in review"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/documents/{id}/attachments":{"get":{"summary":"List the files on a document's current revision (or ?revisionId=), with sha256","x-required-scope":"documents:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"revisionId","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"The revision's files"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"summary":"Upload a file to a draft document (primary by default; supporting=true attaches without replacing the primary)","x-required-scope":"attachments:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"supporting":{"type":"string","enum":["true","false"],"description":"true attaches a non-primary supporting file; default false makes the file the revision's primary"}}}}}},"responses":{"201":{"description":"The attachment: id, fileName, size, mimeType, sha256 of the stored file, documentRevisionId, isPrimary"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/documents/{id}/attachments/{attachmentId}":{"delete":{"summary":"Delete a draft document's attachment (current revision only; signed or frozen refuses)","x-required-scope":"attachments:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"attachmentId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"{ ok, softDeleted } - softDeleted true when the stored object is shared with another revision and only this row was removed"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/design-projects":{"get":{"summary":"List design projects","x-required-scope":"design:read","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"includeArchived","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"A page of design projects"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/design-projects/{id}":{"get":{"summary":"Get one design project","x-required-scope":"design:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The design project"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/design-projects/{id}/items":{"get":{"summary":"List a project's design items","x-required-scope":"design:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"type","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of design items"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/design-projects/{id}/items/{itemId}":{"get":{"summary":"Get one design item","x-required-scope":"design:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The design item"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/design-projects/{id}/plan":{"get":{"summary":"Get a project's design plan with its tasks and dependencies","x-required-scope":"design:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The plan"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/design-projects/{id}/reviews":{"get":{"summary":"List a project's design reviews with signer counts","x-required-scope":"design:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"A page of design reviews"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/risk-projects":{"get":{"summary":"List risk files","x-required-scope":"risk:read","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"includeArchived","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"A page of risk files"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/risk-projects/{id}":{"get":{"summary":"Get one risk file","x-required-scope":"risk:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The risk file"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/risk-projects/{id}/items":{"get":{"summary":"List a risk file's items","x-required-scope":"risk:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of risk items"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/risk-projects/{id}/reviews":{"get":{"summary":"List a risk file's reviews with signer counts","x-required-scope":"risk:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"A page of risk reviews"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/capas":{"get":{"summary":"List CAPAs","x-required-scope":"capa:read","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of CAPAs","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Capa"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/capas/{id}":{"get":{"summary":"Get one CAPA","x-required-scope":"capa:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The CAPA","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capa"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/change-orders":{"get":{"summary":"List change orders (engineering-change feed for external BOM gates; primary pattern is the changeNumber exact lookup)","x-required-scope":"change_orders:read","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string","enum":["open","routing","awaiting_review","completed","canceled"]}},{"name":"changeNumber","in":"query","schema":{"type":"string"},"description":"Exact change number lookup (e.g. CO-12)"},{"name":"updatedSince","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"A page of change orders (soft-deleted and archived records are never included). approvalsSigned is a derived boolean - signature content never crosses this surface.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChangeOrder"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/change-orders/{id}":{"get":{"summary":"Get one change order","x-required-scope":"change_orders:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The change order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeOrder"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/suppliers":{"get":{"summary":"List the supplier register (approved-supplier-list feed for external purchasing gates)","x-required-scope":"suppliers:read","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string","enum":["active","inactive"]}},{"name":"qualificationStatus","in":"query","schema":{"type":"string","enum":["pending","qualified","conditionally_qualified","disqualified"]}}],"responses":{"200":{"description":"A page of suppliers (soft-deleted and archived records are never included)","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Supplier"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/suppliers/{id}":{"get":{"summary":"Get one supplier","x-required-scope":"suppliers:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The supplier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Supplier"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/audit-findings":{"get":{"summary":"List audit findings","x-required-scope":"audits:read","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of findings","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditFinding"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}}}}