{"openapi":"3.1.0","info":{"title":"Capmo Webhook API","description":"Webhook API Documentation for Capmo","version":"1.0"},"tags":[],"webhooks":{"change_order.created":{"post":{"summary":"Event: change_order.created","description":"This webhook is triggered when a change order event 'change_order.created' occurs. Your endpoint will receive a POST request with the following payload structure.","operationId":"webhookChangeOrderCreated","tags":["Change Order Events"],"requestBody":{"description":"Payload delivered for the change_order.created event.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeOrdersWebhookPayloadEnvelope"},"examples":{"default":{"summary":"Example payload for change_order.created","description":"A sample payload demonstrating the structure for the change_order.created event.","value":{"id":"641cf6ef-dec9-4a23-9f22-62fbf8d91712","event":"change_order.created","data":{"id":"52623ce2-4f54-44cc-be07-aa70f4127226","projectId":"dffb2562-760b-49a2-a5a2-b1e275535f7d","workflowId":"0f0431e2-8381-4e48-960a-c0474aa71070","stepId":"96913fdd-369f-46a8-8dcb-788f8eaee0f0","stepName":"Change Order Example Step Name","name":"Change Order Example Name","key":10,"position":42,"createdAt":"2021-01-01T00:00:00.000Z","createdBy":"36ec93ec-80b1-4230-9796-6e112bdf8724","updatedAt":"2021-01-01T00:00:00.000Z","updatedBy":"36ec93ec-80b1-4230-9796-6e112bdf8724","deletedAt":null,"deletedBy":null,"orderNumber":"1234567890","reasonForChange":"Change Order Example Reason","projectCategories":["961ea4cc-ff4d-4647-bb1f-021859e15c70"],"changeOrderType":"VOBB_2_3","billOfQuantities":"12345","projectCompanies":["94b3441c-c3de-4d6f-9678-488d9ead91d1"],"probability":["medium"],"assignee":["cfc2a23c-cdc4-46e3-813c-0205a0ea8797"],"cost":67890,"description":"Change Order Example Description","isCompleted":false}}}}}}},"responses":{"200":{"description":"OK. REQUIRED acknowledgment response. Your endpoint MUST return an OK status code that is >= 200 and < 300, within 5 seconds to confirm successful receipt. Any response body will be ignored by Capmo."},"default":{"description":"Error processing webhook. Returning a >= 300 status (or timing out) indicates failure to process the webhook. Capmo may attempt retries based on its policy."}},"security":[{"WebhookSignature":[]}]}},"change_order.updated":{"post":{"summary":"Event: change_order.updated","description":"This webhook is triggered when a change order event 'change_order.updated' occurs. Your endpoint will receive a POST request with the following payload structure.\n\nchange_order.updated is triggered by the following fields changes:\n* stepId\n* name\n* key\n* position\n* orderNumber\n* reasonForChange\n* projectCategories\n* changeOrderType\n* billOfQuantities\n* projectCompanies\n* probability\n* assignee\n* cost\n* description\n* isCompleted\n","operationId":"webhookChangeOrderUpdated","tags":["Change Order Events"],"requestBody":{"description":"Payload delivered for the change_order.updated event.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeOrdersWebhookPayloadEnvelope"},"examples":{"default":{"summary":"Example payload for change_order.updated","description":"A sample payload demonstrating the structure for the change_order.updated event.","value":{"id":"641cf6ef-dec9-4a23-9f22-62fbf8d91712","event":"change_order.updated","data":{"id":"52623ce2-4f54-44cc-be07-aa70f4127226","projectId":"dffb2562-760b-49a2-a5a2-b1e275535f7d","workflowId":"0f0431e2-8381-4e48-960a-c0474aa71070","stepId":"96913fdd-369f-46a8-8dcb-788f8eaee0f0","stepName":"Change Order Example Step Name","name":"Change Order Example Name","key":10,"position":42,"createdAt":"2021-01-01T00:00:00.000Z","createdBy":"36ec93ec-80b1-4230-9796-6e112bdf8724","updatedAt":"2022-01-01T00:00:00.000Z","updatedBy":"f47d487c-d860-4175-bdea-05f234cc5bfa","deletedAt":null,"deletedBy":null,"orderNumber":"1234567890","reasonForChange":"Change Order Example Reason","projectCategories":["961ea4cc-ff4d-4647-bb1f-021859e15c70"],"changeOrderType":"VOBB_2_3","billOfQuantities":"12345","projectCompanies":["94b3441c-c3de-4d6f-9678-488d9ead91d1"],"probability":["medium"],"assignee":["cfc2a23c-cdc4-46e3-813c-0205a0ea8797"],"cost":67890,"description":"Change Order Example Description","isCompleted":false}}}}}}},"responses":{"200":{"description":"OK. REQUIRED acknowledgment response. Your endpoint MUST return an OK status code that is >= 200 and < 300, within 5 seconds to confirm successful receipt. Any response body will be ignored by Capmo."},"default":{"description":"Error processing webhook. Returning a >= 300 status (or timing out) indicates failure to process the webhook. Capmo may attempt retries based on its policy."}},"security":[{"WebhookSignature":[]}]}},"change_order.deleted":{"post":{"summary":"Event: change_order.deleted","description":"This webhook is triggered when a change order event 'change_order.deleted' occurs. Your endpoint will receive a POST request with the following payload structure.","operationId":"webhookChangeOrderDeleted","tags":["Change Order Events"],"requestBody":{"description":"Payload delivered for the change_order.deleted event.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeOrdersWebhookPayloadEnvelope"},"examples":{"default":{"summary":"Example payload for change_order.deleted","description":"A sample payload demonstrating the structure for the change_order.deleted event.","value":{"id":"641cf6ef-dec9-4a23-9f22-62fbf8d91712","event":"change_order.deleted","data":{"id":"52623ce2-4f54-44cc-be07-aa70f4127226","projectId":"dffb2562-760b-49a2-a5a2-b1e275535f7d","workflowId":"0f0431e2-8381-4e48-960a-c0474aa71070","stepId":"96913fdd-369f-46a8-8dcb-788f8eaee0f0","stepName":"Change Order Example Step Name","name":"Change Order Example Name","key":10,"position":42,"createdAt":"2021-01-01T00:00:00.000Z","createdBy":"36ec93ec-80b1-4230-9796-6e112bdf8724","updatedAt":"2022-01-01T00:00:00.000Z","updatedBy":"f47d487c-d860-4175-bdea-05f234cc5bfa","deletedAt":"2023-01-01T00:00:00.000Z","deletedBy":"36ec93ec-80b1-4230-9796-6e112bdf8724","orderNumber":"1234567890","reasonForChange":"Change Order Example Reason","projectCategories":["961ea4cc-ff4d-4647-bb1f-021859e15c70"],"changeOrderType":"VOBB_2_3","billOfQuantities":"12345","projectCompanies":["94b3441c-c3de-4d6f-9678-488d9ead91d1"],"probability":["medium"],"assignee":["cfc2a23c-cdc4-46e3-813c-0205a0ea8797"],"cost":67890,"description":"Change Order Example Description","isCompleted":false}}}}}}},"responses":{"200":{"description":"OK. REQUIRED acknowledgment response. Your endpoint MUST return an OK status code that is >= 200 and < 300, within 5 seconds to confirm successful receipt. Any response body will be ignored by Capmo."},"default":{"description":"Error processing webhook. Returning a >= 300 status (or timing out) indicates failure to process the webhook. Capmo may attempt retries based on its policy."}},"security":[{"WebhookSignature":[]}]}}},"components":{"schemas":{"ChangeOrdersWebhookPayloadEnvelope":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this specific webhook event delivery."},"event":{"type":"string","enum":["change_order.created","change_order.updated","change_order.deleted"],"description":"The name of the event that triggered this webhook."},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the Change Order entity."},"projectId":{"type":"string","format":"uuid","description":"Identifier of the project this Change Order belongs to."},"workflowId":{"type":"string","format":"uuid","description":"Identifier of the workflow this Change Order belongs to."},"stepId":{"type":"string","format":"uuid","description":"Identifier of the step this Change Order is currently in."},"stepName":{"type":"string","description":"Name of the change order step."},"name":{"type":"string","description":"Display name of the Change Order."},"key":{"type":"integer","description":"Unique key identifying the type or instance."},"position":{"type":"integer","description":"Positional order within its context (e.g., change order step)."},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the Change Order was created."},"createdBy":{"type":"string","format":"uuid","description":"Identifier of the user who created the Change Order."},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the Change Order was last updated."},"updatedBy":{"type":"string","format":"uuid","description":"Identifier of the user who last updated the Change Order."},"deletedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp when the Change Order was deleted (null if not deleted)."},"deletedBy":{"type":["string","null"],"format":"uuid","description":"Identifier of the user who deleted the Change Order (null if not deleted)."},"orderNumber":{"type":"string","description":"Specific order number."},"reasonForChange":{"type":"string","description":"Textual reason for the change."},"projectCategories":{"type":"array","items":{"type":"string","format":"uuid","description":"Standard UUID format."},"description":"Associated project category IDs."},"changeOrderType":{"type":"string","description":"Type classification of the Change Order."},"billOfQuantities":{"type":"string","description":"Reference to the Bill of Quantities."},"projectCompanies":{"type":"array","items":{"type":"string","format":"uuid","description":"Standard UUID format."},"description":"Associated companies IDs."},"probability":{"type":"array","items":{"type":"string"},"description":"Probability assessment."},"assignee":{"type":"array","items":{"type":"string","format":"uuid","description":"Standard UUID format."},"description":"Assigned users IDs."},"cost":{"type":"number","description":"Associated cost."},"description":{"type":"string","description":"Detailed description text."},"isCompleted":{"type":"boolean","description":"Flag indicating if the Change Order is marked as completed."}},"required":["id","projectId","workflowId","stepId","stepName","name","key","position","createdAt","createdBy","updatedAt","updatedBy","deletedAt","deletedBy","orderNumber","reasonForChange","projectCategories","changeOrderType","billOfQuantities","projectCompanies","probability","assignee","cost","description","isCompleted"],"additionalProperties":false,"description":"The payload specific to the event..."}},"required":["id","event","data"],"additionalProperties":false,"description":"Standard envelope structure for all webhook events."}},"securitySchemes":{"WebhookSignature":{"type":"apiKey","in":"header","name":"X-Capmo-Signature","description":"HMAC SHA256 signature calculated using the registered secret and the raw request body to verify authenticity. The value should be prefixed with `sha256=`."}}}}