Swagger docs for webhooks (#245)
This PR updates and adds to the swagger documentation for /webhooks endpointpull/9078/head
parent
e54e1aa72e
commit
ccf93190d7
|
@ -17,12 +17,16 @@ import { schemaQueryIdAsString } from "~/lib/validations/shared/queryIdString";
|
||||||
* type: integer
|
* type: integer
|
||||||
* required: true
|
* required: true
|
||||||
* description: Numeric ID of the hooks to delete
|
* description: Numeric ID of the hooks to delete
|
||||||
* security:
|
* - in: query
|
||||||
* - ApiKeyAuth: []
|
* name: apiKey
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* description: Your API key
|
||||||
* tags:
|
* tags:
|
||||||
* - hooks
|
* - webhooks
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
* url: https://docs.cal.com/hooks
|
* url: https://docs.cal.com/core-features/webhooks
|
||||||
* responses:
|
* responses:
|
||||||
* 201:
|
* 201:
|
||||||
* description: OK, hook removed successfully
|
* description: OK, hook removed successfully
|
||||||
|
|
|
@ -18,12 +18,16 @@ import { schemaWebhookReadPublic } from "~/lib/validations/webhook";
|
||||||
* type: integer
|
* type: integer
|
||||||
* required: true
|
* required: true
|
||||||
* description: Numeric ID of the webhook to get
|
* description: Numeric ID of the webhook to get
|
||||||
* security:
|
* - in: query
|
||||||
* - ApiKeyAuth: []
|
* name: apiKey
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* description: Your API key
|
||||||
* tags:
|
* tags:
|
||||||
* - hooks
|
* - webhooks
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
* url: https://docs.cal.com/hooks
|
* url: https://docs.cal.com/core-features/webhooks
|
||||||
* responses:
|
* responses:
|
||||||
* 200:
|
* 200:
|
||||||
* description: OK
|
* description: OK
|
||||||
|
|
|
@ -20,12 +20,41 @@ import { schemaWebhookEditBodyParams, schemaWebhookReadPublic } from "~/lib/vali
|
||||||
* type: integer
|
* type: integer
|
||||||
* required: true
|
* required: true
|
||||||
* description: Numeric ID of the webhook to edit
|
* description: Numeric ID of the webhook to edit
|
||||||
* security:
|
* - in: query
|
||||||
* - ApiKeyAuth: []
|
* name: apiKey
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* description: Your API key
|
||||||
|
* requestBody:
|
||||||
|
* description: Edit an existing webhook
|
||||||
|
* required: true
|
||||||
|
* content:
|
||||||
|
* application/json:
|
||||||
|
* schema:
|
||||||
|
* type: object
|
||||||
|
* properties:
|
||||||
|
* subscriberUrl:
|
||||||
|
* type: string
|
||||||
|
* format: uri
|
||||||
|
* description: The URL to subscribe to this webhook
|
||||||
|
* eventTriggers:
|
||||||
|
* type: string
|
||||||
|
* enum: [BOOKING_CREATED, BOOKING_RESCHEDULED, BOOKING_CANCELLED, MEETING_ENDED]
|
||||||
|
* description: The events which should trigger this webhook call
|
||||||
|
* active:
|
||||||
|
* type: boolean
|
||||||
|
* description: Whether the webhook is active and should trigger on associated trigger events
|
||||||
|
* payloadTemplate:
|
||||||
|
* type: string
|
||||||
|
* description: The template of the webhook's payload
|
||||||
|
* eventTypeId:
|
||||||
|
* type: number
|
||||||
|
* description: The event type ID if this webhook should be associated with only that event type
|
||||||
* tags:
|
* tags:
|
||||||
* - hooks
|
* - webhooks
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
* url: https://docs.cal.com/hooks
|
* url: https://docs.cal.com/core-features/webhooks
|
||||||
* responses:
|
* responses:
|
||||||
* 201:
|
* 201:
|
||||||
* description: OK, webhook edited successfully
|
* description: OK, webhook edited successfully
|
||||||
|
|
|
@ -13,10 +13,17 @@ import { schemaWebhookReadPublic } from "~/lib/validations/webhook";
|
||||||
* get:
|
* get:
|
||||||
* summary: Find all webhooks
|
* summary: Find all webhooks
|
||||||
* operationId: listWebhooks
|
* operationId: listWebhooks
|
||||||
|
* parameters:
|
||||||
|
* - in: query
|
||||||
|
* name: apiKey
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* description: Your API key
|
||||||
* tags:
|
* tags:
|
||||||
* - hooks
|
* - webhooks
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
* url: https://docs.cal.com/webhooks
|
* url: https://docs.cal.com/core-features/webhooks
|
||||||
* responses:
|
* responses:
|
||||||
* 200:
|
* 200:
|
||||||
* description: OK
|
* description: OK
|
||||||
|
|
|
@ -9,14 +9,50 @@ import { schemaWebhookCreateBodyParams, schemaWebhookReadPublic } from "~/lib/va
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @swagger
|
* @swagger
|
||||||
* /hooks:
|
* /webhooks:
|
||||||
* post:
|
* post:
|
||||||
* summary: Creates a new webhook
|
* summary: Creates a new webhook
|
||||||
* operationId: addWebhook
|
* operationId: addWebhook
|
||||||
|
* parameters:
|
||||||
|
* - in: query
|
||||||
|
* name: apiKey
|
||||||
|
* required: true
|
||||||
|
* schema:
|
||||||
|
* type: string
|
||||||
|
* description: Your API key
|
||||||
|
* requestBody:
|
||||||
|
* description: Create a new webhook
|
||||||
|
* required: true
|
||||||
|
* content:
|
||||||
|
* application/json:
|
||||||
|
* schema:
|
||||||
|
* type: object
|
||||||
|
* required:
|
||||||
|
* - subscriberUrl
|
||||||
|
* - eventTriggers
|
||||||
|
* - active
|
||||||
|
* properties:
|
||||||
|
* subscriberUrl:
|
||||||
|
* type: string
|
||||||
|
* format: uri
|
||||||
|
* description: The URL to subscribe to this webhook
|
||||||
|
* eventTriggers:
|
||||||
|
* type: string
|
||||||
|
* enum: [BOOKING_CREATED, BOOKING_RESCHEDULED, BOOKING_CANCELLED, MEETING_ENDED]
|
||||||
|
* description: The events which should trigger this webhook call
|
||||||
|
* active:
|
||||||
|
* type: boolean
|
||||||
|
* description: Whether the webhook is active and should trigger on associated trigger events
|
||||||
|
* payloadTemplate:
|
||||||
|
* type: string
|
||||||
|
* description: The template of the webhook's payload
|
||||||
|
* eventTypeId:
|
||||||
|
* type: number
|
||||||
|
* description: The event type ID if this webhook should be associated with only that event type
|
||||||
* tags:
|
* tags:
|
||||||
* - webhooks
|
* - webhooks
|
||||||
* externalDocs:
|
* externalDocs:
|
||||||
* url: https://docs.cal.com/webhooks
|
* url: https://docs.cal.com/core-features/webhooks
|
||||||
* responses:
|
* responses:
|
||||||
* 201:
|
* 201:
|
||||||
* description: OK, webhook created
|
* description: OK, webhook created
|
||||||
|
|
Loading…
Reference in New Issue