---
updatedAt: 2026-04-20T19:43:46.000Z
agentTools:
  projectIndex: https://docs.trybadge.com/llms.txt
---

# Create a webhook endpoint

Create a webhook endpoint to subscribe to events.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Badge API",
    "version": "0"
  },
  "servers": [
    {
      "url": "https://api.trybadge.com/v0"
    }
  ],
  "security": [
    {
      "WorkspaceAuth": []
    }
  ],
  "tags": [
    {
      "name": "Webhook"
    }
  ],
  "paths": {
    "/webhookEndpoints": {
      "post": {
        "operationId": "webhookEndpointCreate",
        "tags": [
          "Webhook"
        ],
        "summary": "Create a webhook endpoint",
        "description": "Create a webhook endpoint to subscribe to events.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "enabledTopics",
                  "enabled"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "The URL where webhook events will be sent"
                  },
                  "enabledTopics": {
                    "type": "array",
                    "description": "List of event topics to subscribe to",
                    "minItems": 1,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/components/schemas/WebhookTopic"
                    }
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether the webhook endpoint is enabled"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "webhookEndpoint"
                  ],
                  "properties": {
                    "webhookEndpoint": {
                      "type": "object",
                      "required": [
                        "id",
                        "createdAt",
                        "url",
                        "enabledTopics",
                        "enabled",
                        "secret"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "enabledTopics": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WebhookTopic"
                          }
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "secret": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "WorkspaceAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "WebhookTopic": {
        "type": "string",
        "enum": [
          "pass.activated",
          "pass.deactivated"
        ],
        "description": "Available webhook event topics"
      }
    }
  }
}
```