openapi: 3.0.3 info: title: WebhookX Admin API contact: name: WebhookX url: https://github.com/webhookx-io/webhookx license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html version: 1.1.0 servers: - url: http://localhost:9601 paths: /: get: summary: Get WebhookX information responses: "200": description: OK content: application/json: schema: type: object properties: version: type: string message: type: string configuration: type: object example: version: 1.0.0 message: "Welcome to WebhookX" configuration: { } /license: get: summary: Get current license information responses: "200": description: OK content: application/json: schema: type: object properties: id: type: string plan: type: string customer: type: string expired_at: type: string created_at: type: string version: type: string signature: type: string example: { "id": "00000000-0000-0000-0000-000000000000", "plan": "free", "customer": "anonymous", "expired_at": "2099-12-31T23:59:59Z", "created_at": "1996-08-24T00:00:00Z", "version": "1", "signature": "" } /workspaces: get: parameters: - $ref: "#/components/parameters/page_no" - $ref: "#/components/parameters/page_size" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/sort" - $ref: "#/components/parameters/after" - $ref: "#/components/parameters/before" - $ref: "#/components/parameters/name" - $ref: "#/components/parameters/created_at" - $ref: "#/components/parameters/metadata" summary: List workspaces tags: - Workspace responses: "200": description: OK content: application/json: schema: oneOf: - allOf: - $ref: "#/components/schemas/OffsetPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Workspace" - allOf: - $ref: "#/components/schemas/CursorPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Workspace" post: summary: Create a workspace tags: - Workspace requestBody: content: application/json: schema: $ref: "#/components/schemas/Workspace" responses: "201": description: OK content: application/json: schema: $ref: "#/components/schemas/Workspace" /workspaces/{id}: get: summary: Retrieve a workspace tags: - Workspace parameters: - in: path name: id required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Workspace" put: summary: Update a workspace tags: - Workspace parameters: - in: path name: id required: true schema: type: string requestBody: content: application/json: schema: $ref: "#/components/schemas/Workspace" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Workspace" delete: summary: Delete a workspace tags: - Workspace parameters: - in: path name: id required: true schema: type: string responses: "204": description: Deleted /workspaces/{ws_id}/endpoints: parameters: - $ref: "#/components/parameters/workspace_id" get: parameters: - $ref: "#/components/parameters/page_no" - $ref: "#/components/parameters/page_size" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/sort" - $ref: "#/components/parameters/after" - $ref: "#/components/parameters/before" - $ref: "#/components/parameters/name" - $ref: "#/components/parameters/enabled" - $ref: "#/components/parameters/created_at" - $ref: "#/components/parameters/metadata" summary: List endpoints tags: - Endpoint responses: "200": description: OK content: application/json: schema: oneOf: - allOf: - $ref: "#/components/schemas/OffsetPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Endpoint" - allOf: - $ref: "#/components/schemas/CursorPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Endpoint" post: tags: - Endpoint summary: Create a endpoint requestBody: content: application/json: schema: $ref: "#/components/schemas/Endpoint" responses: "201": description: OK content: application/json: schema: $ref: "#/components/schemas/Endpoint" /workspaces/{ws_id}/endpoints/{id}: parameters: - $ref: "#/components/parameters/workspace_id" get: summary: Retrieve a endpoint tags: - Endpoint parameters: - in: path name: id required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Endpoint" put: summary: Update a endpoint tags: - Endpoint parameters: - in: path name: id required: true schema: type: string requestBody: content: application/json: schema: $ref: "#/components/schemas/Endpoint" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Endpoint" delete: summary: Delete a endpoint tags: - Endpoint parameters: - in: path name: id required: true schema: type: string responses: "204": description: Deleted /workspaces/{ws_id}/attempts: parameters: - $ref: "#/components/parameters/workspace_id" get: parameters: - $ref: "#/components/parameters/page_no" - $ref: "#/components/parameters/page_size" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/sort" - $ref: "#/components/parameters/after" - $ref: "#/components/parameters/before" - $ref: "#/components/parameters/created_at" - description: "event_id filter" in: query name: event_id schema: type: string - description: "endpoint_id filter" in: query name: endpoint_id schema: type: string - description: "status filter" in: query name: status schema: type: string - description: "attempted_at filter (unix time in milliseconds)." in: query name: attempted_at explode: true style: deepObject schema: anyOf: - type: object properties: gt: type: integer format: int64 gte: type: integer format: int64 lt: type: integer format: int64 lte: type: integer format: int64 - type: integer format: int64 summary: List webhook attempts tags: - Attempt responses: "200": description: OK content: application/json: schema: oneOf: - allOf: - $ref: "#/components/schemas/OffsetPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Attempt" - allOf: - $ref: "#/components/schemas/CursorPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Attempt" /workspaces/{ws_id}/attempts/{id}: parameters: - $ref: "#/components/parameters/workspace_id" get: summary: Retrieve a webhook attempt tags: - Attempt parameters: - in: path name: id required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Attempt" /workspaces/{ws_id}/events: parameters: - $ref: "#/components/parameters/workspace_id" get: parameters: - $ref: "#/components/parameters/page_no" - $ref: "#/components/parameters/page_size" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/sort" - $ref: "#/components/parameters/after" - $ref: "#/components/parameters/before" - $ref: "#/components/parameters/created_at" - description: "event_type filter" in: query name: event_type schema: type: string - description: "unique_id filter" in: query name: unique_id schema: type: string - description: "ingested_at filter (unix time in milliseconds)." in: query name: ingested_at explode: true style: deepObject schema: anyOf: - type: object properties: gt: type: integer format: int64 gte: type: integer format: int64 lt: type: integer format: int64 lte: type: integer format: int64 - type: integer format: int64 summary: List events tags: - Event responses: "200": description: OK content: application/json: schema: oneOf: - allOf: - $ref: "#/components/schemas/OffsetPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Event" - allOf: - $ref: "#/components/schemas/CursorPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Event" post: summary: Create an event tags: - Event requestBody: content: application/json: schema: $ref: "#/components/schemas/Event" responses: "201": description: OK content: application/json: schema: $ref: "#/components/schemas/Event" /workspaces/{ws_id}/events/{id}: parameters: - $ref: "#/components/parameters/workspace_id" get: summary: Retrieve an event tags: - Event parameters: - in: path name: id required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Event" /workspaces/{ws_id}/events/{id}/retry: parameters: - $ref: "#/components/parameters/workspace_id" post: summary: Manually retry an event tags: - Event parameters: - in: path name: id required: true schema: type: string - in: query name: endpoint_id required: true schema: type: string responses: "200": description: OK /workspaces/{ws_id}/sources: parameters: - $ref: "#/components/parameters/workspace_id" get: parameters: - $ref: "#/components/parameters/page_no" - $ref: "#/components/parameters/page_size" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/sort" - $ref: "#/components/parameters/after" - $ref: "#/components/parameters/before" - $ref: "#/components/parameters/name" - $ref: "#/components/parameters/enabled" - $ref: "#/components/parameters/created_at" - $ref: "#/components/parameters/metadata" summary: List sources tags: - Source responses: "200": description: OK content: application/json: schema: oneOf: - allOf: - $ref: "#/components/schemas/OffsetPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Source" - allOf: - $ref: "#/components/schemas/CursorPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Source" post: summary: Create a source tags: - Source requestBody: content: application/json: schema: $ref: "#/components/schemas/Source" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Source" /workspaces/{ws_id}/sources/{id}: parameters: - $ref: "#/components/parameters/workspace_id" get: summary: Retrieve a source tags: - Source parameters: - in: path name: id required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Source" put: summary: Update a source tags: - Source parameters: - in: path name: id required: true schema: type: string requestBody: content: application/json: schema: $ref: "#/components/schemas/Source" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Source" delete: summary: Delete a source tags: - Source parameters: - in: path name: id required: true schema: type: string responses: "204": description: Deleted /workspaces/{ws_id}/plugins: parameters: - $ref: "#/components/parameters/workspace_id" get: parameters: - $ref: "#/components/parameters/page_no" - $ref: "#/components/parameters/page_size" - $ref: "#/components/parameters/limit" - $ref: "#/components/parameters/sort" - $ref: "#/components/parameters/after" - $ref: "#/components/parameters/before" - $ref: "#/components/parameters/name" - $ref: "#/components/parameters/enabled" - $ref: "#/components/parameters/created_at" - $ref: "#/components/parameters/metadata" - description: "endpoint_id filter" in: query name: endpoint_id schema: type: string - description: "source_id filter" in: query name: source_id schema: type: string summary: List plugins tags: - Plugin responses: "200": description: OK content: application/json: schema: oneOf: - allOf: - $ref: "#/components/schemas/OffsetPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Plugin" - allOf: - $ref: "#/components/schemas/CursorPagination" - type: object properties: data: type: array items: $ref: "#/components/schemas/Plugin" post: summary: Create a plugin tags: - Plugin requestBody: content: application/json: schema: $ref: "#/components/schemas/Plugin" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Plugin" /workspaces/{ws_id}/plugins/{id}: parameters: - $ref: "#/components/parameters/workspace_id" get: summary: Retrieve a plugin tags: - Plugin parameters: - in: path name: id required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Plugin" put: summary: Update a plugin tags: - Plugin parameters: - in: path name: id required: true schema: type: string requestBody: content: application/json: schema: $ref: "#/components/schemas/Plugin" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/Plugin" delete: summary: Delete a plugin tags: - Plugin parameters: - in: path name: id required: true schema: type: string responses: "204": description: Deleted /workspaces/{ws_id}/config/sync: post: parameters: - $ref: "#/components/parameters/workspace_id" summary: Sync declarative configuration tags: - Declarative requestBody: content: application/json: schema: $ref: "#/components/schemas/Configuration" application/x-yaml: schema: $ref: "#/components/schemas/Configuration" responses: "200": description: OK /workspaces/{ws_id}/config/dump: post: parameters: - $ref: "#/components/parameters/workspace_id" summary: Dump declarative configuration tags: - Declarative responses: "200": description: OK content: text/plain: schema: type: string /debug/pprof/: get: summary: Responds the pprof html page listing the available profiles tags: - Debug responses: "200": description: OK content: text/html: schema: type: string /debug/pprof/{profile}: get: summary: Responds a specific pprof profile tags: - Debug parameters: - in: path name: profile required: true schema: type: string enum: [ allocs, block, goroutine, heap, mutex, threadcreate, cmdline, symbol, profile, trace ] responses: "200": description: OK components: parameters: workspace_id: in: path name: ws_id required: true schema: type: string example: "default" description: The workspace id page_no: deprecated: true in: query name: page_no schema: type: integer default: 1 minimum: 1 page_size: deprecated: true in: query name: page_size schema: type: integer default: 20 maximum: 1000 minimum: 1 limit: description: "A limit on the number of objects to be returned. Limit can range between 1 and 1000, and the default is 20." in: query name: limit schema: type: integer default: 20 maximum: 1000 minimum: 1 sort: description: "Only id.asc and id.desc are supported." in: query name: sort schema: type: string enum: [ "id.desc", "id.asc" ] default: "id.desc" after: description: "A cursor for use in pagination." in: query name: after schema: type: string before: description: "A cursor for use in pagination." in: query name: before schema: type: string metadata: description: "" in: query name: metadata explode: true style: deepObject schema: type: object additionalProperties: type: string example: key: value name: description: "name filter" in: query name: name schema: type: string enabled: description: "enabled filter" in: query name: enabled schema: type: boolean created_at: description: "created_at filter (unix time in milliseconds)." in: query name: created_at explode: true style: deepObject schema: anyOf: - type: object properties: gt: type: integer format: int64 gte: type: integer format: int64 lt: type: integer format: int64 lte: type: integer format: int64 - type: integer format: int64 responses: NotFound: description: The resource was not found NotContent: description: The resource has been successfully deleted or the resource didn't exist schemas: OffsetPagination: type: object properties: total: description: Total number of resources. type: integer example: 1 data: description: List of resources type: array items: type: object CursorPagination: type: object properties: next: description: URI to next page when available. type: string nullable: true prev: description: URI to previous page when available. type: string nullable: true data: description: List of resources type: array items: type: object Metadata: type: object additionalProperties: type: string default: { } Workspace: type: object properties: id: type: string name: type: string nullable: true description: type: string nullable: true metadata: $ref: "#/components/schemas/Metadata" created_at: type: integer readOnly: true updated_at: type: integer readOnly: true Endpoint: type: object properties: id: type: string name: type: string nullable: true description: type: string nullable: true enabled: type: boolean default: true request: type: object default: method: POST headers: null timeout: 10000 properties: url: type: string minLength: 1 example: https://example.com method: type: string enum: [ GET, POST, PUT, DELETE, PATCH ] default: "POST" headers: type: object nullable: true additionalProperties: type: string default: null timeout: type: integer minimum: 0 maximum: 60000 default: 10000 required: - url retry: type: object default: strategy: fixed config: attempts: [ 0, 60, 3600 ] properties: strategy: type: string enum: [ fixed ] default: fixed config: type: object default: attempts: [ 0, 60, 3600 ] properties: attempts: type: array minItems: 1 items: type: integer minimum: 0 default: [ 0, 60, 3600 ] events: type: array items: type: string example: foo.bar default: [ ] metadata: $ref: "#/components/schemas/Metadata" rate_limit: $ref: "#/components/schemas/RateLimit" created_at: type: integer readOnly: true updated_at: type: integer readOnly: true Attempt: type: object properties: id: type: string event_id: type: string endpoint_id: type: string status: type: string enum: [ INIT, QUEUED, SUCCESSFUL, FAILED, CANCELED ] attempt_number: type: integer scheduled_at: type: integer attempted_at: type: integer nullable: true trigger_mode: type: string enum: [ INITIAL, MANUAL, AUTOMATIC ] exhausted: type: boolean error_code: type: string nullable: true enum: [ TIMEOUT, UNKNOWN, ENDPOINT_DISABLED, ENDPOINT_NOT_FOUND ] request: type: object nullable: true properties: method: type: string url: type: string headers: type: object nullable: true body: type: string nullable: true response: type: object nullable: true properties: status: type: number latency: type: integer description: "Latancy of response in milliseconds" headers: type: object nullable: true body: type: string nullable: true created_at: type: integer readOnly: true updated_at: type: integer readOnly: true Event: type: object properties: id: type: string event_type: type: string data: type: object ingested_at: type: integer description: "The time the event was ingested" unique_id: type: string nullable: true maxLength: 50 description: "The unique id used to de-duplication" created_at: type: integer readOnly: true updated_at: type: integer readOnly: true required: - event_type - data Source: type: object properties: id: type: string name: type: string nullable: true enabled: type: boolean default: true type: type: string enum: [ "http" ] default: http config: type: object properties: http: $ref: "#/components/schemas/HTTPSourceConfig" required: - http async: type: boolean description: "Whether to ingest events asynchronously through the queue" default: false metadata: $ref: "#/components/schemas/Metadata" rate_limit: $ref: "#/components/schemas/RateLimit" created_at: type: integer readOnly: true updated_at: type: integer readOnly: true required: - config Plugin: type: object properties: id: type: string name: type: string enabled: type: boolean default: true endpoint_id: type: string nullable: true source_id: type: string nullable: true config: type: object default: { } metadata: $ref: "#/components/schemas/Metadata" created_at: type: integer readOnly: true updated_at: type: integer readOnly: true Configuration: type: object properties: endpoints: type: array items: allOf: - $ref: "#/components/schemas/Endpoint" - type: object properties: plugins: type: array items: $ref: "#/components/schemas/Plugin" sources: type: array items: allOf: - $ref: "#/components/schemas/Source" - type: object properties: plugins: type: array items: $ref: "#/components/schemas/Plugin" RateLimit: type: object nullable: true description: The rate limit that uses GCRA algorithm (a variant of the leaky bucket algorithm that supports bursts). properties: quota: type: integer minimum: 0 description: Rate limiting quota that allowed in every period. period: type: integer minimum: 1 description: Rate limiting period in seconds. required: - quota - period WasmPluginConfiguration: description: "The wasm plugin configuration" type: object properties: file: description: "The file path to the wasm file." type: string envs: description: "Environments that can be used in wasm." type: object additionalProperties: type: string default: { } required: - file FunctionPluginConfiguration: description: "The function plugin configuration" type: object properties: function: description: "The function content." type: string maxLength: 1048576 required: - function WebhookxSignaturePluginConfiguration: description: "The webhookx-signature plugin configuration" type: object properties: signing_secret: description: "The signature secret." type: string minLength: 1 EventValidationPluginConfiguration: description: "The event-validation plugin configuration" type: object properties: version: description: "The JSON Schema version used to validate request payloads." type: string enum: - "draft-04" - "draft-06" - "draft-07" - "draft-2019-09" - "draft-2020-12" - "openapi-3.0" verbose_response: description: "Whether to include the detailed validation error in the response." type: boolean default: false schemas: description: "A map to define event's JSON Schema." type: object additionalProperties: type: string description: "JSON Schema definition." format: json maxLength: 1048576 default: { } example: foo.bar: '{"type": "object"}' default_schema: description: "The default schema is used when the event type does not exist in the schemas. Setting to null will skip validation when the event's schema is not found." type: string format: json maxLength: 1048576 nullable: true required: - version - verbose_response - schemas BasicAuthPluginConfiguration: description: "The basic auth plugin configuration" type: object properties: username: description: "The username used for Basic Authentication" type: string password: description: "The password used for Basic Authentication" type: string required: - username - password KeyAuthPluginConfiguration: description: "The key-auth plugin configuration" type: object properties: param_name: description: "The parameter name of api key." type: string minLength: 1 param_locations: description: "The locations where the api key can be provided." type: array uniqueItems: true minItems: 1 items: type: string enum: [ "header", "query" ] key: description: "The api key used for authentication" type: string minLength: 1 required: - param_name - param_locations - key HmacAuthPluginConfiguration: description: "The hmac-auth plugin configuration" type: object properties: hash: description: "The hash algorithm used to generate the HMAC signature." type: string enum: [ "md5", "sha-1", "sha-256", "sha-512" ] default: "sha-256" encoding: description: "The encoding format of the generated signature." type: string enum: [ "hex", "base64", "base64url" ] default: "hex" signature_header: description: "The HTTP header name where the HMAC signature is sent." type: string minLength: 1 secret: type: string minLength: 1 required: - hash - encoding - signature_header - secret ConnectAuthPluginConfiguration: oneOf: - $ref: "#/components/schemas/GitHubProviderConfig" - $ref: "#/components/schemas/SlackProviderConfig" - $ref: "#/components/schemas/StripeProviderConfig" - $ref: "#/components/schemas/GitlabProviderConfig" - $ref: "#/components/schemas/ZendeskProviderConfig" - $ref: "#/components/schemas/OpenAIProviderConfig" - $ref: "#/components/schemas/OktaProviderConfig" discriminator: propertyName: provider mapping: github: "#/components/schemas/GitHubProviderConfig" slack: "#/components/schemas/SlackProviderConfig" stripe: "#/components/schemas/StripeProviderConfig" gitlab: "#/components/schemas/GitlabProviderConfig" zendesk: "#/components/schemas/ZendeskProviderConfig" openai: "#/components/schemas/OpenAIProviderConfig" okta: "#/components/schemas/OktaProviderConfig" SecretProviderConfig: type: object properties: provider: type: string provider_config: type: object additionalProperties: false properties: secret: description: "The signing secret used to verify request's signature." type: string minLength: 1 required: - secret required: - provider - provider_config SecretWithToleranceProviderConfig: type: object properties: provider: type: string provider_config: type: object additionalProperties: false properties: secret: description: "Signing secret for request signature validation." type: string minLength: 1 tolerance_window: description: "Tolerance window (in seconds) for signature timestamp validation. A value of 0 disables the tolerance check and may increase the risk of replay attacks." type: integer minimum: 0 default: 300 required: - secret - tolerance_window required: - provider - provider_config GitHubProviderConfig: $ref: "#/components/schemas/SecretProviderConfig" SlackProviderConfig: $ref: "#/components/schemas/SecretWithToleranceProviderConfig" GitlabProviderConfig: $ref: "#/components/schemas/SecretProviderConfig" StripeProviderConfig: $ref: "#/components/schemas/SecretWithToleranceProviderConfig" XProviderConfig: $ref: "#/components/schemas/SecretProviderConfig" ZendeskProviderConfig: $ref: "#/components/schemas/SecretWithToleranceProviderConfig" OpenAIProviderConfig: $ref: "#/components/schemas/SecretWithToleranceProviderConfig" OktaProviderConfig: type: object properties: provider: type: string provider_config: type: object additionalProperties: false properties: authentication_field: description: "Okta Event Hooks authentication field." minimum: 1 type: string authentication_secret: minimum: 1 description: "Okta Event Hooks authentication secret." type: string required: - authentication_field - authentication_secret required: - provider - provider_config HTTPSourceConfig: type: object default: methods: [ "POST" ] properties: path: type: string methods: type: array items: type: string enum: [ GET, POST, PUT, DELETE, PATCH ] minItems: 1 default: [ "POST" ] response: type: object nullable: true properties: code: type: integer minimum: 200 maximum: 599 content_type: type: string body: type: string required: - code - content_type