companydata.dk Webhooks API

Webhooks let your application receive real-time notifications when company data changes in the CVR registry. Useful for monitoring a portfolio of clients, prospects, suppliers, or any list of CVRs you care about. **Pro subscription required**, except `GET /v1/webhooks/event-types` which is open to any API key. Pro accounts can register up to **5 webhooks**, each monitoring up to **50,000 CVRs**. ## Authenticating to this API All `/v1/webhooks/*` requests authenticate the same way as the rest of the companydata.dk API: a Bearer token in the `Authorization` header. ``` Authorization: Bearer sk_live_your_api_key ``` ## Setup in three steps **1. Create an HTTPS endpoint** on your server that accepts `POST` with a JSON body. Return any `2xx` status code to acknowledge receipt. Anything outside `2xx` is treated as a failed delivery. **2. Register the webhook** with `POST /v1/webhooks`. The response includes a `secret` — **store it immediately**, it is only returned once and is required to verify incoming payloads. Until step 3 is completed, a freshly created webhook receives **no events**. **3. Tell us which CVRs to monitor** with `PUT /v1/webhooks/{webhook_id}/cvr-filter`. Send the full list of 8-digit CVR numbers you care about (up to 50,000 per webhook). Re-send the full list any time you want to change which companies are tracked. ## Payload Every event POSTs a JSON body matching the `WebhookPayload` schema to your URL: ```json { "event_id": "9c1f7e64-3b8a-4f0d-9a25-1d6c8a4e7f10", "event_type": "ownership", "cvr": "12345678", "company_name": "Example ApS", "changes": [ {"field": "ownership_percent", "old_value": "25.0", "new_value": "51.0"} ], "summary": { "da": "Ejerandel ændret fra 25% til 51%", "en": "Ownership percent changed from 25% to 51%" }, "detected_at": "2026-04-28T09:14:22Z", "timestamp": "2026-04-28T09:14:23Z" } ``` `event_id` is a UUIDv4, globally unique, and **stable across retries** — use it as the key for de-duplication. The `changes` array contains field-level diffs and may be empty for some event types; values are always strings (or `null`). The human-readable `summary` is always populated. Discover the full list of event types with `GET /v1/webhooks/event-types`. ## Delivery semantics - **Latency.** Most events are delivered within a few minutes of detection. Annual report (`financial`) events are batch-processed and may take **up to 24 hours** because XBRL parsing is queued. - **At-least-once.** Network errors and retries can cause the same event to be delivered more than once. De-duplicate on `event_id` (a 7-day cache window is more than sufficient). - **Ordering.** Events are not strictly ordered. Use `detected_at` to sequence changes for a given company on your side. - **No replay or backfill.** Events that exhaust their retry budget are not re-attempted. If your consumer is down longer than the retry window, reconcile by re-fetching the affected companies from `GET /v1/companies/{cvr}` once you're back up. ## Headers Every delivery includes: | Header | Description | |---|---| | `Content-Type` | Always `application/json` | | `X-Companydata-Signature` | `sha256=` — HMAC-SHA256 of the raw request body using your webhook secret | | `X-Companydata-Event` | The event type (matches `event_type` in the body) | | `X-Companydata-Delivery` | Unique delivery ID — changes on each retry. Useful for support | Any custom headers you set when creating the webhook are added to every delivery. ## Verifying the signature Compute HMAC-SHA256 of the raw request body using your webhook `secret` and compare it to the hex value after `sha256=` in `X-Companydata-Signature`. **Always use a constant-time comparison.** ```python import hmac, hashlib def verify(raw_body: bytes, signature_header: str, secret: str) -> bool: expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature_header) ``` ```javascript import { createHmac, timingSafeEqual } from "crypto"; function verify(rawBody, signatureHeader, secret) { const expected = "sha256=" + createHmac("sha256", secret).update(rawBody).digest("hex"); return timingSafeEqual(Buffer.from(expected), Buffer.from(signatureHeader)); } ``` ## Retries and auto-disable - Each delivery is attempted **up to 3 times**. Anything outside `2xx` (including timeouts after 10s) is retried automatically. Retries are spaced roughly **2 minutes apart**, so a delivery either succeeds or is permanently failed within ~5 minutes of the first attempt. - Your endpoint should respond quickly — ideally enqueue the payload and return `200` immediately. - After **10 consecutive failures** across deliveries, the webhook is **auto-disabled** and `active` is set to `false`. Re-enable it with `PUT /v1/webhooks/{webhook_id}` and `{"active": true}` once the underlying issue is fixed; this also resets the failure counter. ## Inspecting deliveries `GET /v1/webhooks/{webhook_id}/deliveries` lists recent delivery attempts (HTTP status, truncated response body, error messages, timestamps) with `limit` and `offset` for pagination. `POST /v1/webhooks/{webhook_id}/test` sends a synthetic event to your URL — use this to verify your endpoint accepts the payload and signature before going live.

GitHub OpenAPI

Operations 11

GET /v1/webhooks/event-types /webhooks/event-types #
GET /v1/webhooks /webhooks #
POST /v1/webhooks /webhooks #
GET /v1/webhooks/{webhook_id} /webhooks/{webhook_id} #
PUT /v1/webhooks/{webhook_id} /webhooks/{webhook_id} #
DELETE /v1/webhooks/{webhook_id} /webhooks/{webhook_id} #
POST /v1/webhooks/{webhook_id}/test /webhooks/{webhook_id}/test #
GET /v1/webhooks/{webhook_id}/deliveries /webhooks/{webhook_id}/deliveries #
PUT /v1/webhooks/{webhook_id}/cvr-filter /webhooks/{webhook_id}/cvr-filter #
GET /v1/webhooks/{webhook_id}/cvr-filter /webhooks/{webhook_id}/cvr-filter #
DELETE /v1/webhooks/{webhook_id}/cvr-filter /webhooks/{webhook_id}/cvr-filter #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/companydata-dk:companydata-dk-webhooks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

companydata-dk-webhooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Companydata Dk Webhooks API
  version: 1.0.0
  x-refined-note:
  - x-source differs across the merged source definitions and was not carried
  description: 'Operations tagged Webhooks across 2 of this provider''s published API definitions: companydata-dk-v1-openapi.json, companydata-dk-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.companydata.dk
  description: Production
security:
- BearerAuth: []
tags:
- name: Webhooks
  description: 'Webhooks let your application receive real-time notifications when company data changes

    in the CVR registry. Useful for monitoring a portfolio of clients, prospects, suppliers,

    or any list of CVRs you care about. **Pro subscription required**, except `GET /v1/webhooks/event-types` which is open to any API key. Pro accounts can register up to **5 webhooks**, each monitoring up to **50,000 CVRs**. ## Authenticating to this API


    All `/v1/webhooks/*` requests authenticate the same way as the rest of the companydata.dk API:

    a Bearer token in the `Authorization` header. ```

    Authorization: Bearer sk_live_your_api_key

    ```


    ## Setup in three steps


    **1. Create an HTTPS endpoint** on your server that accepts `POST` with a JSON body. Return any

    `2xx` status code to acknowledge receipt. Anything outside `2xx` is treated as a failed delivery. **2. Register the webhook** with `POST /v1/webhooks`. The response includes a `secret` —

    **store it immediately**, it is only returned once and is required to verify incoming payloads. Until step 3 is completed, a freshly created webhook receives **no events**. **3. Tell us which CVRs to monitor** with `PUT /v1/webhooks/{webhook_id}/cvr-filter`. Send the full list of 8-digit CVR numbers you care about (up to 50,000 per webhook). Re-send the full list any time you want to change which companies are tracked. ## Payload


    Every event POSTs a JSON body matching the `WebhookPayload` schema to your URL:


    ```json

    {

    "event_id": "9c1f7e64-3b8a-4f0d-9a25-1d6c8a4e7f10",

    "event_type": "ownership",

    "cvr": "12345678",

    "company_name": "Example ApS",

    "changes": [

    {"field": "ownership_percent", "old_value": "25.0", "new_value": "51.0"}

    ],

    "summary": {

    "da": "Ejerandel ændret fra 25% til 51%",

    "en": "Ownership percent changed from 25% to 51%"

    },

    "detected_at": "2026-04-28T09:14:22Z",

    "timestamp": "2026-04-28T09:14:23Z"

    }

    ```


    `event_id` is a UUIDv4, globally unique, and **stable across retries** — use it as the key

    for de-duplication. The `changes` array contains field-level diffs and may be empty for some

    event types; values are always strings (or `null`). The human-readable `summary` is always populated. Discover the full list of event types with `GET /v1/webhooks/event-types`. ## Delivery semantics


    - **Latency.** Most events are delivered within a few minutes of detection. Annual report

    (`financial`) events are batch-processed and may take **up to 24 hours** because XBRL parsing

    is queued. - **At-least-once.** Network errors and retries can cause the same event to be delivered more

    than once. De-duplicate on `event_id` (a 7-day cache window is more than sufficient). - **Ordering.** Events are not strictly ordered. Use `detected_at` to sequence changes for a

    given company on your side. - **No replay or backfill.** Events that exhaust their retry budget are not re-attempted. If your consumer is down longer than the retry window, reconcile by re-fetching the affected

    companies from `GET /v1/companies/{cvr}` once you''re back up. ## Headers


    Every delivery includes:


    | Header | Description |

    |---|---|

    | `Content-Type` | Always `application/json` |

    | `X-Companydata-Signature` | `sha256=` — HMAC-SHA256 of the raw request body using your webhook secret |

    | `X-Companydata-Event` | The event type (matches `event_type` in the body) |

    | `X-Companydata-Delivery` | Unique delivery ID — changes on each retry. Useful for support |


    Any custom headers you set when creating the webhook are added to every delivery. ## Verifying the signature


    Compute HMAC-SHA256 of the raw request body using your webhook `secret` and compare it to the

    hex value after `sha256=` in `X-Companydata-Signature`.'
paths:
  /v1/webhooks/event-types:
    get:
      tags:
      - Webhooks
      summary: /webhooks/event-types
      description: 'List all notification event types that can appear in webhook payloads and

        be used in `event_types` arrays on webhooks and CVR filters.


        Each entry includes the identifier (`value`), Danish and English labels,

        and a description of what change in the underlying CVR data triggers it.


        Open to any API key — no Pro subscription required.'
      operationId: list_event_types_v1_webhooks_event_types_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/EventTypeInfo'
                type: array
                title: Response List Event Types V1 Webhooks Event Types Get
      security:
      - BearerAuth: []
    servers:
    - url: https://api.companydata.dk
      description: Production
  /v1/webhooks:
    get:
      tags:
      - Webhooks
      summary: /webhooks
      description: 'List all webhooks owned by the calling API key.


        `meta.max_webhooks` shows your subscription tier''s webhook limit.

        Secrets are not returned — they are only available at creation time.'
      operationId: list_webhooks_v1_webhooks_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhooksListResponse'
      security:
      - BearerAuth: []
    post:
      tags:
      - Webhooks
      summary: /webhooks
      description: 'Register a new webhook endpoint.


        The `url` must be HTTPS and respond `2xx` within 10 seconds. After creation, set

        the list of CVRs to monitor with `PUT /v1/webhooks/{webhook_id}/cvr-filter` to start

        receiving events.


        **The `secret` field in the response is only returned here.** Store it now — it is

        used to verify the HMAC signature on every incoming delivery and cannot be retrieved later.

        A new secret can only be obtained by deleting and re-creating the webhook.


        Returns `403` if you have reached your subscription tier''s webhook limit.'
      operationId: create_new_webhook_v1_webhooks_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookWithSecret'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - BearerAuth: []
    servers:
    - url: https://api.companydata.dk
      description: Production
  /v1/webhooks/{webhook_id}:
    get:
      tags:
      - Webhooks
      summary: /webhooks/{webhook_id}
      description: 'Get the current configuration and health of a single webhook.


        Use `consecutive_failures` and `disabled_reason` to monitor delivery health.'
      operationId: get_webhook_details_v1_webhooks__webhook_id__get
      security:
      - BearerAuth: []
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          type: string
          title: Webhook Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
      - Webhooks
      summary: /webhooks/{webhook_id}
      description: 'Update a webhook''s configuration. Only the fields you provide are changed.


        Setting `active: true` on an auto-disabled webhook re-enables it and resets the

        consecutive-failure counter — fix the underlying issue first or it will be

        auto-disabled again.


        The signing secret cannot be rotated through this endpoint; delete and re-create

        the webhook if you need a new secret.'
      operationId: update_webhook_settings_v1_webhooks__webhook_id__put
      security:
      - BearerAuth: []
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          type: string
          title: Webhook Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Webhooks
      summary: /webhooks/{webhook_id}
      description: 'Permanently delete a webhook. Delivery stops immediately and any pending

        retries are dropped. Any watch-list entries that targeted this webhook

        are removed too — there''s no point in keeping routing rules pointing at

        a vanished URL.'
      operationId: remove_webhook_v1_webhooks__webhook_id__delete
      security:
      - BearerAuth: []
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          type: string
          title: Webhook Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    servers:
    - url: https://api.companydata.dk
      description: Production
  /v1/webhooks/{webhook_id}/test:
    post:
      tags:
      - Webhooks
      summary: /webhooks/{webhook_id}/test
      description: 'Send a synthetic test event to the webhook URL. Useful for verifying your

        endpoint accepts the payload and signature before going live.


        The test payload uses `event_type=company_status` with CVR `00000000` and

        company name `Test Company ApS`. It is signed with your webhook secret exactly

        like a real event, and will count toward `consecutive_failures` if your endpoint

        rejects it.'
      operationId: send_test_webhook_v1_webhooks__webhook_id__test_post
      security:
      - BearerAuth: []
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          type: string
          title: Webhook Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    servers:
    - url: https://api.companydata.dk
      description: Production
  /v1/webhooks/{webhook_id}/deliveries:
    get:
      tags:
      - Webhooks
      summary: /webhooks/{webhook_id}/deliveries
      description: 'List delivery attempts for this webhook, newest first.


        Each entry includes the HTTP status code returned by your endpoint, an error

        message if delivery failed, and timestamps. Use this to diagnose missed events

        or repeated failures. Pending entries are still being attempted (up to 3 tries).'
      operationId: get_webhook_deliveries_v1_webhooks__webhook_id__deliveries_get
      security:
      - BearerAuth: []
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          type: string
          title: Webhook Id
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          description: Number of deliveries to return per page. Maximum 100.
          default: 50
          title: Limit
        description: Number of deliveries to return per page. Maximum 100.
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          description: Number of deliveries to skip. Use with `limit` for pagination.
          default: 0
          title: Offset
        description: Number of deliveries to skip. Use with `limit` for pagination.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDeliveriesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    servers:
    - url: https://api.companydata.dk
      description: Production
  /v1/webhooks/{webhook_id}/cvr-filter:
    put:
      tags:
      - Webhooks
      summary: /webhooks/{webhook_id}/cvr-filter
      description: 'Replace the list of CVRs that this webhook monitors (idempotent).


        Once set, the webhook receives every change event for any CVR in the list, for

        the chosen event types. To sync your portfolio, send the full current list each

        time — the new list completely replaces the previous one.


        **Validation**

        - Each CVR must be exactly 8 numeric digits.

        - Maximum 50,000 CVRs per webhook.

        - Duplicates are silently de-duplicated.

        - Pass an empty `cvrs` array to keep the filter present but match nothing.

        - Omit `event_types` (or pass `null`) to subscribe to all event types.


        Unknown CVRs are accepted silently — you simply receive no events for them.

        This makes it safe to send a list that may include companies that don''t exist

        yet or have been deleted.


        Returns `400` for invalid CVRs or count above the cap, `404` if the webhook

        does not exist or is not owned by you.'
      operationId: replace_cvr_filter_v1_webhooks__webhook_id__cvr_filter_put
      security:
      - BearerAuth: []
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          type: string
          title: Webhook Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetCvrFilterRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CvrFilterResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Webhooks
      summary: /webhooks/{webhook_id}/cvr-filter
      description: 'Read the current bulk CVR filter on a webhook.


        Returns `404` if no filter is set on this webhook. CVRs are returned in the

        order they were originally registered (after de-duplication).'
      operationId: read_cvr_filter_v1_webhooks__webhook_id__cvr_filter_get
      security:
      - BearerAuth: []
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          type: string
          title: Webhook Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CvrFilterResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Webhooks
      summary: /webhooks/{webhook_id}/cvr-filter
      description: 'Remove the CVR list from a webhook. The webhook itself is unchanged —

        it simply stops receiving events until a new list is set.'
      operationId: remove_cvr_filter_v1_webhooks__webhook_id__cvr_filter_delete
      security:
      - BearerAuth: []
      parameters:
      - name: webhook_id
        in: path
        required: true
        schema:
          type: string
          title: Webhook Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    servers:
    - url: https://api.companydata.dk
      description: Production
components:
  schemas:
    WebhookResponse:
      properties:
        webhook_id:
          type: string
          title: Webhook Id
          description: Unique identifier for this webhook.
        name:
          type: string
          title: Name
          description: Human-readable label.
        url:
          type: string
          title: Url
          description: HTTPS endpoint that receives deliveries.
        active:
          type: boolean
          title: Active
          description: Whether this webhook is currently delivering events.
        event_types:
          items:
            $ref: '#/components/schemas/EventType'
          type: array
          title: Event Types
          description: Event types this webhook receives.
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          description: Custom headers added to every delivery.
        last_success_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Success At
          description: Timestamp of the most recent successful (2xx) delivery.
        last_failure_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Failure At
          description: Timestamp of the most recent failed delivery attempt.
        consecutive_failures:
          type: integer
          title: Consecutive Failures
          description: Number of consecutive failed deliveries. Reset to 0 on the next 2xx response. Reaching 10 auto-disables the webhook.
          default: 0
        disabled_reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Disabled Reason
          description: Set when the webhook is auto-disabled. `null` otherwise.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the webhook was created.
      type: object
      required:
      - webhook_id
      - name
      - url
      - active
      - event_types
      - headers
      - created_at
      title: WebhookResponse
      description: A webhook configuration. The secret is never returned after creation.
    DeliveryStatus:
      type: string
      enum:
      - pending
      - sent
      - failed
      - delivered
      title: DeliveryStatus
      description: Status of a notification delivery.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WebhooksListResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/WebhookResponse'
          type: array
          title: Data
        meta:
          additionalProperties: true
          type: object
          title: Meta
      type: object
      required:
      - data
      - meta
      title: WebhooksListResponse
      description: Response for listing webhooks.
    TestWebhookResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
      type: object
      required:
      - success
      - message
      title: TestWebhookResponse
      description: Response for webhook test.
    EventTypeInfo:
      properties:
        value:
          type: string
          title: Value
          description: Identifier used in `event_type` fields and webhook filter configuration.
        label_da:
          type: string
          title: Label Da
          description: Short human-readable Danish label.
        label_en:
          type: string
          title: Label En
          description: Short human-readable English label.
        description:
          type: string
          title: Description
          description: What change in the CVR data triggers this event.
      type: object
      required:
      - value
      - label_da
      - label_en
      - description
      title: EventTypeInfo
      description: A single notification event type that can appear in webhook payloads.
    WebhookWithSecret:
      properties:
        webhook_id:
          type: string
          title: Webhook Id
          description: Unique identifier for this webhook.
        name:
          type: string
          title: Name
          description: Human-readable label.
        url:
          type: string
          title: Url
          description: HTTPS endpoint that receives deliveries.
        active:
          type: boolean
          title: Active
          description: Whether this webhook is currently delivering events.
        event_types:
          items:
            $ref: '#/components/schemas/EventType'
          type: array
          title: Event Types
          description: Event types this webhook receives.
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          description: Custom headers added to every delivery.
        last_success_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Success At
          description: Timestamp of the most recent successful (2xx) delivery.
        last_failure_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Failure At
          description: Timestamp of the most recent failed delivery attempt.
        consecutive_failures:
          type: integer
          title: Consecutive Failures
          description: Number of consecutive failed deliveries. Reset to 0 on the next 2xx response. Reaching 10 auto-disables the webhook.
          default: 0
        disabled_reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Disabled Reason
          description: Set when the webhook is auto-disabled. `null` otherwise.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the webhook was created.
        secret:
          type: string
          title: Secret
          description: HMAC-SHA256 signing secret. Used to verify the `X-Companydata-Signature` header on every incoming delivery. **Store this immediately — it is never returned again.**
      type: object
      required:
      - webhook_id
      - name
      - url
      - active
      - event_types
      - headers
      - created_at
      - secret
      title: WebhookWithSecret
      description: A webhook configuration including the secret. Only returned on creation.
    CvrFilterResponse:
      properties:
        cvrs:
          items:
            type: string
          type: array
          title: Cvrs
          description: The CVRs being monitored, in registration order.
        event_types:
          items:
            $ref: '#/components/schemas/EventType'
          type: array
          title: Event Types
          description: Event types being delivered for these CVRs.
        cvr_count:
          type: integer
          title: Cvr Count
          description: Number of CVRs in the filter. Convenience for clients.
      type: object
      required:
      - cvrs
      - event_types
      - cvr_count
      title: CvrFilterResponse
      description: The bulk CVR filter currently set on a webhook.
    WebhookDeliveriesResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/WebhookDeliveryItem'
          type: array
          title: Data
        total:
          type: integer
          title: Total
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
      type: object
      required:
      - data
      - total
      - limit
      - offset
      title: WebhookDeliveriesResponse
      description: Response for webhook deliveries.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    WebhookDeliveryItem:
      properties:
        delivery_id:
          type: string
          title: Delivery Id
          description: Unique delivery ID (also sent in `X-Companydata-Delivery`).
        event_id:
          type: string
          title: Event Id
          description: The change event this delivery was for.
        event_type:
          $ref: '#/components/schemas/EventType'
          description: The type of change event.
        cvr:
          type: string
          title: Cvr
          description: The CVR number of the company that changed.
        company_name:
          type: string
          title: Company Name
          description: Company name at the time the event was generated.
        status:
          $ref: '#/components/schemas/DeliveryStatus'
          description: '`pending` (queued/retrying), `sent` (delivered), `failed` (gave up after retries).'
        response_code:
          anyOf:
          - type: integer
          - type: 'null'
          title: Response Code
          description: HTTP status code returned by your endpoint, if a response was received.
        error_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Error Message
          description: Error description if delivery failed (timeout, connection error, non-2xx).
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When this delivery was queued.
        sent_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Sent At
          description: When the final attempt was made (set on success or final failure).
      type: object
      required:
      - delivery_id
      - event_id
      - event_type
      - cvr
      - company_name
      - status
      - created_at
      title: WebhookDeliveryItem
      description: One delivery attempt in a webhook's history.
    EventType:
      type: string
      enum:
      - company_status
      - ownership
      - board
      - director
      - financial
      - announcement
      - address
      - contact
      - financial_distress
      - corporate_announcement
      - property_ownership
      - tender_award
      - new_company
      - press_release
      - media_mention
      - court_hearing
      - screen_entered
      - screen_left
      title: EventType
      description: Types of change events that can trigger notifications.
    CreateWebhookRequest:
      properties:
        name:
          type: string
          title: Name
          description: Human-readable label shown in your account. Not sent to the webhook URL.
          examples:
          - Production CRM sync
        url:
          type: string
          title: Url
          description: HTTPS URL that will receive POST requests when matching events occur. Must respond with a 2xx status code within 10 seconds.
          examples:
          - https://api.example.com/companydata-webhook
        event_types:
          items:
            $ref: '#/components/schemas/EventType'
          type: array
          title: Event Types
          description: Event types this webhook should receive. Defaults to all event types. See `GET /v1/webhooks/event-types` for the catalog.
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          description: Custom HTTP headers added to every delivery. Useful for routing or additional authentication on your endpoint.
          examples:
          - X-My-Service-Token: abc123
      type: object
      required:
      - name
      - url
      title: CreateWebhookRequest
      description: Request to create a webhook.
    UpdateWebhookRequest:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
          description: New label for the webhook.
        url:
          anyOf:
          - type: string
          - type: 'null'
          title: Url
          description: New HTTPS endpoint URL.
        event_types:
          anyOf:
          - items:
              $ref: '#/components/schemas/EventType'
            type: array
          - type: 'null'
          title: Event Types
          description: Replace the list of event types this webhook receives.
        headers:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Headers
          description: Replace the custom headers sent with every delivery.
        active:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Active
          description: Enable or disable delivery. Setting `true` on an auto-disabled webhook re-enables it and resets the consecutive-failure counter.
      type: object
      title: UpdateWebhookRequest
      description: Request to update a webhook. Only provided fields are changed.
    SetCvrFilterRequest:
      properties:
        cvrs:
          items:
            type: string
          type: array
          title: Cvrs
          description: Complete list of 8-digit CVR numbers to monitor. Replaces any existing filter. Maximum 50,000 entries per webhook. Duplicates are silently de-duplicated. Pass an empty list to disable the filter without deleting it.
          examples:
          - - '12345678'
            - '87654321'
            - '11223344'
        event_types:
          anyOf:
          - items:
              $ref: '#/components/schemas/EventType'
            type: array
          - type: 'null'
          title: Event Types
          description: Event types to receive for the CVRs in this filter. Omit or set to `null` to receive all event types.
      type: object
      required:
      - cvrs
      title: SetCvrFilterRequest
      description: Request body for `PUT /v1/webhooks/{webhook_id}/cvr-filter`.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key authentication. Include your API key in the Authorization header: `Bearer sk_live_your_key`. Get your key at [companydata.dk](https://companydata.dk)'
x-refined-from:
- companydata-dk-v1-openapi.json
- companydata-dk-openapi.yml