{"openapi":"3.1.0","info":{"title":"Deal Desk Studio API","version":"1","description":"Draft proposals and answer RFPs from your company's own library. Every request needs an API key: Authorization: Bearer ddk_live_... Docs: https://app.dealdesk.studio/developers"},"servers":[{"url":"https://app.dealdesk.studio/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key from Developer in the app, or from `dealdesk login`."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}},"paths":{"/account":{"get":{"summary":"The account, plan and features this key acts for","operationId":"account.get","x-scope":"read","responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/library/sources":{"get":{"summary":"Documents in the company library (What we know)","operationId":"library.sources.list","x-scope":"read","responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Add a document or text to the library","operationId":"library.sources.add","x-scope":"write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"string"},"text":{"type":"string","description":"string (or data + content_type)"},"data":{"type":"string","description":"base64"},"content_type":{"type":"string","description":"string"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/library/sources/{id}":{"get":{"summary":"One library document and its indexing status","operationId":"library.sources.get","x-scope":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove a document from the library","operationId":"library.sources.delete","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/library/search":{"post":{"summary":"Search the library; passages come back numbered, with their sources, to cite","operationId":"library.search","x-scope":"read","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"string"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/facts":{"get":{"summary":"Facts the company told Deal Desk","operationId":"facts.list","x-scope":"read","responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Tell Deal Desk facts about the company, or ask what it knows","operationId":"facts.teach","x-scope":"write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"string"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/facts/{id}":{"delete":{"summary":"Remove a fact","operationId":"facts.delete","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/facts/gaps":{"get":{"summary":"Facts still missing from documents being answered","operationId":"facts.gaps","x-scope":"read","responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/proposals":{"get":{"summary":"Proposals, orders and agreements, newest first","operationId":"proposals.list","x-scope":"read","responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Draft a proposal from notes: read the deal terms and save it as a draft","operationId":"proposals.draft","x-scope":"write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string","description":"string"},"lang":{"type":"string","description":"en | es-419 | es-ES"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/proposals/{number}":{"get":{"summary":"One proposal: its fields, line items, totals and signing status","operationId":"proposals.get","x-scope":"read","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Change a proposal's fields, line items or discounts","operationId":"proposals.update","x-scope":"write","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","description":"object"},"lineItems":{"type":"array","description":"array"},"discounts":{"type":"array","description":"array"},"multiYear":{"type":"boolean","description":"boolean"},"version":{"type":"integer","description":"integer (optional, to refuse a stale edit)"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/proposals/{number}/pdf":{"get":{"summary":"The proposal as a PDF, rendered exactly like Export PDF","operationId":"proposals.pdf","x-scope":"read","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/proposals/{number}/send":{"post":{"summary":"Email the customer a link to sign the proposal (Deal Desk e-signature). Billed as a sent deal, like sending from the app","operationId":"proposals.send","x-scope":"send","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customer_email":{"type":"string","description":"string"},"customer_name":{"type":"string","description":"string"},"customer_title":{"type":"string","description":"string"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rfps":{"get":{"summary":"Documents being answered (RFPs, RFIs, questionnaires, capability matrices)","operationId":"rfps.list","x-scope":"read","responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Upload a document to answer; it is read into requirements in the background","operationId":"rfps.create","x-scope":"write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"string"},"text":{"type":"string","description":"string (or data + content_type)"},"data":{"type":"string","description":"base64 (.docx, .pdf, .xlsx, .txt)"},"content_type":{"type":"string","description":"string"},"deal_number":{"type":"string","description":"string"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rfps/{id}":{"get":{"summary":"Status and progress of one response","operationId":"rfps.get","x-scope":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a response","operationId":"rfps.delete","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rfps/{id}/requirements":{"get":{"summary":"Requirements with drafted answers and citations","operationId":"rfps.requirements","x-scope":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"open | drafted | answered | na"},{"name":"needs_input","in":"query","required":false,"schema":{"type":"string"},"description":"true"},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"integer"},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"integer (max 200)"}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rfps/{id}/requirements/{rid}/draft":{"post":{"summary":"Draft (or redraft) one answer from the library","operationId":"rfps.draft_answer","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rfps/{id}/requirements/{rid}":{"patch":{"summary":"Edit an answer, or mark it answered (approved answers teach the library)","operationId":"rfps.update_answer","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"string","description":"string"},"status":{"type":"string","description":"open | drafted | answered | na"},"score":{"type":"integer","description":"integer (capability matrices)"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rfps/{id}/requirements/{rid}/fact":{"post":{"summary":"Give the fact a requirement is missing; it is kept in the library and the answer redrafted","operationId":"rfps.answer_gap","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string","description":"string"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rfps/{id}/draft-all":{"post":{"summary":"Draft every open requirement in the background (or cancel)","operationId":"rfps.draft_all","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cancel":{"type":"boolean","description":"boolean"}}}}}},"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rfps/{id}/export":{"get":{"summary":"Download the filled-in original (.docx/.xlsx) or the compliance matrix (CSV)","operationId":"rfps.export","x-scope":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"type":"string"},"description":"filled | csv"}],"responses":{"200":{"description":"OK"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}