> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fingerprint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create webhook

> Creates a new webhook in the workspace associated with the Management API key.
Webhook needs to be verified before it will start sending identification events to your server. See webhook verification.
If webhook signatures are enabled (enterprise only), signing key will be visible in the response after creation. When fetching webhooks after creation, signing key will not be visible!
See webhooks documentation for more details.
When specifying an environment during creation, webhook should be assigned to the given environment. Setting environment to null creates a global webhook.



## OpenAPI

````yaml /reference/management-api_2024-05-20.json POST /webhooks
openapi: 3.0.0
info:
  title: Management API
  description: >-
    Managment API allows you to manage your Fingerprint account and applications
    programmatically from a server environment.
  version: '2024-05-20'
  contact: {}
servers:
  - url: https://management-api.fpjs.io
security:
  - Management-API-key: []
tags: []
paths:
  /webhooks:
    post:
      tags:
        - webhooks
      summary: Create webhook
      description: >-
        Creates a new webhook in the workspace associated with the Management
        API key.

        Webhook needs to be verified before it will start sending identification
        events to your server. See webhook verification.

        If webhook signatures are enabled (enterprise only), signing key will be
        visible in the response after creation. When fetching webhooks after
        creation, signing key will not be visible!

        See webhooks documentation for more details.

        When specifying an environment during creation, webhook should be
        assigned to the given environment. Setting environment to null creates a
        global webhook.
      operationId: WebhooksController_create
      parameters:
        - name: X-API-Version
          in: header
          description: Management API version.
          example: '2024-05-20'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookDtoV1'
      responses:
        '201':
          description: Webhook created, but needs to be verified before it's active.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
        '400':
          description: 'Error: Bad request.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationApiExceptionDto'
        '401':
          description: Unauthorized. API key is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionDto'
        '403':
          description: Forbidden. Insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionDto'
        '404':
          description: Webhook does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionDto'
        '422':
          description: 'Error: Payload parameters are invalid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationApiExceptionDto'
        '429':
          description: 'Error: API key has exceeded its rate limit.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionDto'
components:
  schemas:
    CreateWebhookDtoV1:
      type: object
      properties:
        url:
          type: string
          description: URL of the webhook endpoint. Must start with https://.
          example: https://website.com/webhook
        description:
          type: string
          description: Description of the webhook.
          example: My Webhook
        status:
          type: string
          description: 'Status of the webhook: ''enabled'' or ''disabled''.'
          enum:
            - enabled
            - disabled
        environment:
          type: object
          description: Environment ID this webhook is associated with. Null if global.
      required:
        - url
    WebhookResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/WebhookEntityV1'
      required:
        - data
    ValidationApiExceptionDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/BaseValidationApiExceptionDto'
      required:
        - error
    ApiExceptionDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/BaseApiExceptionDto'
      required:
        - error
    WebhookEntityV1:
      type: object
      properties:
        id:
          type: string
          description: Webhook ID.
          example: wh_HYv9YfsIIUjpvR
        description:
          type: string
          description: Description of the webhook.
          example: My Webhook
        status:
          type: string
          description: 'Status of the webhook: ''enabled'' or ''disabled''.'
          enum:
            - enabled
            - disabled
        verified:
          type: boolean
          description: Indicates if the webhook endpoint has been verified.
          example: false
        environment:
          type: object
          description: Environment ID this webhook is associated with. Null if global.
        url:
          type: string
          description: URL of the webhook endpoint. Must start with https://.
          example: https://website.com/webhook
        legacy:
          type: boolean
          description: True if webhook is legacy. See docs for more details.
        signing_key:
          type: string
          description: >-
            The signing key for verifying webhook payloads. Will only be
            returned on creation. See docs for more details.
        basic_auth:
          type: object
          description: Basic authentication credentials. Only applies to legacy webhooks.
          nullable: true
        created_at:
          format: date-time
          type: string
          description: Timestamp of when the webhook was created.
        last_enabled_at:
          type: object
          description: Timestamp of when the webhook was last enabled.
          nullable: true
        last_disabled_at:
          type: object
          description: Timestamp of when the webhook was last disabled.
          nullable: true
      required:
        - id
        - description
        - status
        - verified
        - environment
        - url
        - legacy
        - basic_auth
        - created_at
    BaseValidationApiExceptionDto:
      type: object
      properties:
        message:
          type: string
          description: Verbal description of the error.
        code:
          type: string
          description: Error code.
        violations:
          description: List of validation violations.
          type: array
          items:
            $ref: '#/components/schemas/BaseValidationApiExceptionViolationDto'
      required:
        - message
        - code
    BaseApiExceptionDto:
      type: object
      properties:
        message:
          type: string
          description: Verbal description of the error.
        code:
          type: string
          description: Error code.
      required:
        - message
        - code
    BaseValidationApiExceptionViolationDto:
      type: object
      properties:
        property:
          type: string
          description: Property that has failed validation.
        message:
          type: string
          description: Description of the violation.
      required:
        - property
        - message
  securitySchemes:
    Management-API-key:
      scheme: bearer
      bearerFormat: JWT
      type: http

````