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

# Sync exposure

> Trigger an on-demand recompute of registration threshold exposure for a corporation. The exposure engine evaluates the corporation's transactions against jurisdiction-level exposure rules and updates the cached breached set used by `GET /nexus?v2=true`.

As part of every successful run, the engine emits an `INDIRECT_TAX.EXPOSURE.COMPUTED` webhook containing the corporation's full current set of exposed jurisdictions (see [Topics and Events](/engine/indirect-tax/webhooks/event)). Use this endpoint when you need fresh exposure data without waiting for the daily background recompute — for example, immediately after ingesting a backfill of historical transactions, or after a registration is created or archived.

## Overview

Trigger an on-demand recompute of registration threshold exposure for a corporation. The exposure engine evaluates the corporation's transactions against jurisdiction-level exposure rules and updates the cached breached set returned by [GET /nexus?v2=true](/engine/indirect-tax/nexus/nexus-GET).

Every successful run emits an [`INDIRECT_TAX.EXPOSURE.COMPUTED`](/engine/indirect-tax/webhooks/event#indirect-tax-exposure) webhook with the corporation's full current set of exposed jurisdictions. The webhook is only dispatched when at least one subscriber is registered for the topic.

## When to use this endpoint

By default, exposure is recomputed automatically — both lazily on read and via a daily background job. Call this endpoint only when you need fresh exposure data immediately, for example:

* After ingesting a large backfill of historical transactions and you want exposure (and any downstream consumers listening on the webhook) to reflect the new totals right away.
* After creating or archiving a registration, when you want exposure recomputed without waiting for the next scheduled run.
* When wiring up a new webhook subscriber and you want to deliver an initial snapshot of the corporation's current exposure.

## Behavior

* The full exposure engine runs synchronously. Large corporations may see latency proportional to their transaction volume.
* The response returns once the engine has finished and the webhook has been dispatched (or skipped, if no subscribers exist for the topic).
* The webhook payload contains the corporation's full current breached set — treat each delivery as a snapshot, not a delta. See [Topics and Events](/engine/indirect-tax/webhooks/event) for the payload shape.
* The caller must be authorized to access the corporation; otherwise a `401` is returned.


## OpenAPI

````yaml POST /exposure/sync
openapi: 3.0.1
info:
  title: Commenda Public APIs
  description: >-
    APIs for Commenda entity management, partner incorporation, indirect tax,
    compliance, and corporate operations.
  license:
    name: NONE
    url: NONE
  version: 1.0.0
servers:
  - url: https://api.prod.commenda.io/api/v1
    description: Commenda platform APIs, including Partner Incorporation and Commenda OS.
  - url: https://transaction-tax.api.in.commenda.io/api/v1
    description: Global Indirect Tax API.
security:
  - bearerAuth: []
paths:
  /exposure/sync:
    post:
      summary: Sync registration threshold exposure
      description: >-
        Trigger an on-demand recompute of registration threshold exposure for a
        corporation. The exposure engine evaluates the corporation's
        transactions against jurisdiction-level exposure rules and updates the
        cached breached set used by `GET /nexus?v2=true`.


        As part of every successful run, the engine emits an
        `INDIRECT_TAX.EXPOSURE.COMPUTED` webhook containing the corporation's
        full current set of exposed jurisdictions (see [Topics and
        Events](/engine/indirect-tax/webhooks/event)). Use this endpoint when
        you need fresh exposure data without waiting for the daily background
        recompute — for example, immediately after ingesting a backfill of
        historical transactions, or after a registration is created or archived.
      operationId: syncExposure
      parameters:
        - name: corporation_id
          in: query
          description: The unique identifier for the corporation to recompute exposure for.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Exposure recomputed successfully. The
            `INDIRECT_TAX.EXPOSURE.COMPUTED` webhook has been dispatched to any
            subscribers.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: >-
                      Exposure engine ran; IndirectTaxExposureComputed webhook
                      dispatched.
        '400':
          description: Missing or invalid `corporation_id`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Caller is not authorized to access the corporation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Exposure engine failed to run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: 'Specific Error type. Example: CLIENT_INVALID_REQUEST_BODY.'
              example: CLIENT_INVALID_REQUEST_BODY
            doc_url:
              type: string
              description: >-
                A link to the docs with details about this error. Example:
                https://sales-tax-docs.commenda.io/
              example: https://sales-tax-docs.commenda.io/
            title:
              type: string
              description: >-
                A short title describing the error. Example: Missing query
                parameters.
              example: Failed to validate the request body
            detail:
              type: string
              description: >-
                A json string with a description on how to fix the error.
                Example {"description":"Please pass in a valid corporation_id"}
            status:
              type: number
              description: >-
                The status code. It should be the same as the HTTP protocol
                status code. Example: 200
              example: 400
            instance:
              type: string
              description: >-
                The relative path that was hit by the user. Example:
                /api/v1/corporations/1
            Errors:
              type: array
              items:
                type: object
                properties:
                  details:
                    type: string
                    description: More details on how to solve this particular error.
                  pointer:
                    type: string
                    description: >-
                      Relative reference to missing or invalid piece of passed
                      information.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````