{"openapi":"3.1.0","info":{"title":"DigiFlow API","version":"1.0.0","description":"Organization-scoped REST API. Authenticate with an API key (Settings → Developer). Every response includes a requestId on errors. Rate limits apply per organization and per key."},"servers":[{"url":"https://digiflow.network"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"dgs_live_…","description":"Authorization: Bearer dgs_live_YOUR_KEY"}},"schemas":{"CreateClientInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":2,"maxLength":150},"category":{"type":"string","maxLength":80},"city":{"type":"string","maxLength":80},"email":{"type":"string","format":"email"},"phone":{"type":"string","maxLength":30}}},"CreateLeadInput":{"type":"object","required":["businessId"],"properties":{"businessId":{"type":"string"}}},"Client":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"totalRevenue":{"type":"number"},"monthlyRevenue":{"type":"number"},"convertedAt":{"type":"string","format":"date-time"},"business":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}}}}},"Lead":{"type":"object","properties":{"id":{"type":"string"},"stage":{"type":"string"},"leadScore":{"type":"number","nullable":true},"scoreBand":{"type":"string","nullable":true},"expectedValue":{"type":"number","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"Invoice":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"issueDate":{"type":"string","format":"date-time"},"dueDate":{"type":"string","format":"date-time"},"total":{"type":"string"},"amountPaid":{"type":"string"},"amountDue":{"type":"string"}}},"Proposal":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"version":{"type":"number"},"total":{"type":"number"},"monthlyTotal":{"type":"number"},"currency":{"type":"string"}}},"Project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"billingType":{"type":"string"},"value":{"type":"number"}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"requestId":{"type":"string"}}}}},"paths":{"/api/v1/clients":{"get":{"summary":"List clients","security":[{"apiKey":[]}],"x-required-scope":"clients:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Page size (cursorless pagination by recency)."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Client"}}}}}}},"401":{"description":"Invalid, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (including cross-organization ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a client","security":[{"apiKey":[]}],"x-required-scope":"clients:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Retried POSTs with the same key replay the original response instead of duplicating the effect (7-day window)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClientInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Client"}}}}}},"401":{"description":"Invalid, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (including cross-organization ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/leads":{"get":{"summary":"List leads","security":[{"apiKey":[]}],"x-required-scope":"leads:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Page size (cursorless pagination by recency)."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}}}}}}},"401":{"description":"Invalid, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (including cross-organization ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a lead from a business","security":[{"apiKey":[]}],"x-required-scope":"leads:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Retried POSTs with the same key replay the original response instead of duplicating the effect (7-day window)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Lead"}}}}}},"401":{"description":"Invalid, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (including cross-organization ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/invoices":{"get":{"summary":"List invoices","security":[{"apiKey":[]}],"x-required-scope":"invoices:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Page size (cursorless pagination by recency)."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}}}},"401":{"description":"Invalid, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (including cross-organization ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/proposals":{"get":{"summary":"List proposals","security":[{"apiKey":[]}],"x-required-scope":"proposals:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Page size (cursorless pagination by recency)."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Proposal"}}}}}}},"401":{"description":"Invalid, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (including cross-organization ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects":{"get":{"summary":"List projects","security":[{"apiKey":[]}],"x-required-scope":"projects:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Page size (cursorless pagination by recency)."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}}}},"401":{"description":"Invalid, revoked or expired API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (including cross-organization ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}