---
title: "Receive a provider's webhook"
---

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

# Receive a provider's webhook

Path: Ámbar API › Integrations

`POST /v1/hooks/{installationId}`

The endpoint a provider or a client's own system pushes to, one per installation. The delivery is verified with the installation's app (for `custom-push`: `x-ambar-timestamp` in Unix seconds and `x-ambar-signature` = `v1=` and the hexadecimal HMAC-SHA256 of `{timestamp}.{body}` with the installation's `webhook_signing_key`, within five minutes of Ámbar's clock), kept unchanged and queued for the ingest worker, which reads and maps it later.
Use it from the provider's side only; people and agents never call it. Send the body with its media type (`application/json`, `application/fhir+json`, `text/csv`, …), at most 1 MiB. Retrying a delivery is safe: the same body is kept once and queued once.
Returns 202 with where the original is kept and whether it was queued now.
No bearer token: the signature authenticates the delivery.
`UNAUTHORIZED`: the installation is unknown or not active, its app takes no webhooks, or the signature is missing, stale or wrong; check the key and the clock, do not retry unchanged. `INVALID_INPUT`: no media type. `BODY_TOO_LARGE`: over 1 MiB. `DATABASE_UNAVAILABLE` or `PIPELINE_UNAVAILABLE`: retry with backoff.

## Path parameters

- `installationId` (`receiveInstallationWebhook.path.installationId`; string, required) — The installation the delivery is for.

## Request body

_Required._

The delivery exactly as the provider sends it.

## Example request

```json
{
  "externalId": "ord-2026-0001",
  "kind": "observation.resulted"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api-ambar.getarbol.com/v1/hooks/laboratorio-central \
  --header 'Content-Type: application/json' \
  --data '
{
  "externalId": "ord-2026-0001",
  "kind": "observation.resulted"
}
'
```

### TypeScript

```typescript
const url = 'https://api-ambar.getarbol.com/v1/hooks/laboratorio-central';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({externalId: 'ord-2026-0001', kind: 'observation.resulted'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api-ambar.getarbol.com/v1/hooks/laboratorio-central"

payload = {
    "externalId": "ord-2026-0001",
    "kind": "observation.resulted"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 202

#### Example

```json
{
  "data": {
    "originalRef": "originals/org_ips_demo/laboratorio-central/2026/10/14/9f2c4b1e0d8a7f6e5d4c3b2a1908f7e6d5c4b3a29180f7e6d5c4b3a2918f7e6d",
    "queued": true
  },
  "metadata": {
    "requestId": "request_01"
  },
  "success": true
}
```

- `data` (`receiveInstallationWebhook.response.202.data`; object, required) — A delivery kept and queued.
  - example `{"originalRef":"originals/org_ips_demo/laboratorio-central/2026/10/14/9f2c4b1e0d8a7f6e5d4c3b2a1908f7e6d5c4b3a29180f7e6d5c4b3a2918f7e6d","queued":true}`
  - `originalRef` (`receiveInstallationWebhook.response.202.data.originalRef`; string, required) — Where the original is kept: organization, installation, day received and the body's SHA-256. The same body on the same day gives the same reference.
  - `queued` (`receiveInstallationWebhook.response.202.data.queued`; boolean, required) — `false` when this original was already queued: a provider's retry changes nothing.
- `metadata` (`receiveInstallationWebhook.response.202.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`receiveInstallationWebhook.response.202.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`receiveInstallationWebhook.response.202.success`; boolean, required) — Always `true` in a success envelope.
  - one of `true`

### default

#### Example

```json
{
  "error": {
    "code": "INVALID_INPUT",
    "details": {
      "commandId": "string",
      "lineIds": [
        "string"
      ],
      "module": "pgp",
      "paymentProblem": "rules_unavailable",
      "reason": "not_contracted"
    },
    "message": "string"
  },
  "metadata": {
    "requestId": "string"
  },
  "success": false
}
```

- `error` (`receiveInstallationWebhook.response.default.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`receiveInstallationWebhook.response.default.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`receiveInstallationWebhook.response.default.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`receiveInstallationWebhook.response.default.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`receiveInstallationWebhook.response.default.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`receiveInstallationWebhook.response.default.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`receiveInstallationWebhook.response.default.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`receiveInstallationWebhook.response.default.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`receiveInstallationWebhook.response.default.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`receiveInstallationWebhook.response.default.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`receiveInstallationWebhook.response.default.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`receiveInstallationWebhook.response.default.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`


Source: https://docs.getarbol.com/api/ambar/receive-installation-webhook/index.md
