openapi: 3.0.1 info: title: WorkSpan Events API description: 'Subscribe to events ' version: '1.0' servers: - url: https://api-sandbox.workspan.com/event/v1 paths: '/metadata/event/{event}': get: tags: - metadata.event summary: Get schema of event description: Get schema of event operationId: GetEventSchema parameters: - name: event in: path description: Name of event required: true schema: type: string - name: x-ws-env in: header description: Use only for WorkSpan Sandbox Environment schema: type: string responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/MetadataEventEventGet200ApplicationJsonResponse' '400': description: API Error content: application/json: { } '404': description: event not defined content: application/json: { } /metadata/event: get: tags: - metadata.events summary: Get list of events description: Get list of events operationId: GetEventList responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/event_list_resp' example: events: - name: string description: string '400': description: API Error content: application/json: { } '404': description: event not defined content: application/json: { } /metadata/integration: get: tags: - metadata.integration summary: Get list of integrations description: Get list of integrations operationId: GetIntegrationList responses: '200': description: Successful in listing integrations content: application/json: schema: $ref: '#/components/schemas/MetadataIntegrationGet200ApplicationJsonResponse' example: integrations: - integration_id: string integration_type: string description: string name: string '400': description: API Error content: application/json: { } '404': description: integration not defined content: application/json: { } '/metadata/integration/{integration_id}': get: tags: - metadata.integration summary: Get schema of object event description: Get schema of object event operationId: GetObjectEventSchema parameters: - name: integration_id in: path description: Integration Id of Object Event Integration required: true schema: type: string responses: '200': description: Returns Integration Schema content: application/json: schema: $ref: '#/components/schemas/MetadataIntegrationIntegration_idGet200ApplicationJsonResponse' '400': description: API Error content: application/json: { } '404': description: integration not defined content: application/json: { } /subscriber: get: tags: - subscriber summary: List subscribers description: List Subscribers operationId: ListSubscribers responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/SubscriberGet200ApplicationJsonResponse' example: items: - subscriber_id: string name: string objectids: - string integration_id: string filters: string subscriber_type: webhook '400': description: API Error content: application/json: { } '404': description: Subscriber not found content: application/json: { } post: tags: - subscriber summary: 'Webhook: subscribe to object update notification' description: 'Webhook registration: Subscribe to object update notification' operationId: WebhookRegistration requestBody: description: Webhook registration request content: application/json: schema: $ref: '#/components/schemas/Subscribe_body' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/subscribe_resp' example: subscriber_id: string '400': description: Error when subscribing to event via webhook content: application/json: { } '/subscriber/{subscriber_id}': get: tags: - subscriber summary: Read subscriber information description: Read details of subscription operationId: ReadSubscriber parameters: - name: subscriber_id in: path description: subscriber id assigened by WorkSpan required: true schema: type: string responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/subscriber_info' example: subscriber_id: string name: string objectids: - string integration_id: string filters: string subscriber_type: webhook '400': description: API Error content: application/json: { } '404': description: Subscriber not found content: application/json: { } delete: tags: - subscriber summary: Delete a subscriber (unregister a webhook) description: Delete a subscriber (unregister a webhook) operationId: DeleteSubscriber parameters: - name: subscriber_id in: path description: ID of the subscriber that needs to be deleted required: true schema: type: string responses: '200': description: successful operation content: application/json: { } '400': description: Invalid ID supplied content: application/json: { } '404': description: subscriber not found content: application/json: { } components: schemas: event_list_resp: type: object properties: events: type: array items: properties: name: type: string description: event name description: type: string description: description of event description: List of Events event_payload: type: object properties: schema: description: schema of event payload in OpenApi 2.0 format description: Payload of event - schema is fetched dynamically field: type: string eventfilter: type: string wsobject_event_payload: type: object additionalProperties: $ref: '#/components/schemas/field' description: Payload of event - schema is fetched dynamically subscribe_resp: type: object properties: subscriber_id: type: string description: subscriber_id subscriber_info: type: object properties: subscriber_id: type: string description: subscriber_id name: type: string description: Name assigned to the webhook objectids: type: array items: type: string description: Object ids for which webhook is registered integration_id: type: string description: Integration id for which webhook is registered filters: type: string description: Filters for events subscriber_type: type: string description: Should be 'webhook' for webhook default: webhook MetadataEventEventGet200ApplicationJsonResponse: type: object MetadataIntegrationGet200ApplicationJsonResponse: type: object properties: integrations: type: array items: type: object properties: integration_id: type: string integration_type: type: string description: type: string name: type: string MetadataIntegrationIntegration_idGet200ApplicationJsonResponse: type: object Subscribe_body: required: - event - name - subscriber_type - webhook_settings type: object properties: subscriber_type: type: string description: Should be 'webhook' for webhook default: webhook event: type: array items: type: string name: type: string description: Name of event subscriber filters: type: string description: "Filters for events Filter example:\n (stage in [ 'closed', 'won', 'lost' ]) AND (sales_details.partner = 'P1')" integration_id: type: string object_ids: type: array items: type: string webhook_settings: required: - callback_url type: object properties: callback_url: title: Callback URL of Webhook type: string description: Callback URL SubscriberGet200ApplicationJsonResponse: type: object properties: items: type: array items: $ref: '#/components/schemas/subscriber_info' tags: - name: subscriber description: Event subscriber operations - name: metadata.event description: Metadata of Event Notifications - name: metadata.integration description: Metadata of Object Events