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

# Destinations

> Where Olira sends outbound actions: webhooks and email today, the triggers you subscribe, and digest batching.

A **destination** is where deliveries go. You create it once in the [Console](/console/overview) (**Outbound actions**) or with the SDK, subscribe it to triggers, and Olira keeps sending there until you disable it.

The destination object is the same in both places: type, URL or email, subscribed triggers, optional digest batching, status, and a signing secret.

## Destination types

These are the types you can create today. New types will appear in the same Console picker and the same SDK create call; you will not need a different subscription or delivery model.

| Type        | What you configure  | Typical use                                                 |
| ----------- | ------------------- | ----------------------------------------------------------- |
| **Webhook** | A public HTTPS URL  | Your backend, or a workflow tool that accepts signed POSTs  |
| **Email**   | A recipient address | A mailbox that should hear about failures or a daily digest |

Webhook URLs must be public HTTPS. `http://`, `localhost`, and private or internal addresses are rejected when you save the destination and again every time Olira sends to it.

<Note>
  Store the signing secret as soon as it is shown. It is returned in plaintext
  once at create, and once if you rotate it; after that only the last four
  characters are visible. See [Receiving deliveries](/outbound-actions/receiving-deliveries).
</Note>

## Triggers

A trigger is the kind of occurrence that causes a delivery. Subscribe a destination to the ones you care about — in the Console, by ticking them; in the SDK, by passing `subscribed_triggers` (Python) or `subscribedTriggers` (C#).

Currently available triggers:

| Trigger                 | Fires when                                                                           |
| ----------------------- | ------------------------------------------------------------------------------------ |
| `patient.state.changed` | Something changed about a patient, such as new symptoms, lab results, or medications |
| `log.no_state_change`   | Olira received a log for a patient, but it didn't change anything known about them   |
| `org.mapping.failed`    | One of your incoming logs could not be translated into Olira's data model            |
| `ingestion.completed`   | A historical ingestion job you started finished successfully                         |
| `ingestion.failed`      | A historical ingestion job you started did not finish successfully                   |

Pass `["*"]` (or `ActionTrigger.ALL` / `ActionTrigger.All`) to subscribe to every currently available trigger. Because `"*"` is evaluated by the platform rather than by this list, that subscription could start receiving additional trigger types later. A typo'd plain string is not caught client-side; it reaches the server as a 422.

## Immediate delivery vs. digest batching

By default, every trigger fires its own delivery right away. For a high-frequency trigger like `patient.state.changed`, that means one webhook call or email per event, one per patient. Across many patients, that can be dozens of deliveries in a short window — rarely what you want for email, and easy to mistake for flooding on a webhook pointed at a chat tool.

**Digest batching** collects those deliveries and sends them as one summary, once a day, at a time of day you choose. In the Console each subscribed trigger has **Send immediately** or **Send at {time}**. In the SDK the same choice is `digest_schedule` on create or update.

`patient.state.changed` is the trigger we recommend batching; the Console defaults it that way when you subscribe. Every other currently available trigger is fine to leave on immediate delivery. That is a starting point, not a hard rule.

Digest deliveries are not instant: they sit until the next scheduled batch. Expect the first one on the same day you enable it only if that time of day has not already passed. `time_of_day` must land on a `:00` or `:30` boundary (the Console picker already does this).

## Create a destination

<CodeGroup>
  ```python Python theme={null}
  import olira
  from olira import ActionTrigger, WebhookDestinationConfig

  olira.init(api_key="YOUR_API_KEY")
  destination = olira.create_action_destination(
      config=WebhookDestinationConfig(url="https://hooks.example.com/olira"),
      subscribed_triggers=[ActionTrigger.PATIENT_STATE_CHANGED, ActionTrigger.INGESTION_FAILED],
  )
  print(destination.signing_secret)  # shown once, store it now
  ```

  ```csharp C# theme={null}
  using Olira;

  OliraModule.Init(apiKey: "YOUR_API_KEY");

  var destination = OliraModule.CreateActionDestination(
      webhookConfig: new WebhookDestinationConfig { Url = "https://hooks.example.com/olira" },
      subscribedTriggers: [ActionTrigger.PatientStateChanged, ActionTrigger.IngestionFailed]);
  Console.WriteLine(destination.SigningSecret); // shown once, store it now
  ```
</CodeGroup>

Full parameters, email destinations, digest schedule, rotate, and disable are in the [SDK reference](/reference/sdk/outbound-actions/create-action-destination).
