openapi: 3.1.0 info: version: 1.0.0 title: Hatchet API Token Webhook API description: The Hatchet API servers: - url: '' security: - bearerAuth: [] - cookieAuth: [] tags: - name: Webhook paths: /api/v1/stable/tenants/{tenant}/webhooks: get: x-resources: - tenant description: Lists all webhook for a tenant. operationId: v1-webhook:list parameters: - description: The tenant id in: path name: tenant required: true schema: type: string format: uuid minLength: 36 maxLength: 36 - description: The number to skip in: query name: offset required: false schema: type: integer format: int64 - description: The number to limit by in: query name: limit required: false schema: type: integer format: int64 - description: The source names to filter by in: query name: sourceNames required: false schema: type: array items: $ref: '#/components/schemas/V1WebhookSourceName' description: The source name - description: The webhook names to filter by in: query name: webhookNames required: false schema: type: array items: type: string description: The webhook name responses: '200': content: application/json: schema: $ref: '#/components/schemas/V1WebhookList' description: Successfully listed the webhooks '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '403': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Forbidden summary: List Webhooks tags: - Webhook post: x-resources: - tenant description: Create a new webhook operationId: v1-webhook:create parameters: - description: The tenant id in: path name: tenant required: true schema: type: string format: uuid minLength: 36 maxLength: 36 requestBody: content: application/json: schema: $ref: '#/components/schemas/V1CreateWebhookRequest' description: The input to the webhook creation required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/V1Webhook' description: Successfully created the webhook '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '403': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Forbidden '404': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Not found summary: Create a Webhook tags: - Webhook /api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}: get: x-resources: - tenant - v1-webhook description: Get a webhook by its name operationId: v1-webhook:get x-enable-rate-limiting: true parameters: - description: The tenant id in: path name: tenant required: true schema: type: string format: uuid minLength: 36 maxLength: 36 - description: The webhook name in: path name: v1-webhook required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/V1Webhook' description: Successfully got the webhook '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '403': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Forbidden summary: Get a Webhook tags: - Webhook delete: x-resources: - tenant - v1-webhook description: Delete a webhook operationId: v1-webhook:delete parameters: - description: The tenant id in: path name: tenant required: true schema: type: string format: uuid minLength: 36 maxLength: 36 - description: The name of the webhook to delete in: path name: v1-webhook required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/V1Webhook' description: Successfully deleted webhook '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '403': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Forbidden '404': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Not found tags: - Webhook post: x-resources: - tenant - v1-webhook description: Post an incoming webhook message operationId: v1-webhook:receive security: [] parameters: - description: The tenant id in: path name: tenant required: true schema: type: string format: uuid minLength: 36 maxLength: 36 - description: The webhook name in: path name: v1-webhook required: true schema: type: string requestBody: description: Any payload in any format required: false content: null text/plain: schema: type: string responses: '200': description: Success with response payload content: application/json: schema: $ref: '#/components/schemas/V1WebhookResponse' '204': description: Success with no response payload '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '403': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Forbidden summary: Post a Webhook Message tags: - Webhook patch: x-resources: - tenant - v1-webhook description: Update a webhook operationId: v1-webhook:update parameters: - description: The tenant id in: path name: tenant required: true schema: type: string format: uuid minLength: 36 maxLength: 36 - description: The webhook name in: path name: v1-webhook required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/V1UpdateWebhookRequest' description: The input to the webhook creation required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/V1Webhook' description: Successfully updated the webhook '400': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: A malformed or bad request '403': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Forbidden '404': content: application/json: schema: $ref: '#/components/schemas/APIErrors' description: Not found summary: Update a Webhook tags: - Webhook components: schemas: V1WebhookAuthType: type: string enum: - BASIC - API_KEY - HMAC TenantEnvironment: enum: - local - development - production type: string V1CreateWebhookRequestBase: type: object properties: sourceName: $ref: '#/components/schemas/V1WebhookSourceName' description: The name of the source for this webhook name: type: string description: The name of the webhook eventKeyExpression: type: string description: The CEL expression to use for the event key. This is used to create the event key from the webhook payload. scopeExpression: type: string description: The CEL expression to use for the scope. This is used to filter the correct workflow to trigger. staticPayload: type: object description: The static payload to use for the webhook. This is used to send a static payload with the webhook. returnEventAsResponsePayload: type: boolean description: Whether to return the triggered event as the response payload when this webhook is triggered required: - name - sourceName - eventKeyExpression Tenant: properties: metadata: $ref: '#/components/schemas/APIResourceMeta' name: type: string description: The name of the tenant. slug: type: string description: The slug of the tenant. analyticsOptOut: type: boolean description: Whether the tenant has opted out of analytics. alertMemberEmails: type: boolean description: Whether to alert tenant members. version: $ref: '#/components/schemas/TenantVersion' description: The version of the tenant. environment: $ref: '#/components/schemas/TenantEnvironment' description: The environment type of the tenant. serverUrl: type: string description: The server URL for the tenant (includes scheme) region: type: string description: Control-plane shard region for the tenant (e.g. aws:us-west-2). required: - metadata - name - slug - version type: object APIResourceMeta: type: object properties: id: type: string description: the id of this resource, in UUID format example: bb214807-246e-43a5-a25d-41761d1cff9e minLength: 0 maxLength: 36 createdAt: type: string description: the time that this resource was created format: date-time example: '2022-12-13T15:06:48.888358-05:00' updatedAt: type: string description: the time that this resource was last updated format: date-time example: '2022-12-13T15:06:48.888358-05:00' required: - id - createdAt - updatedAt V1Webhook: properties: metadata: $ref: '#/components/schemas/APIResourceMeta' tenantId: type: string description: The ID of the tenant associated with this webhook. name: type: string description: The name of the webhook sourceName: $ref: '#/components/schemas/V1WebhookSourceName' description: The name of the source for this webhook eventKeyExpression: type: string description: The CEL expression to use for the event key. This is used to create the event key from the webhook payload. scopeExpression: type: string description: The CEL expression to use for the scope. This is used to filter the correct workflow to trigger. staticPayload: type: object description: The static payload to use for the webhook. This is used to send a static payload with the webhook. authType: $ref: '#/components/schemas/V1WebhookAuthType' description: The type of authentication to use for the webhook returnEventAsResponsePayload: type: boolean description: Whether to return the triggered event as the response payload when this webhook is triggered required: - metadata - tenantId - name - sourceName - eventKeyExpression - authType V1CreateWebhookRequestAPIKey: allOf: - $ref: '#/components/schemas/V1CreateWebhookRequestBase' - type: object properties: authType: type: string enum: - API_KEY description: The type of authentication to use for the webhook auth: $ref: '#/components/schemas/V1WebhookAPIKeyAuth' required: - authType - auth V1WebhookAPIKeyAuth: type: object properties: headerName: type: string description: The name of the header to use for the API key apiKey: type: string description: The API key to use for authentication required: - headerName - apiKey APIError: type: object properties: code: type: integer description: a custom Hatchet error code format: uint64 example: 1400 field: type: string description: the field that this error is associated with, if applicable example: name description: type: string description: a description for this error example: A descriptive error message docs_link: type: string description: a link to the documentation for this error, if it exists example: github.com/hatchet-dev/hatchet required: - description V1CreateWebhookRequestBasicAuth: allOf: - $ref: '#/components/schemas/V1CreateWebhookRequestBase' - type: object properties: authType: type: string enum: - BASIC description: The type of authentication to use for the webhook auth: $ref: '#/components/schemas/V1WebhookBasicAuth' required: - authType - auth PaginationResponse: type: object properties: current_page: type: integer description: the current page format: int64 example: 2 next_page: type: integer description: the next page format: int64 example: 3 num_pages: type: integer description: the total number of pages for listing format: int64 example: 10 example: next_page: 3 num_pages: 10 current_page: 2 V1WebhookSourceName: type: string enum: - GENERIC - GITHUB - STRIPE - SLACK - LINEAR - SVIX V1CreateWebhookRequestHMAC: allOf: - $ref: '#/components/schemas/V1CreateWebhookRequestBase' - type: object properties: authType: type: string enum: - HMAC description: The type of authentication to use for the webhook auth: $ref: '#/components/schemas/V1WebhookHMACAuth' required: - authType - auth V1WebhookHMACEncoding: type: string enum: - HEX - BASE64 - BASE64URL V1Event: properties: metadata: $ref: '#/components/schemas/APIResourceMeta' key: type: string description: The key for the event. tenant: $ref: '#/components/schemas/Tenant' description: The tenant associated with this event. tenantId: type: string description: The ID of the tenant associated with this event. workflowRunSummary: $ref: '#/components/schemas/V1EventWorkflowRunSummary' description: The workflow run summary for this event. additionalMetadata: type: object description: Additional metadata for the event. payload: type: object description: The payload of the event, which can be any JSON-serializable object. scope: type: string description: The scope of the event, which can be used to filter or categorize events. seenAt: type: string format: date-time description: The timestamp when the event was seen. triggeredRuns: description: The external IDs of the runs that were triggered by this event. type: array items: $ref: '#/components/schemas/V1EventTriggeredRun' triggeringWebhookName: type: string description: The name of the webhook that triggered this event, if applicable. required: - metadata - key - tenantId - workflowRunSummary V1WebhookHMACAuth: type: object properties: algorithm: $ref: '#/components/schemas/V1WebhookHMACAlgorithm' description: The HMAC algorithm to use for the webhook encoding: $ref: '#/components/schemas/V1WebhookHMACEncoding' description: The encoding to use for the HMAC signature signatureHeaderName: type: string description: The name of the header to use for the HMAC signature signingSecret: type: string description: The secret key used to sign the HMAC signature required: - algorithm - encoding - signatureHeaderName - signingSecret V1WebhookResponse: type: object properties: message: type: string description: The message for the webhook response event: $ref: '#/components/schemas/V1Event' challenge: type: string V1CreateWebhookRequest: oneOf: - $ref: '#/components/schemas/V1CreateWebhookRequestBasicAuth' - $ref: '#/components/schemas/V1CreateWebhookRequestAPIKey' - $ref: '#/components/schemas/V1CreateWebhookRequestHMAC' V1WebhookBasicAuth: type: object properties: username: type: string description: The username for basic auth password: type: string description: The password for basic auth required: - username - password V1WebhookList: type: object properties: pagination: $ref: '#/components/schemas/PaginationResponse' rows: type: array items: $ref: '#/components/schemas/V1Webhook' APIErrors: type: object properties: errors: type: array items: $ref: '#/components/schemas/APIError' required: - errors TenantVersion: enum: - V0 - V1 type: string V1EventWorkflowRunSummary: properties: running: type: integer format: int64 description: The number of running runs. queued: type: integer format: int64 description: The number of queued runs. succeeded: type: integer format: int64 description: The number of succeeded runs. failed: type: integer format: int64 description: The number of failed runs. cancelled: type: integer format: int64 description: The number of cancelled runs. required: - running - queued - succeeded - failed - cancelled V1EventTriggeredRun: type: object properties: workflowRunId: type: string format: uuid description: The external ID of the triggered run. minLength: 36 maxLength: 36 filterId: type: string format: uuid description: The ID of the filter that triggered the run, if applicable. required: - workflowRunId V1UpdateWebhookRequest: type: object properties: eventKeyExpression: type: string description: The CEL expression to use for the event key. This is used to create the event key from the webhook payload. scopeExpression: type: string description: The CEL expression to use for the scope. This is used to filter the correct workflow to trigger. staticPayload: type: object description: The static payload to use for the webhook. This is used to send a static payload with the webhook. returnEventAsResponsePayload: type: boolean description: Whether to return the triggered event as the response payload when this webhook is triggered V1WebhookHMACAlgorithm: type: string enum: - SHA1 - SHA256 - SHA512 - MD5 securitySchemes: bearerAuth: type: http scheme: bearer cookieAuth: type: apiKey in: cookie name: hatchet customAuth: type: http scheme: bearer