{"openapi":"3.1.0","info":{"title":"Source API","version":"1.0.0","description":"Read and write an organization's projects and tickets. A token acts with the authority of the person who created it, narrowed to its scopes."},"servers":[{"url":"https://flexible-bird-801.eu-west-1.convex.site"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Scopes: projects:read, tickets:read, tickets:write."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]},"Ticket":{"type":"object","properties":{"ref":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["feature","bug","chore","spike","docs"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"labels":{"type":"array","items":{"type":"string"}},"column":{"type":"string"},"createdAt":{"type":"integer","description":"Milliseconds since the epoch."}},"required":["ref","title","labels","createdAt"]}}},"paths":{"/api/v1/projects":{"get":{"summary":"List projects","description":"Requires `projects:read`.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}}}}}}}}},"401":{"description":"The token is missing, invalid or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks a scope, or its creator lacks the permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not visible to the token's creator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"This token is over its request ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{key}/tickets":{"get":{"summary":"List a project's tickets, newest first","description":"Requires `tickets:read`.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"},"example":"NS"},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","items":{"$ref":"#/components/schemas/Ticket"}},"nextCursor":{"type":["string","null"]}}}}}},"401":{"description":"The token is missing, invalid or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks a scope, or its creator lacks the permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not visible to the token's creator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"This token is over its request ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"File a ticket","description":"Requires `tickets:write`. Lands in the board's approval column when it has one.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"},"example":"NS"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["feature","bug","chore","spike","docs"]},"priority":{"type":"string","enum":["low","medium","high","urgent"]},"labels":{"type":"array","items":{"type":"string"}}},"required":["title"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ref":{"type":"string"}}}}}},"401":{"description":"The token is missing, invalid or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks a scope, or its creator lacks the permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not visible to the token's creator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"This token is over its request ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/tickets/{ref}":{"get":{"summary":"Read a ticket","description":"Requires `tickets:read`.","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"},"example":"NS-14"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ticket":{"$ref":"#/components/schemas/Ticket"}}}}}},"401":{"description":"The token is missing, invalid or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks a scope, or its creator lacks the permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not visible to the token's creator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"This token is over its request ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/tickets/{ref}/comments":{"post":{"summary":"Comment on a ticket","description":"Requires `tickets:write`.","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"},"example":"NS-14"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string"}},"required":["body"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"The token is missing, invalid or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks a scope, or its creator lacks the permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not visible to the token's creator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"This token is over its request ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/tickets/{ref}/move":{"post":{"summary":"Move a ticket to a column","description":"Requires `tickets:write`. A comment is mandatory, and a ticket awaiting approval can only leave that column from the board.","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string"},"example":"NS-14"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"column":{"type":"string"},"comment":{"type":"string"}},"required":["column","comment"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"column":{"type":"string"}}}}}},"401":{"description":"The token is missing, invalid or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks a scope, or its creator lacks the permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not visible to the token's creator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"This token is over its request ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}