@epilot/sdk 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/definitions/access-token-runtime.json +1 -0
  2. package/definitions/access-token.json +663 -0
  3. package/definitions/address-runtime.json +1 -0
  4. package/definitions/address-suggestions-runtime.json +1 -0
  5. package/definitions/address-suggestions.json +582 -0
  6. package/definitions/address.json +578 -0
  7. package/definitions/ai-agents-runtime.json +1 -0
  8. package/definitions/ai-agents.json +1711 -0
  9. package/definitions/app-runtime.json +1 -0
  10. package/definitions/app.json +4493 -0
  11. package/definitions/audit-logs-runtime.json +1 -0
  12. package/definitions/audit-logs.json +305 -0
  13. package/definitions/automation-runtime.json +1 -0
  14. package/definitions/automation.json +5028 -0
  15. package/definitions/billing-runtime.json +1 -0
  16. package/definitions/billing.json +837 -0
  17. package/definitions/blueprint-manifest-runtime.json +1 -0
  18. package/definitions/blueprint-manifest.json +4619 -0
  19. package/definitions/consent-runtime.json +1 -0
  20. package/definitions/consent.json +344 -0
  21. package/definitions/customer-portal-runtime.json +1 -0
  22. package/definitions/customer-portal.json +15676 -0
  23. package/definitions/dashboard-runtime.json +1 -0
  24. package/definitions/dashboard.json +484 -0
  25. package/definitions/data-governance-runtime.json +1 -0
  26. package/definitions/data-governance.json +1126 -0
  27. package/definitions/deduplication-runtime.json +1 -0
  28. package/definitions/deduplication.json +314 -0
  29. package/definitions/design-runtime.json +1 -0
  30. package/definitions/design.json +1469 -0
  31. package/definitions/document-runtime.json +1 -0
  32. package/definitions/document.json +758 -0
  33. package/definitions/email-settings-runtime.json +1 -0
  34. package/definitions/email-settings.json +2777 -0
  35. package/definitions/email-template-runtime.json +1 -0
  36. package/definitions/email-template.json +1441 -0
  37. package/definitions/entity-mapping-runtime.json +1 -0
  38. package/definitions/entity-mapping.json +1642 -0
  39. package/definitions/entity-runtime.json +1 -0
  40. package/definitions/entity.json +10474 -0
  41. package/definitions/environments-runtime.json +1 -0
  42. package/definitions/environments.json +539 -0
  43. package/definitions/event-catalog-runtime.json +1 -0
  44. package/definitions/event-catalog.json +1051 -0
  45. package/definitions/file-runtime.json +1 -0
  46. package/definitions/file.json +2842 -0
  47. package/definitions/iban-runtime.json +1 -0
  48. package/definitions/iban.json +132 -0
  49. package/definitions/integration-toolkit-runtime.json +1 -0
  50. package/definitions/integration-toolkit.json +7998 -0
  51. package/definitions/journey-runtime.json +1 -0
  52. package/definitions/journey.json +2603 -0
  53. package/definitions/kanban-runtime.json +1 -0
  54. package/definitions/kanban.json +1505 -0
  55. package/definitions/message-runtime.json +1 -0
  56. package/definitions/message.json +2862 -0
  57. package/definitions/metering-runtime.json +1 -0
  58. package/definitions/metering.json +2321 -0
  59. package/definitions/notes-runtime.json +1 -0
  60. package/definitions/notes.json +1531 -0
  61. package/definitions/notification-runtime.json +1 -0
  62. package/definitions/notification.json +1425 -0
  63. package/definitions/organization-runtime.json +1 -0
  64. package/definitions/organization.json +1192 -0
  65. package/definitions/partner-directory-runtime.json +1 -0
  66. package/definitions/partner-directory.json +2284 -0
  67. package/definitions/permissions-runtime.json +1 -0
  68. package/definitions/permissions.json +1515 -0
  69. package/definitions/pricing-runtime.json +1 -0
  70. package/definitions/pricing-tier-runtime.json +1 -0
  71. package/definitions/pricing-tier.json +105 -0
  72. package/definitions/pricing.json +9884 -0
  73. package/definitions/purpose-runtime.json +1 -0
  74. package/definitions/purpose.json +524 -0
  75. package/definitions/sandbox-runtime.json +1 -0
  76. package/definitions/sandbox.json +453 -0
  77. package/definitions/sharing-runtime.json +1 -0
  78. package/definitions/sharing.json +956 -0
  79. package/definitions/submission-runtime.json +1 -0
  80. package/definitions/submission.json +313 -0
  81. package/definitions/targeting-runtime.json +1 -0
  82. package/definitions/targeting.json +1474 -0
  83. package/definitions/template-variables-runtime.json +1 -0
  84. package/definitions/template-variables.json +1416 -0
  85. package/definitions/user-runtime.json +1 -0
  86. package/definitions/user.json +2460 -0
  87. package/definitions/validation-rules-runtime.json +1 -0
  88. package/definitions/validation-rules.json +1491 -0
  89. package/definitions/webhooks-runtime.json +1 -0
  90. package/definitions/webhooks.json +1634 -0
  91. package/definitions/workflow-definition-runtime.json +1 -0
  92. package/definitions/workflow-definition.json +3302 -0
  93. package/definitions/workflow-runtime.json +1 -0
  94. package/definitions/workflow.json +4248 -0
  95. package/dist/README-KX4XC2HB.js +7 -0
  96. package/dist/README-PTYV6PQI.cjs +7 -0
  97. package/dist/apis/access-token.cjs +6 -6
  98. package/dist/apis/access-token.js +1 -1
  99. package/dist/apis/address-suggestions.cjs +6 -6
  100. package/dist/apis/address-suggestions.js +1 -1
  101. package/dist/apis/address.cjs +6 -6
  102. package/dist/apis/address.js +1 -1
  103. package/dist/apis/ai-agents.cjs +6 -6
  104. package/dist/apis/ai-agents.js +1 -1
  105. package/dist/apis/app.cjs +6 -6
  106. package/dist/apis/app.js +1 -1
  107. package/dist/apis/audit-logs.cjs +6 -6
  108. package/dist/apis/audit-logs.js +1 -1
  109. package/dist/apis/automation.cjs +6 -6
  110. package/dist/apis/automation.js +1 -1
  111. package/dist/apis/billing.cjs +6 -6
  112. package/dist/apis/billing.js +1 -1
  113. package/dist/apis/blueprint-manifest.cjs +6 -6
  114. package/dist/apis/blueprint-manifest.js +1 -1
  115. package/dist/apis/consent.cjs +6 -6
  116. package/dist/apis/consent.js +1 -1
  117. package/dist/apis/customer-portal.cjs +6 -6
  118. package/dist/apis/customer-portal.js +1 -1
  119. package/dist/apis/dashboard.cjs +6 -6
  120. package/dist/apis/dashboard.js +1 -1
  121. package/dist/apis/data-governance.cjs +6 -6
  122. package/dist/apis/data-governance.js +1 -1
  123. package/dist/apis/deduplication.cjs +6 -6
  124. package/dist/apis/deduplication.js +1 -1
  125. package/dist/apis/design.cjs +6 -6
  126. package/dist/apis/design.js +1 -1
  127. package/dist/apis/document.cjs +6 -6
  128. package/dist/apis/document.js +1 -1
  129. package/dist/apis/email-settings.cjs +6 -6
  130. package/dist/apis/email-settings.js +1 -1
  131. package/dist/apis/email-template.cjs +6 -6
  132. package/dist/apis/email-template.js +1 -1
  133. package/dist/apis/entity-mapping.cjs +6 -6
  134. package/dist/apis/entity-mapping.js +1 -1
  135. package/dist/apis/entity.cjs +6 -6
  136. package/dist/apis/entity.js +1 -1
  137. package/dist/apis/environments.cjs +8 -8
  138. package/dist/apis/environments.js +2 -2
  139. package/dist/apis/event-catalog.cjs +6 -6
  140. package/dist/apis/event-catalog.js +1 -1
  141. package/dist/apis/file.cjs +6 -6
  142. package/dist/apis/file.js +1 -1
  143. package/dist/apis/iban.cjs +6 -6
  144. package/dist/apis/iban.js +1 -1
  145. package/dist/apis/integration-toolkit.cjs +6 -6
  146. package/dist/apis/integration-toolkit.js +1 -1
  147. package/dist/apis/journey.cjs +6 -6
  148. package/dist/apis/journey.js +1 -1
  149. package/dist/apis/kanban.cjs +6 -6
  150. package/dist/apis/kanban.js +1 -1
  151. package/dist/apis/message.cjs +6 -6
  152. package/dist/apis/message.js +1 -1
  153. package/dist/apis/metering.cjs +6 -6
  154. package/dist/apis/metering.js +1 -1
  155. package/dist/apis/notes.cjs +6 -6
  156. package/dist/apis/notes.js +1 -1
  157. package/dist/apis/notification.cjs +6 -6
  158. package/dist/apis/notification.js +1 -1
  159. package/dist/apis/organization.cjs +6 -6
  160. package/dist/apis/organization.js +1 -1
  161. package/dist/apis/partner-directory.cjs +6 -6
  162. package/dist/apis/partner-directory.js +1 -1
  163. package/dist/apis/permissions.cjs +6 -6
  164. package/dist/apis/permissions.js +1 -1
  165. package/dist/apis/pricing-tier.cjs +6 -6
  166. package/dist/apis/pricing-tier.js +1 -1
  167. package/dist/apis/pricing.cjs +6 -6
  168. package/dist/apis/pricing.js +1 -1
  169. package/dist/apis/purpose.cjs +6 -6
  170. package/dist/apis/purpose.js +1 -1
  171. package/dist/apis/sandbox.cjs +6 -6
  172. package/dist/apis/sandbox.js +1 -1
  173. package/dist/apis/sharing.cjs +6 -6
  174. package/dist/apis/sharing.js +1 -1
  175. package/dist/apis/submission.cjs +6 -6
  176. package/dist/apis/submission.js +1 -1
  177. package/dist/apis/targeting.cjs +6 -6
  178. package/dist/apis/targeting.js +1 -1
  179. package/dist/apis/template-variables.cjs +6 -6
  180. package/dist/apis/template-variables.js +1 -1
  181. package/dist/apis/user.cjs +6 -6
  182. package/dist/apis/user.d.cts +2 -2
  183. package/dist/apis/user.d.ts +2 -2
  184. package/dist/apis/user.js +1 -1
  185. package/dist/apis/validation-rules.cjs +6 -6
  186. package/dist/apis/validation-rules.js +1 -1
  187. package/dist/apis/webhooks.cjs +6 -6
  188. package/dist/apis/webhooks.js +1 -1
  189. package/dist/apis/workflow-definition.cjs +6 -6
  190. package/dist/apis/workflow-definition.js +1 -1
  191. package/dist/apis/workflow.cjs +6 -6
  192. package/dist/apis/workflow.js +1 -1
  193. package/dist/{chunk-6AO46HG5.js → chunk-5JN243WJ.js} +5 -5
  194. package/dist/chunk-6IMAKHA4.js +14 -0
  195. package/dist/{chunk-TXDVGTQD.cjs → chunk-BDKLBHIN.cjs} +1 -1
  196. package/dist/{chunk-MHXQX7FS.cjs → chunk-VTJQTEQX.cjs} +5 -5
  197. package/dist/environments-I6RWPVHA.js +7 -0
  198. package/dist/environments-TZYXLYXA.cjs +7 -0
  199. package/dist/{environments-runtime-L6TJCVW6.cjs → environments-runtime-5DVTRV2Z.cjs} +2 -2
  200. package/dist/{environments-runtime-BPR47PW7.js → environments-runtime-FMSNJF5S.js} +1 -1
  201. package/dist/erp-integration-runtime-JGVGQ22V.js +13 -0
  202. package/dist/erp-integration-runtime-OZ4YSTQX.cjs +13 -0
  203. package/dist/index.cjs +18 -18
  204. package/dist/index.d.cts +1 -1
  205. package/dist/index.d.ts +1 -1
  206. package/dist/index.js +12 -12
  207. package/dist/user-7ZN2XO7G.cjs +7 -0
  208. package/dist/user-ZK7BK6VY.js +7 -0
  209. package/dist/{user.d-CXqM751M.d.cts → user.d-D18fe97W.d.cts} +75 -3
  210. package/dist/{user.d-CXqM751M.d.ts → user.d-D18fe97W.d.ts} +75 -3
  211. package/docs/environments.md +129 -3
  212. package/docs/user.md +62 -8
  213. package/package.json +1 -1
  214. package/dist/README-7R2JR652.js +0 -7
  215. package/dist/README-Z5AKTGJA.cjs +0 -7
  216. package/dist/apis/erp-integration.cjs +0 -38
  217. package/dist/apis/erp-integration.d.cts +0 -5770
  218. package/dist/apis/erp-integration.d.ts +0 -5770
  219. package/dist/apis/erp-integration.js +0 -38
  220. package/dist/chunk-6OYECNL2.js +0 -14
  221. package/dist/chunk-MUNMUGB5.js +0 -14
  222. package/dist/chunk-TLH6XOTL.cjs +0 -14
  223. package/dist/environments-E3X6NYGX.js +0 -7
  224. package/dist/environments-P2JS4F5N.cjs +0 -7
  225. package/dist/erp-integration-runtime-BHHWMG4O.js +0 -5
  226. package/dist/erp-integration-runtime-Y6VWGQ3L.cjs +0 -5
  227. package/dist/user-EIEOI3OG.js +0 -7
  228. package/dist/user-NJJ7XVKB.cjs +0 -7
@@ -0,0 +1,1126 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "Data Governance API",
5
+ "version": "1.2.0",
6
+ "description": "The **Data Governance API** provides a set of endpoints for managing the lifecycle of\nentity data within the epilot platform. It enables organizations to define governance\npolicies — such as automated data deletion rules — and execute them against any entity\nschema (currently limited to Contacts).\n\n## Core Concepts\n\n### Data Lifecycle Configs\nA **config** defines a data lifecycle policy for a given entity schema. Each config consists of:\n- A **base view** (saved entity view) that identifies candidate entities\n- **Advanced filters** not available in standard entity tables (e.g. only contacts where all related opportunities have a workflow status of CLOSED)\n- A **schedule** controlling how often the policy runs (e.g. every 90 days)\n- **Related entity handling** — which linked entities should be deleted alongside the primary entity\n- An **action type** (currently only `deletion`)\n\nConfigs can be enabled or disabled and are evaluated on a recurring schedule.\n\n### Auditable Jobs\nEvery deletion — whether manual or automatic — produces an **auditable job** with full\ntraceability. Each job records its status, timing, trigger type, and generates a\ndownloadable CSV report detailing exactly which entities were affected.\n\n### Query\nThe query endpoint allows previewing which entities match a data lifecycle config\nbefore it is executed, combining a saved view with additional data governance\nfilters.\n\n### Data Recovery\nDeleted entities are moved to the trash where they remain recoverable for 30 days.\nAfter this retention period, deletion becomes permanent and irreversible.\n\n## Authentication\nAll endpoints require a valid epilot OAuth2 bearer token passed in the\n`Authorization` header. Optionally, the `x-epilot-org-id` header can be used\nto target a specific organization for shared-tenant access.\n"
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "https://data-governance.sls.epilot.io"
11
+ }
12
+ ],
13
+ "tags": [
14
+ {
15
+ "name": "Query",
16
+ "description": "Preview which entities match a data lifecycle config by combining a saved view\nwith additional data governance filters.\n"
17
+ },
18
+ {
19
+ "name": "Data Lifecycle Configs",
20
+ "description": "Create, update, list, and retrieve data lifecycle configurations that\ndefine automated actions (e.g., deletion) on entity data.\n"
21
+ },
22
+ {
23
+ "name": "Auditable Jobs",
24
+ "description": "Every deletion produces an auditable job with full traceability.\nCreate, list, retrieve, and update job runs. Includes report download.\n"
25
+ }
26
+ ],
27
+ "security": [
28
+ {
29
+ "EpilotAuth": []
30
+ },
31
+ {
32
+ "EpilotOrg": []
33
+ }
34
+ ],
35
+ "paths": {
36
+ "/data-governance/v1/{entity_schema}/query": {
37
+ "post": {
38
+ "operationId": "queryEntities",
39
+ "summary": "Query entities matching a data lifecycle config",
40
+ "description": "Executes a query against the specified entity schema using a saved view\ndefinition, optionally combined with additional data governance filters.\n\nThis endpoint is typically used to **preview** which entities would be\naffected by a data lifecycle config before it runs. The response includes\nthe total hit count and (optionally hydrated) entity results.\n\nPagination is supported via `from` and `size` in the request body.\n",
41
+ "tags": [
42
+ "Query"
43
+ ],
44
+ "parameters": [
45
+ {
46
+ "name": "entity_schema",
47
+ "in": "path",
48
+ "required": true,
49
+ "description": "The target entity schema slug to query\n(e.g. `contact`, `opportunity`, `order`).\n",
50
+ "schema": {
51
+ "type": "string"
52
+ },
53
+ "example": "contact"
54
+ }
55
+ ],
56
+ "requestBody": {
57
+ "required": true,
58
+ "content": {
59
+ "application/json": {
60
+ "schema": {
61
+ "$ref": "#/components/schemas/QueryEntitiesRequest"
62
+ }
63
+ }
64
+ }
65
+ },
66
+ "responses": {
67
+ "200": {
68
+ "description": "Successfully executed query. Returns matching entities and total hit count.",
69
+ "content": {
70
+ "application/json": {
71
+ "schema": {
72
+ "$ref": "#/components/schemas/QueryEntitiesResult"
73
+ }
74
+ }
75
+ }
76
+ },
77
+ "400": {
78
+ "description": "Invalid request — malformed filters or missing saved view ID."
79
+ },
80
+ "401": {
81
+ "description": "Unauthorized — missing or invalid bearer token."
82
+ },
83
+ "403": {
84
+ "description": "Forbidden — caller lacks permission to query the specified schema."
85
+ }
86
+ }
87
+ }
88
+ },
89
+ "/data-governance/v1/{entity_schema}/jobs": {
90
+ "post": {
91
+ "operationId": "createJob",
92
+ "summary": "Create a new job run",
93
+ "description": "Creates a new job run for the given entity schema. The job is associated\nwith an existing config and records the scheduled execution date.\n\nThis is a low-level endpoint used internally by the scheduler. For\nmanually triggering a config execution, prefer\n`POST /data-governance/v1/configs/{config_id}/jobs`.\n",
94
+ "tags": [
95
+ "Auditable Jobs"
96
+ ],
97
+ "parameters": [
98
+ {
99
+ "name": "entity_schema",
100
+ "in": "path",
101
+ "required": true,
102
+ "description": "The entity schema slug this job operates on (e.g. `contact`).",
103
+ "schema": {
104
+ "type": "string"
105
+ },
106
+ "example": "contact"
107
+ }
108
+ ],
109
+ "requestBody": {
110
+ "required": true,
111
+ "content": {
112
+ "application/json": {
113
+ "schema": {
114
+ "$ref": "#/components/schemas/CreateJobRequest"
115
+ }
116
+ }
117
+ }
118
+ },
119
+ "responses": {
120
+ "201": {
121
+ "description": "Job successfully created.",
122
+ "content": {
123
+ "application/json": {
124
+ "schema": {
125
+ "$ref": "#/components/schemas/Job"
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "400": {
131
+ "description": "Invalid request body."
132
+ },
133
+ "401": {
134
+ "description": "Unauthorized."
135
+ },
136
+ "404": {
137
+ "description": "Referenced config not found."
138
+ }
139
+ }
140
+ }
141
+ },
142
+ "/data-governance/v1/{entity_schema}/jobs/{job_id}": {
143
+ "patch": {
144
+ "operationId": "updateJob",
145
+ "summary": "Update an existing job run",
146
+ "description": "Partially updates an existing job run. Typically used to record\nprogress or finalize a job by setting its status to `success` or\n`failed`, attaching details, error messages, or a report reference.\n",
147
+ "tags": [
148
+ "Auditable Jobs"
149
+ ],
150
+ "parameters": [
151
+ {
152
+ "name": "entity_schema",
153
+ "in": "path",
154
+ "required": true,
155
+ "description": "The entity schema slug this job belongs to.",
156
+ "schema": {
157
+ "type": "string"
158
+ },
159
+ "example": "contact"
160
+ },
161
+ {
162
+ "name": "job_id",
163
+ "in": "path",
164
+ "required": true,
165
+ "description": "Unique identifier of the job to update.",
166
+ "schema": {
167
+ "type": "string"
168
+ },
169
+ "example": "2d3b5e90-e4c0-4f1a-9c7b-abc123def456"
170
+ }
171
+ ],
172
+ "requestBody": {
173
+ "required": true,
174
+ "content": {
175
+ "application/json": {
176
+ "schema": {
177
+ "$ref": "#/components/schemas/UpdateJobRequest"
178
+ }
179
+ }
180
+ }
181
+ },
182
+ "responses": {
183
+ "200": {
184
+ "description": "Job successfully updated.",
185
+ "content": {
186
+ "application/json": {
187
+ "schema": {
188
+ "$ref": "#/components/schemas/Job"
189
+ }
190
+ }
191
+ }
192
+ },
193
+ "401": {
194
+ "description": "Unauthorized."
195
+ },
196
+ "404": {
197
+ "description": "Job not found."
198
+ }
199
+ }
200
+ }
201
+ },
202
+ "/data-governance/v1/jobs/{job_id}": {
203
+ "get": {
204
+ "operationId": "getJob",
205
+ "summary": "Get a job by ID",
206
+ "description": "Returns full details of a single job run, including its current status,\nexecution timestamps, type-specific details, and report reference\n(if available).\n",
207
+ "tags": [
208
+ "Auditable Jobs"
209
+ ],
210
+ "parameters": [
211
+ {
212
+ "name": "job_id",
213
+ "in": "path",
214
+ "required": true,
215
+ "description": "Unique identifier of the job.",
216
+ "schema": {
217
+ "type": "string"
218
+ },
219
+ "example": "2d3b5e90-e4c0-4f1a-9c7b-abc123def456"
220
+ }
221
+ ],
222
+ "responses": {
223
+ "200": {
224
+ "description": "Job details.",
225
+ "content": {
226
+ "application/json": {
227
+ "schema": {
228
+ "$ref": "#/components/schemas/Job"
229
+ }
230
+ }
231
+ }
232
+ },
233
+ "401": {
234
+ "description": "Unauthorized."
235
+ },
236
+ "404": {
237
+ "description": "Job not found."
238
+ }
239
+ }
240
+ }
241
+ },
242
+ "/data-governance/v1/jobs/{job_id}/report-url": {
243
+ "get": {
244
+ "operationId": "getJobReportUrl",
245
+ "summary": "Get report download URL for a job",
246
+ "description": "Returns a short-lived, pre-signed S3 URL to download the CSV report\nfile for the given job. The URL expires after the number of seconds\nindicated in the `expires_in` field.\n\nA report is only available after a job has completed. If the job is\nstill in progress or did not produce a report, a 404 is returned.\n",
247
+ "tags": [
248
+ "Auditable Jobs"
249
+ ],
250
+ "parameters": [
251
+ {
252
+ "name": "job_id",
253
+ "in": "path",
254
+ "required": true,
255
+ "description": "Unique identifier of the job whose report to download.",
256
+ "schema": {
257
+ "type": "string"
258
+ },
259
+ "example": "2d3b5e90-e4c0-4f1a-9c7b-abc123def456"
260
+ }
261
+ ],
262
+ "responses": {
263
+ "200": {
264
+ "description": "Pre-signed report download URL.",
265
+ "content": {
266
+ "application/json": {
267
+ "schema": {
268
+ "$ref": "#/components/schemas/JobReportUrlResponse"
269
+ }
270
+ }
271
+ }
272
+ },
273
+ "401": {
274
+ "description": "Unauthorized."
275
+ },
276
+ "404": {
277
+ "description": "Job not found or report not yet available."
278
+ }
279
+ }
280
+ }
281
+ },
282
+ "/data-governance/v1/configs/{config_id}": {
283
+ "get": {
284
+ "operationId": "getConfig",
285
+ "summary": "Get a config by ID",
286
+ "description": "Returns a single data data lifecycle config by its unique identifier,\nincluding its query definition, schedule, and current enabled state.\n",
287
+ "tags": [
288
+ "Data Lifecycle Configs"
289
+ ],
290
+ "parameters": [
291
+ {
292
+ "name": "config_id",
293
+ "in": "path",
294
+ "required": true,
295
+ "description": "Unique identifier of the config.",
296
+ "schema": {
297
+ "type": "string"
298
+ },
299
+ "example": "cfg-8a12f3b4-5678-9abc-def0-123456789abc"
300
+ }
301
+ ],
302
+ "responses": {
303
+ "200": {
304
+ "description": "Config details.",
305
+ "content": {
306
+ "application/json": {
307
+ "schema": {
308
+ "$ref": "#/components/schemas/Config"
309
+ }
310
+ }
311
+ }
312
+ },
313
+ "401": {
314
+ "description": "Unauthorized."
315
+ },
316
+ "404": {
317
+ "description": "Config not found."
318
+ }
319
+ }
320
+ }
321
+ },
322
+ "/data-governance/v1/configs/{config_id}/jobs": {
323
+ "post": {
324
+ "operationId": "createJobForConfig",
325
+ "summary": "Trigger a manual job run for a config",
326
+ "description": "Manually triggers a new job run for the specified config. The job is\ncreated and queued for asynchronous execution.\n\nReturns the newly created job, whose `id` can be used to poll status\nvia `GET /data-governance/v1/jobs/{job_id}`.\n\nThe job's `trigger` field will be set to `manual` and `triggered_by`\nwill contain the authenticated user's identifier.\n",
327
+ "tags": [
328
+ "Auditable Jobs"
329
+ ],
330
+ "parameters": [
331
+ {
332
+ "name": "config_id",
333
+ "in": "path",
334
+ "required": true,
335
+ "description": "Unique identifier of the config to execute.",
336
+ "schema": {
337
+ "type": "string"
338
+ },
339
+ "example": "cfg-8a12f3b4-5678-9abc-def0-123456789abc"
340
+ }
341
+ ],
342
+ "responses": {
343
+ "201": {
344
+ "description": "Job created and queued for execution.",
345
+ "content": {
346
+ "application/json": {
347
+ "schema": {
348
+ "$ref": "#/components/schemas/Job"
349
+ }
350
+ }
351
+ }
352
+ },
353
+ "401": {
354
+ "description": "Unauthorized."
355
+ },
356
+ "404": {
357
+ "description": "Config not found."
358
+ }
359
+ }
360
+ }
361
+ },
362
+ "/data-governance/v1/{entity_schema}/configs": {
363
+ "post": {
364
+ "operationId": "upsertConfig",
365
+ "summary": "Create or update a data lifecycle config",
366
+ "description": "Creates a new data lifecycle config or updates an existing one for the\ngiven entity schema. The config defines:\n- A **query** (saved view + optional filters) to identify target entities\n- A **schedule** controlling how often the policy runs\n- An **action type** (currently only `deletion`)\n\nOnce created and enabled, the config is evaluated on its schedule by a\nbackground process that creates job runs automatically.\n\nReturns `201` when a new config is created, `200` when an existing\nconfig is updated.\n",
367
+ "tags": [
368
+ "Data Lifecycle Configs"
369
+ ],
370
+ "parameters": [
371
+ {
372
+ "name": "entity_schema",
373
+ "in": "path",
374
+ "required": true,
375
+ "description": "The entity schema slug this config targets (e.g. `contact`).",
376
+ "schema": {
377
+ "type": "string"
378
+ },
379
+ "example": "contact"
380
+ }
381
+ ],
382
+ "requestBody": {
383
+ "required": true,
384
+ "content": {
385
+ "application/json": {
386
+ "schema": {
387
+ "$ref": "#/components/schemas/UpsertConfigRequest"
388
+ }
389
+ }
390
+ }
391
+ },
392
+ "responses": {
393
+ "200": {
394
+ "description": "Existing config updated.",
395
+ "content": {
396
+ "application/json": {
397
+ "schema": {
398
+ "$ref": "#/components/schemas/Config"
399
+ }
400
+ }
401
+ }
402
+ },
403
+ "201": {
404
+ "description": "New config created.",
405
+ "content": {
406
+ "application/json": {
407
+ "schema": {
408
+ "$ref": "#/components/schemas/Config"
409
+ }
410
+ }
411
+ }
412
+ },
413
+ "400": {
414
+ "description": "Invalid request body."
415
+ },
416
+ "401": {
417
+ "description": "Unauthorized."
418
+ }
419
+ }
420
+ }
421
+ },
422
+ "/data-governance/v1/configs": {
423
+ "get": {
424
+ "operationId": "listConfigs",
425
+ "summary": "List data lifecycle configs",
426
+ "description": "Returns a cursor-paginated list of data lifecycle configs. Results can be\nfiltered by entity schema, config type, scheduled run date, or\nenabled status.\n",
427
+ "tags": [
428
+ "Data Lifecycle Configs"
429
+ ],
430
+ "parameters": [
431
+ {
432
+ "name": "limit",
433
+ "in": "query",
434
+ "required": false,
435
+ "description": "Maximum number of configs to return per page.",
436
+ "schema": {
437
+ "type": "integer",
438
+ "default": 25
439
+ }
440
+ },
441
+ {
442
+ "name": "cursor",
443
+ "in": "query",
444
+ "required": false,
445
+ "description": "Opaque cursor returned from a previous response for fetching the\nnext page of results.\n",
446
+ "schema": {
447
+ "type": "string"
448
+ }
449
+ },
450
+ {
451
+ "name": "entity_schema",
452
+ "in": "query",
453
+ "required": false,
454
+ "description": "Filter configs by entity schema slug (e.g. `contact`).",
455
+ "schema": {
456
+ "type": "string"
457
+ }
458
+ },
459
+ {
460
+ "name": "type",
461
+ "in": "query",
462
+ "required": false,
463
+ "description": "Filter configs by governance action type.",
464
+ "schema": {
465
+ "$ref": "#/components/schemas/ConfigType"
466
+ }
467
+ },
468
+ {
469
+ "name": "next_run_at",
470
+ "in": "query",
471
+ "required": false,
472
+ "description": "Filter configs whose next scheduled run date matches this value\n(format: `YYYY-MM-DD`).\n",
473
+ "schema": {
474
+ "type": "string",
475
+ "format": "date"
476
+ }
477
+ },
478
+ {
479
+ "name": "enabled",
480
+ "in": "query",
481
+ "required": false,
482
+ "description": "Filter by enabled (`true`) or disabled (`false`) status.",
483
+ "schema": {
484
+ "type": "boolean"
485
+ }
486
+ }
487
+ ],
488
+ "responses": {
489
+ "200": {
490
+ "description": "Paginated list of configs.",
491
+ "content": {
492
+ "application/json": {
493
+ "schema": {
494
+ "$ref": "#/components/schemas/ListConfigsResponse"
495
+ }
496
+ }
497
+ }
498
+ },
499
+ "401": {
500
+ "description": "Unauthorized."
501
+ }
502
+ }
503
+ }
504
+ },
505
+ "/data-governance/v1/jobs": {
506
+ "get": {
507
+ "operationId": "listJobs",
508
+ "summary": "List job runs",
509
+ "description": "Returns a cursor-paginated list of job runs. Results can be filtered\nby entity schema, action type, execution status, or parent config.\n",
510
+ "tags": [
511
+ "Auditable Jobs"
512
+ ],
513
+ "parameters": [
514
+ {
515
+ "name": "limit",
516
+ "in": "query",
517
+ "required": false,
518
+ "description": "Maximum number of jobs to return per page.",
519
+ "schema": {
520
+ "type": "integer",
521
+ "default": 25
522
+ }
523
+ },
524
+ {
525
+ "name": "cursor",
526
+ "in": "query",
527
+ "required": false,
528
+ "description": "Opaque cursor returned from a previous response for fetching the\nnext page of results.\n",
529
+ "schema": {
530
+ "type": "string"
531
+ }
532
+ },
533
+ {
534
+ "name": "entity_schema",
535
+ "in": "query",
536
+ "required": false,
537
+ "description": "Filter jobs by entity schema slug (e.g. `contact`).",
538
+ "schema": {
539
+ "type": "string"
540
+ }
541
+ },
542
+ {
543
+ "name": "type",
544
+ "in": "query",
545
+ "required": false,
546
+ "description": "Filter jobs by governance action type.",
547
+ "schema": {
548
+ "$ref": "#/components/schemas/ConfigType"
549
+ }
550
+ },
551
+ {
552
+ "name": "status",
553
+ "in": "query",
554
+ "required": false,
555
+ "description": "Filter jobs by execution status.",
556
+ "schema": {
557
+ "$ref": "#/components/schemas/JobStatus"
558
+ }
559
+ },
560
+ {
561
+ "name": "config_id",
562
+ "in": "query",
563
+ "required": false,
564
+ "description": "Filter jobs belonging to a specific config.",
565
+ "schema": {
566
+ "type": "string"
567
+ }
568
+ }
569
+ ],
570
+ "responses": {
571
+ "200": {
572
+ "description": "Paginated list of jobs.",
573
+ "content": {
574
+ "application/json": {
575
+ "schema": {
576
+ "$ref": "#/components/schemas/ListJobsResponse"
577
+ }
578
+ }
579
+ }
580
+ },
581
+ "401": {
582
+ "description": "Unauthorized."
583
+ }
584
+ }
585
+ }
586
+ }
587
+ },
588
+ "components": {
589
+ "securitySchemes": {
590
+ "EpilotAuth": {
591
+ "type": "http",
592
+ "scheme": "bearer",
593
+ "description": "Authorization header with epilot OAuth2 bearer token",
594
+ "bearerFormat": "JWT"
595
+ },
596
+ "EpilotOrg": {
597
+ "description": "Overrides the target organization to allow shared tenant access",
598
+ "name": "x-epilot-org-id",
599
+ "in": "header",
600
+ "type": "apiKey"
601
+ }
602
+ },
603
+ "schemas": {
604
+ "ConfigType": {
605
+ "type": "string",
606
+ "description": "The governance action type. Determines what operation is performed on\nmatched entities when a job runs. Currently only `deletion` is supported.\n",
607
+ "enum": [
608
+ "deletion"
609
+ ]
610
+ },
611
+ "JobStatus": {
612
+ "type": "string",
613
+ "description": "Current execution status of a job run.\n- `in_progress` — the job is actively processing entities.\n- `success` — the job completed without critical errors.\n- `failed` — the job terminated due to an error.\n",
614
+ "enum": [
615
+ "in_progress",
616
+ "success",
617
+ "failed"
618
+ ]
619
+ },
620
+ "JobTrigger": {
621
+ "type": "string",
622
+ "description": "Indicates how the job was initiated.\n- `schedule` — automatically created by the background scheduler.\n- `manual` — explicitly triggered by a user via the API.\n",
623
+ "enum": [
624
+ "schedule",
625
+ "manual"
626
+ ]
627
+ },
628
+ "JobReportFormat": {
629
+ "type": "string",
630
+ "description": "File format of the job report. Currently only CSV is supported.",
631
+ "enum": [
632
+ "csv"
633
+ ]
634
+ },
635
+ "JobReport": {
636
+ "type": "object",
637
+ "description": "Reference to a report file stored in S3 that details the outcome of a\njob run (e.g., which entities were deleted or failed).\n",
638
+ "additionalProperties": false,
639
+ "properties": {
640
+ "bucket": {
641
+ "type": "string",
642
+ "description": "S3 bucket where the report file is stored."
643
+ },
644
+ "key": {
645
+ "type": "string",
646
+ "description": "S3 object key of the report file."
647
+ },
648
+ "format": {
649
+ "$ref": "#/components/schemas/JobReportFormat"
650
+ }
651
+ }
652
+ },
653
+ "CreateJobRequest": {
654
+ "type": "object",
655
+ "description": "Request payload for creating a new job run.",
656
+ "additionalProperties": false,
657
+ "required": [
658
+ "type",
659
+ "config_id",
660
+ "scheduled_for"
661
+ ],
662
+ "properties": {
663
+ "type": {
664
+ "$ref": "#/components/schemas/ConfigType"
665
+ },
666
+ "config_id": {
667
+ "type": "string",
668
+ "description": "ID of the data lifecycle config this job executes."
669
+ },
670
+ "scheduled_for": {
671
+ "type": "string",
672
+ "format": "date",
673
+ "description": "The date this job is scheduled to process (format `YYYY-MM-DD`)."
674
+ },
675
+ "status": {
676
+ "$ref": "#/components/schemas/JobStatus",
677
+ "default": "in_progress"
678
+ },
679
+ "started_at": {
680
+ "type": "string",
681
+ "format": "date-time",
682
+ "description": "ISO 8601 timestamp marking when execution began."
683
+ }
684
+ }
685
+ },
686
+ "JobDetails": {
687
+ "type": "object",
688
+ "description": "Type-specific job outcome payload. The shape depends on the config type.\nFor `deletion` jobs, typical fields include:\n- `matched_count` — total entities matched by the query\n- `deleted_count` — entities successfully deleted\n- `failed_count` — entities that could not be deleted\n",
689
+ "additionalProperties": true
690
+ },
691
+ "UpdateJobRequest": {
692
+ "type": "object",
693
+ "description": "Partial update payload for an existing job. Only the fields provided\nwill be merged into the job record.\n",
694
+ "additionalProperties": false,
695
+ "properties": {
696
+ "status": {
697
+ "$ref": "#/components/schemas/JobStatus"
698
+ },
699
+ "details": {
700
+ "$ref": "#/components/schemas/JobDetails"
701
+ },
702
+ "completed_at": {
703
+ "type": "string",
704
+ "format": "date-time",
705
+ "description": "ISO 8601 timestamp marking when the job finished."
706
+ },
707
+ "error": {
708
+ "type": "string",
709
+ "description": "Human-readable error message if the job failed."
710
+ },
711
+ "report": {
712
+ "$ref": "#/components/schemas/JobReport"
713
+ }
714
+ }
715
+ },
716
+ "Job": {
717
+ "type": "object",
718
+ "description": "Represents a single execution run of a data lifecycle config. Tracks the\nfull lifecycle from creation through completion, including outcome\ndetails and an optional downloadable report.\n",
719
+ "additionalProperties": false,
720
+ "required": [
721
+ "id",
722
+ "type",
723
+ "config_id",
724
+ "entity_schema",
725
+ "scheduled_for",
726
+ "status",
727
+ "created_at",
728
+ "last_updated_at"
729
+ ],
730
+ "properties": {
731
+ "id": {
732
+ "type": "string",
733
+ "description": "Unique identifier of the job."
734
+ },
735
+ "type": {
736
+ "$ref": "#/components/schemas/ConfigType"
737
+ },
738
+ "config_id": {
739
+ "type": "string",
740
+ "description": "ID of the data lifecycle config this job was created from."
741
+ },
742
+ "entity_schema": {
743
+ "type": "string",
744
+ "description": "Entity schema slug this job operates on."
745
+ },
746
+ "scheduled_for": {
747
+ "type": "string",
748
+ "format": "date",
749
+ "description": "The date this job was scheduled to process (`YYYY-MM-DD`)."
750
+ },
751
+ "status": {
752
+ "$ref": "#/components/schemas/JobStatus"
753
+ },
754
+ "details": {
755
+ "$ref": "#/components/schemas/JobDetails"
756
+ },
757
+ "started_at": {
758
+ "type": "string",
759
+ "format": "date-time",
760
+ "description": "ISO 8601 timestamp when execution started."
761
+ },
762
+ "completed_at": {
763
+ "type": "string",
764
+ "format": "date-time",
765
+ "description": "ISO 8601 timestamp when execution finished."
766
+ },
767
+ "error": {
768
+ "type": "string",
769
+ "description": "Error message if the job failed."
770
+ },
771
+ "report": {
772
+ "$ref": "#/components/schemas/JobReport"
773
+ },
774
+ "created_at": {
775
+ "type": "string",
776
+ "format": "date-time",
777
+ "description": "ISO 8601 timestamp when the job record was created."
778
+ },
779
+ "last_updated_at": {
780
+ "type": "string",
781
+ "format": "date-time",
782
+ "description": "ISO 8601 timestamp of the most recent update to this job."
783
+ },
784
+ "trigger": {
785
+ "$ref": "#/components/schemas/JobTrigger"
786
+ },
787
+ "triggered_by": {
788
+ "type": "string",
789
+ "nullable": true,
790
+ "description": "Identifier of the user who triggered the job. Set when\n`trigger` is `manual`; `null` for scheduled jobs.\n"
791
+ }
792
+ }
793
+ },
794
+ "ListJobsResponse": {
795
+ "type": "object",
796
+ "description": "Paginated response containing a list of job runs.",
797
+ "properties": {
798
+ "jobs": {
799
+ "type": "array",
800
+ "description": "Array of job records for the current page.",
801
+ "items": {
802
+ "$ref": "#/components/schemas/Job"
803
+ }
804
+ },
805
+ "cursor": {
806
+ "type": "string",
807
+ "nullable": true,
808
+ "description": "Opaque cursor for fetching the next page. `null` when there are\nno more results.\n"
809
+ }
810
+ }
811
+ },
812
+ "JobReportUrlResponse": {
813
+ "type": "object",
814
+ "description": "Contains a time-limited pre-signed URL to download a job report.",
815
+ "properties": {
816
+ "url": {
817
+ "type": "string",
818
+ "description": "Pre-signed S3 URL for downloading the report file."
819
+ },
820
+ "expires_in": {
821
+ "type": "integer",
822
+ "description": "Number of seconds until the pre-signed URL expires."
823
+ }
824
+ }
825
+ },
826
+ "QueryFilterType": {
827
+ "type": "string",
828
+ "description": "Predefined data governance filter types that can be layered on top of\na saved view to narrow down target entities:\n- `entity_workflows_only_in_closed_or_cancelled_status` — include only\n entities whose own workflows are all in a closed/cancelled state.\n- `no_related_entities` — include only entities with no related entities\n of the specified schemas.\n- `related_entities_all_in_closed_or_cancelled_status` — include only\n entities whose related entities are all closed or cancelled.\n- `related_entities_workflows_only_in_closed_or_cancelled_status` —\n include only entities whose related entities' workflows are all\n closed or cancelled.\n- `no_email_communication_since` — include only entities with no email\n communication (sent or received) within the lookback period.\n",
829
+ "enum": [
830
+ "entity_workflows_only_in_closed_or_cancelled_status",
831
+ "no_related_entities",
832
+ "related_entities_all_in_closed_or_cancelled_status",
833
+ "related_entities_workflows_only_in_closed_or_cancelled_status",
834
+ "no_email_communication_since"
835
+ ]
836
+ },
837
+ "QueryFilter": {
838
+ "type": "object",
839
+ "description": "A single governance filter condition applied during entity querying.\nThe required and optional fields depend on the `type`.\n",
840
+ "required": [
841
+ "type"
842
+ ],
843
+ "properties": {
844
+ "type": {
845
+ "$ref": "#/components/schemas/QueryFilterType"
846
+ },
847
+ "related_entity_schemas": {
848
+ "type": "array",
849
+ "description": "Entity schema slugs to consider when evaluating relationship-based\nfilters (e.g. `no_related_entities`).\n",
850
+ "items": {
851
+ "type": "string"
852
+ }
853
+ },
854
+ "lookback_period_days": {
855
+ "type": "integer",
856
+ "description": "Number of days to look back when evaluating time-based filters\nsuch as `no_email_communication_since`.\n"
857
+ },
858
+ "message_type": {
859
+ "type": "array",
860
+ "description": "Email message direction(s) to consider. Applicable to\n`no_email_communication_since`.\n",
861
+ "items": {
862
+ "type": "string",
863
+ "enum": [
864
+ "SENT",
865
+ "RECEIVED"
866
+ ]
867
+ }
868
+ },
869
+ "workflow_status": {
870
+ "type": "array",
871
+ "description": "Workflow statuses considered \"terminal\" for workflow-based filters.\n",
872
+ "items": {
873
+ "type": "string",
874
+ "enum": [
875
+ "CLOSED",
876
+ "DONE"
877
+ ]
878
+ }
879
+ }
880
+ }
881
+ },
882
+ "QueryConfig": {
883
+ "type": "object",
884
+ "description": "Defines the query used by a data lifecycle config to identify target\nentities. Combines a saved view with optional governance filters.\n",
885
+ "required": [
886
+ "saved_view_id"
887
+ ],
888
+ "properties": {
889
+ "saved_view_id": {
890
+ "type": "string",
891
+ "description": "ID of the saved view that provides the base entity query."
892
+ },
893
+ "include_deleted": {
894
+ "type": "string",
895
+ "description": "Controls whether soft-deleted entities are included:\n- `true` — include both active and deleted entities\n- `false` — exclude deleted entities (default)\n- `only` — return only deleted entities\n",
896
+ "enum": [
897
+ "true",
898
+ "false",
899
+ "only"
900
+ ]
901
+ },
902
+ "filters": {
903
+ "type": "array",
904
+ "description": "Additional data governance filters layered on top of the saved view\nto further narrow the set of matched entities.\n",
905
+ "items": {
906
+ "$ref": "#/components/schemas/QueryFilter"
907
+ }
908
+ }
909
+ }
910
+ },
911
+ "QueryEntitiesRequest": {
912
+ "description": "Request body for the query endpoint. Extends `QueryConfig` with\npagination and projection options.\n",
913
+ "allOf": [
914
+ {
915
+ "$ref": "#/components/schemas/QueryConfig"
916
+ },
917
+ {
918
+ "type": "object",
919
+ "properties": {
920
+ "from": {
921
+ "type": "integer",
922
+ "description": "Zero-based offset for pagination."
923
+ },
924
+ "size": {
925
+ "type": "integer",
926
+ "description": "Maximum number of results to return."
927
+ },
928
+ "hydrate": {
929
+ "type": "boolean",
930
+ "description": "When `true`, return full entity payloads. When `false` (default),\nreturn only entity IDs and minimal metadata.\n"
931
+ },
932
+ "fields": {
933
+ "type": "array",
934
+ "description": "List of entity attribute names to include in the response.\nActs as a projection to reduce payload size.\n",
935
+ "items": {
936
+ "type": "string"
937
+ }
938
+ }
939
+ }
940
+ }
941
+ ]
942
+ },
943
+ "QueryEntitiesResult": {
944
+ "type": "object",
945
+ "description": "Response from the entity query endpoint.",
946
+ "properties": {
947
+ "hits": {
948
+ "type": "number",
949
+ "description": "Total number of entities matching the query."
950
+ },
951
+ "results": {
952
+ "type": "array",
953
+ "description": "Array of matched entity objects. Shape depends on the `hydrate`\nand `fields` options in the request.\n",
954
+ "items": {
955
+ "type": "object",
956
+ "additionalProperties": true
957
+ }
958
+ }
959
+ }
960
+ },
961
+ "ConfigSchedule": {
962
+ "description": "Schedule definition controlling when a data lifecycle config runs.",
963
+ "$ref": "#/components/schemas/IntervalConfigSchedule"
964
+ },
965
+ "IntervalConfigSchedule": {
966
+ "type": "object",
967
+ "description": "Interval-based schedule. The governance engine will create a job every\n`interval_days` days, optionally bounded by start and end dates.\n",
968
+ "required": [
969
+ "frequency",
970
+ "interval_days"
971
+ ],
972
+ "properties": {
973
+ "frequency": {
974
+ "type": "string",
975
+ "description": "Schedule type. Currently only `interval` is supported.",
976
+ "enum": [
977
+ "interval"
978
+ ]
979
+ },
980
+ "interval_days": {
981
+ "type": "integer",
982
+ "minimum": 1,
983
+ "description": "Number of days between consecutive job runs."
984
+ },
985
+ "start_date": {
986
+ "type": "string",
987
+ "format": "date",
988
+ "description": "Earliest date (`YYYY-MM-DD`) the schedule is active. If omitted,\nthe schedule starts immediately.\n"
989
+ },
990
+ "end_date": {
991
+ "type": "string",
992
+ "format": "date",
993
+ "description": "Latest date (`YYYY-MM-DD`) the schedule is active. If omitted,\nthe schedule runs indefinitely.\n"
994
+ }
995
+ }
996
+ },
997
+ "UpsertConfigRequest": {
998
+ "type": "object",
999
+ "description": "Request payload for creating or updating a data lifecycle config.",
1000
+ "required": [
1001
+ "type",
1002
+ "query",
1003
+ "schedule"
1004
+ ],
1005
+ "properties": {
1006
+ "type": {
1007
+ "$ref": "#/components/schemas/ConfigType"
1008
+ },
1009
+ "query": {
1010
+ "$ref": "#/components/schemas/QueryConfig"
1011
+ },
1012
+ "schedule": {
1013
+ "$ref": "#/components/schemas/ConfigSchedule"
1014
+ },
1015
+ "relations_for_deletion": {
1016
+ "type": "array",
1017
+ "description": "Entity schemas whose related entities should also be deleted\nwhen the primary entity is removed. Only applicable when `type`\nis `deletion`.\n",
1018
+ "items": {
1019
+ "$ref": "#/components/schemas/DeletionRelationEntitySchema"
1020
+ }
1021
+ },
1022
+ "enabled": {
1023
+ "type": "boolean",
1024
+ "default": true,
1025
+ "description": "Whether this config is active and should be evaluated on schedule."
1026
+ }
1027
+ }
1028
+ },
1029
+ "Config": {
1030
+ "type": "object",
1031
+ "description": "A data lifecycle config defining an automated policy (e.g., scheduled\nentity deletion) for a specific entity schema.\n",
1032
+ "required": [
1033
+ "id",
1034
+ "entity_schema",
1035
+ "query",
1036
+ "type"
1037
+ ],
1038
+ "properties": {
1039
+ "id": {
1040
+ "type": "string",
1041
+ "description": "Unique identifier of the config."
1042
+ },
1043
+ "type": {
1044
+ "$ref": "#/components/schemas/ConfigType",
1045
+ "description": "Governance action type. Currently only `deletion` is supported."
1046
+ },
1047
+ "entity_schema": {
1048
+ "type": "string",
1049
+ "description": "Entity schema slug this config targets."
1050
+ },
1051
+ "query": {
1052
+ "$ref": "#/components/schemas/QueryConfig"
1053
+ },
1054
+ "schedule": {
1055
+ "$ref": "#/components/schemas/ConfigSchedule"
1056
+ },
1057
+ "enabled": {
1058
+ "type": "boolean",
1059
+ "description": "Whether this config is currently active."
1060
+ },
1061
+ "created_at": {
1062
+ "type": "string",
1063
+ "format": "date-time",
1064
+ "description": "ISO 8601 timestamp when the config was created."
1065
+ },
1066
+ "last_updated_at": {
1067
+ "type": "string",
1068
+ "format": "date-time",
1069
+ "description": "ISO 8601 timestamp of the most recent update."
1070
+ },
1071
+ "next_run_at": {
1072
+ "type": "string",
1073
+ "format": "date",
1074
+ "description": "Next scheduled run date (`YYYY-MM-DD`). Computed from the schedule\nafter each job run.\n"
1075
+ },
1076
+ "relations_for_deletion": {
1077
+ "type": "array",
1078
+ "description": "Related entity schemas whose entities will also be deleted\nalongside the primary entity.\n",
1079
+ "items": {
1080
+ "$ref": "#/components/schemas/DeletionRelationEntitySchema"
1081
+ }
1082
+ },
1083
+ "last_run_at": {
1084
+ "type": "string",
1085
+ "format": "date-time",
1086
+ "description": "ISO 8601 timestamp of the most recent job run."
1087
+ }
1088
+ }
1089
+ },
1090
+ "DeletionRelationEntitySchema": {
1091
+ "type": "string",
1092
+ "description": "Entity schema slug that can be specified as a cascading deletion\ntarget. When a primary entity is deleted, related entities of these\nschemas are also removed.\n",
1093
+ "enum": [
1094
+ "contact",
1095
+ "file",
1096
+ "opportunity",
1097
+ "order",
1098
+ "meter",
1099
+ "ticket",
1100
+ "message",
1101
+ "account",
1102
+ "submission",
1103
+ "contract"
1104
+ ]
1105
+ },
1106
+ "ListConfigsResponse": {
1107
+ "type": "object",
1108
+ "description": "Paginated response containing a list of data lifecycle configs.",
1109
+ "properties": {
1110
+ "configs": {
1111
+ "type": "array",
1112
+ "description": "Array of config records for the current page.",
1113
+ "items": {
1114
+ "$ref": "#/components/schemas/Config"
1115
+ }
1116
+ },
1117
+ "cursor": {
1118
+ "type": "string",
1119
+ "nullable": true,
1120
+ "description": "Opaque cursor for fetching the next page. `null` when there are\nno more results.\n"
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+ }
1126
+ }