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

# Create Hook

> Create a new webhook.



## OpenAPI

````yaml /spec/oas.yaml post /hooks
openapi: 3.0.3
info:
  title: CRO Software API
  version: 2.x
  description: >-
    REST API for the CRO Software waste management and logistics platform.
    Authenticate via OAuth2 (client_credentials or authorization_code). All
    requests require a Bearer token and an X-Tenant-Id header.
servers:
  - url: https://api.crosoftware.com/v0
    description: Production
security: []
paths:
  /hooks:
    post:
      tags:
        - Webhooks
      summary: Create Hook
      description: Create a new webhook.
      operationId: webhooks_create_hook
      parameters:
        - name: x-api-version
          in: header
          required: false
          schema:
            type: string
            description: Version identifier (date format).
        - name: x-tenant-id
          in: header
          required: true
          schema:
            type: integer
            format: int64
            description: >-
              Tenant identifier. Contact [CRO
              Software](https://crosoftwaresolutions.com/) for more info if you
              don't already have this id. See [list tenant
              ids](/docs/requests/tenants_list_tenants) for info on listing the
              tenants you have access to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookModel'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookModel'
      security:
        - oauth2:
            - webhook
            - api
components:
  schemas:
    CreateWebhookModel:
      type: object
      description: Create webhook model.
      properties:
        events:
          $ref: '#/components/schemas/hook_events'
        secret:
          type: string
          description: Response body HMAC signing key.
        url:
          type: string
          description: Callback URL.
      required:
        - events
        - url
    WebhookModel:
      type: object
      description: Webhook model.
      properties:
        deleted_at:
          type: string
          format: date-time
          description: Denial date.
        events:
          $ref: '#/components/schemas/hook_events'
        id:
          type: integer
          format: int64
          description: Resource identifier.
        last_http_fail:
          type: string
          format: date-time
          description: Last time of url webhook execution failure.
        last_http_success:
          type: string
          format: date-time
          description: Last time of url webhook execution success.
        secret:
          type: string
          description: Response body HMAC signing key.
        url:
          type: string
          description: Callback URL.
      required:
        - deleted_at
        - events
        - id
        - last_http_fail
        - last_http_success
        - url
    hook_events:
      type: array
      items:
        type: string
        description: Hook event.
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/token
          scopes:
            api: General API access
            webhook: Webhook management
        authorizationCode:
          authorizationUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/auth
          tokenUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/token
          scopes:
            api: General API access
            webhook: Webhook management

````