{"openapi":"3.1.0","info":{"title":"DaGiftFoundation LLC Developer API","version":"1.0.0","description":"Versioned access to business plans and goals with workspace-owner consent."},"servers":[{"url":"https://getdagift.com/api","description":"This DaGiftFoundation installation"}],"security":[{"BearerCredential":[]}],"tags":[{"name":"Versioning"},{"name":"Business plans"},{"name":"Goals"}],"paths":{"/v1":{"get":{"tags":["Versioning"],"summary":"Read supported API versions and change guidance","security":[],"responses":{"200":{"description":"Current and supported versions.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/business-plans":{"get":{"tags":["Business plans"],"summary":"List business plans granted to this integration","description":"Requires the business-plans:read scope. Only active workspace grants are returned.","x-required-scopes":["business-plans:read"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum number of items. Defaults to 50; range 1–100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"Continue after the last item id returned as nextCursor.","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of plans with no user names or tenant identifiers.","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"environment":{"type":"string","enum":["SANDBOX","PRODUCTION"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"summary":{"type":"string"},"executiveSummary":{"type":"string"},"targetCustomer":{"type":"string"},"customerProblem":{"type":"string"},"solution":{"type":"string"},"revenueModel":{"type":"string"},"nextMilestone":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","summary","executiveSummary","targetCustomer","customerProblem","solution","revenueModel","nextMilestone","updatedAt"]}},"limit":{"type":"integer","maximum":100},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["environment","items","limit","hasMore","nextCursor"]}}}},"400":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Credential limit exceeded. Retry after the current 60-second window resets.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"500":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/v1/business-plans/{businessPlanId}/goals":{"parameters":[{"name":"businessPlanId","in":"path","required":true,"description":"A business plan id returned to this integration by the API.","schema":{"type":"string"}}],"get":{"tags":["Goals"],"summary":"List goals in one granted plan","description":"Requires the goals:read scope and an active grant for this plan.","x-required-scopes":["goals:read"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum number of items. Defaults to 50; range 1–100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"Continue after the last item id returned as nextCursor.","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of goals.","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"environment":{"type":"string","enum":["SANDBOX","PRODUCTION"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"businessPlanId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"targetDate":{"type":["string","null"],"format":"date"},"priority":{"type":["string","null"],"enum":["high","medium","low",null]},"completed":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","businessPlanId","title","description","targetDate","priority","completed","createdAt","updatedAt"]}},"limit":{"type":"integer","maximum":100},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["environment","items","limit","hasMore","nextCursor"]}}}},"400":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Credential limit exceeded. Retry after the current 60-second window resets.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"500":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"post":{"tags":["Goals"],"summary":"Create a goal in one granted plan","description":"Requires goals:write, an active grant, and an Origin header matching this DaGiftFoundation app. Sandbox credentials write only to sandbox fixtures.","x-required-scopes":["goals:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":6000},"targetDate":{"type":["string","null"],"format":"date"},"priority":{"type":["string","null"],"enum":["high","medium","low",null]}},"required":["title"]},"example":{"title":"Review the sample launch plan","description":"Example request body."}}}},"responses":{"201":{"description":"Created goal.","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"environment":{"type":"string","enum":["SANDBOX","PRODUCTION"]},"item":{"type":"object","properties":{"id":{"type":"string"},"businessPlanId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"targetDate":{"type":["string","null"],"format":"date"},"priority":{"type":["string","null"],"enum":["high","medium","low",null]},"completed":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","businessPlanId","title","description","targetDate","priority","completed","createdAt","updatedAt"]}},"required":["environment","item"]}}}},"400":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Credential limit exceeded. Retry after the current 60-second window resets.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"500":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/v1/goals/{goalId}":{"parameters":[{"name":"goalId","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"tags":["Goals"],"summary":"Update a goal in one granted plan","description":"Requires goals:write, an active grant for the goal’s plan, and an Origin header matching this DaGiftFoundation app.","x-required-scopes":["goals:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"properties":{"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":6000},"targetDate":{"type":["string","null"],"format":"date"},"priority":{"type":["string","null"],"enum":["high","medium","low",null]},"completed":{"type":"boolean"}}},"example":{"completed":true}}}},"responses":{"200":{"description":"Updated goal.","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"environment":{"type":"string","enum":["SANDBOX","PRODUCTION"]},"item":{"type":"object","properties":{"id":{"type":"string"},"businessPlanId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"targetDate":{"type":["string","null"],"format":"date"},"priority":{"type":["string","null"],"enum":["high","medium","low",null]},"completed":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","businessPlanId","title","description","targetDate","priority","completed","createdAt","updatedAt"]}},"required":["environment","item"]}}}},"400":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Credential limit exceeded. Retry after the current 60-second window resets.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}},"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"500":{"description":"The request failed.","headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Identifier for this request."},"X-RateLimit-Limit":{"schema":{"type":"integer","example":60}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer","description":"Unix timestamp in seconds."}}},"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"components":{"securitySchemes":{"BearerCredential":{"type":"http","scheme":"bearer","bearerFormat":"DaGiftFoundation integration token","description":"Use an active sandbox (dg_sbx_) or production (dg_live_) credential from the developer portal."}},"headers":{"RetryAfter":{"schema":{"type":"integer","description":"Seconds until the current window resets."}}}}}