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

# Power Automate without the absentify connector

> Integrate Power Automate with absentify without the connector — call the API via HTTP action with an API key, and receive events through webhook triggers.

The absentify **Connector** for Power Automate covers the most common triggers and a small set of actions out of the box. When you need something the connector does not yet expose, you can integrate Power Automate with absentify manually in two complementary ways — both covered on this page:

* **Outbound — HTTP action + API key:** Power Automate calls the absentify API on demand to read or modify data (e.g. create a member, update an allowance, read workspace settings).
* **Inbound — webhook trigger:** absentify pushes events (request created, status changed, user created or updated) to a Power Automate flow, no polling required.

<Info>
  An expanded connector with full coverage of members, departments, leave types, requests, public holidays, workspace settings, and absences is currently in Microsoft certification. Until it is published, the HTTP action and the webhook trigger are the recommended ways to integrate.
</Info>

***

## When to use which approach

| You want to…                                                                    | Use                                                  |
| :------------------------------------------------------------------------------ | :--------------------------------------------------- |
| React to a new request, approve, or post to Teams with the standard fields      | absentify **Connector** ([guide](./power_automate))  |
| Create or update members, departments, leave types, allowances, schedules, etc. | **HTTP action + API key** *(part 1 below)*           |
| React to absentify events in real time without polling                          | **Inbound webhook trigger** *(part 2 below)*         |
| Build a flow in a tenant that does not yet have the connector                   | **HTTP action** and/or **webhook trigger** *(below)* |

***

# Part 1 — Outbound: HTTP action with API key

## Prerequisites

* An absentify workspace on the **Plus plan** (the API is a Plus feature).
* A **Power Automate** license that includes the **HTTP** premium action (any plan that allows premium connectors, e.g. *Power Automate Premium*).
* Permission in absentify to generate an API key (workspace owner or admin).

***

## Step 1: Generate an API key in absentify

<Steps>
  <Step title="Open API settings">
    In absentify, go to **Settings → Integrations** and find the **API** section. Full details: [Configuring API access](./api_key).
  </Step>

  <Step title="Generate the key">
    Select **Get API key**. The key is shown **once** — copy it immediately and store it somewhere safe (a password manager or Azure Key Vault).
  </Step>

  <Step title="Treat it like a password">
    The key has the permissions of the workspace. Anyone with the key can read and modify your absence data.
  </Step>
</Steps>

<Warning>
  Never paste the API key directly into a flow that you share, export, or commit to source control. Use a secure variable, an environment variable, or Azure Key Vault — see [Storing the key securely](#storing-the-key-securely) below.
</Warning>

***

## Step 2: Add an HTTP action to your flow

<Steps>
  <Step title="Open or create your flow">
    Go to [Power Automate](https://flow.microsoft.com), open the flow you want to extend, and add a new step.
  </Step>

  <Step title="Pick the HTTP action">
    Search for **HTTP** and select **HTTP — HTTP** (the premium built‑in action, not *HTTP with Microsoft Entra ID*).
  </Step>
</Steps>

***

## Step 3: Configure the HTTP request

Use the values below. Replace `your_api_key_here` with the key from Step 1 and select the endpoint that matches what you want to do (see [API reference](/docs/en/api-reference)).

| Field       | Value                                                                  |
| :---------- | :--------------------------------------------------------------------- |
| **Method**  | `GET`, `POST`, `PUT`, or `DELETE` (depending on the endpoint)          |
| **URI**     | `https://api.absentify.com/api/v1/<endpoint>`                          |
| **Headers** | `x-api-key: your_api_key_here` <br /> `Content-Type: application/json` |
| **Body**    | JSON payload (only for `POST` / `PUT`)                                 |

### Example: list all leave requests

```http theme={null}
GET https://api.absentify.com/api/v1/requests?start=2026-01-01&end=2026-12-31
x-api-key: your_api_key_here
Content-Type: application/json
```

<Warning>
  The list endpoints (`/requests`, `/requests_per_day`, `/absences_per_day`) require `start` and `end`, and the window between them may span at most **1826 days (5 years)**. A far-future end date such as `end=2100-12-31` is rejected with a `400` response — request the period you actually need, and page through longer periods in windows of 5 years or less.
</Warning>

### Example: create a leave request

```http theme={null}
POST https://api.absentify.com/api/v1/requests
x-api-key: your_api_key_here
Content-Type: application/json

{
  "requester_member_id": "mem_abc123",
  "leave_type_id": "lt_xyz789",
  "start": "2026-06-01",
  "end": "2026-06-05",
  "start_at": "morning",
  "end_at": "end_of_day"
}
```

<Tip>
  Browse all available endpoints, parameters, and example payloads in the [API reference](/docs/en/api-reference). Use the **Try it** panel there to validate a request before wiring it into Power Automate.
</Tip>

***

## Step 4: Parse the JSON response

Most endpoints return JSON. To use values from the response in later steps, add a **Parse JSON** action after the HTTP action.

<Steps>
  <Step title="Add Parse JSON">
    Add a new step → search for **Parse JSON**.
  </Step>

  <Step title="Set Content">
    Set **Content** to the **Body** dynamic content of the HTTP action.
  </Step>

  <Step title="Generate schema from sample">
    Select **Generate from sample** and paste a real response from the [API reference](/docs/en/api-reference) or from a test call. Power Automate builds the schema for you.
  </Step>
</Steps>

After this step, every field of the response is available as **dynamic content** in subsequent actions (e.g. *Send an email*, *Post message in Teams*, *Update a row in Dataverse*).

***

## Storing the key securely

Hard‑coding the API key into the HTTP action works, but anyone with access to the flow definition can read it. Use one of these patterns instead:

* **Environment variable (recommended for solutions):** Create a *Secret* environment variable in your solution, store the key there, and reference it from the HTTP action.
* **Azure Key Vault:** Store the key in Key Vault and add a *Get secret* action before the HTTP action. Pass the secret to the `x-api-key` header.
* **Secure input/output:** On the HTTP action, open **Settings** and enable **Secure Inputs** and **Secure Outputs** so the key is not written to run history.

<Warning>
  If you accidentally exposed your API key (e.g. in a shared flow export), regenerate it immediately in **Settings → Integrations → API**. The old key stops working as soon as a new one is created.
</Warning>

***

## Handling errors

The API uses standard HTTP status codes. Add a **Condition** or **Configure run after** on the next step to react to failures.

| Status        | Meaning                                            | What to do                                                                |
| :------------ | :------------------------------------------------- | :------------------------------------------------------------------------ |
| `200` / `201` | Success                                            | Continue with Parse JSON.                                                 |
| `400`         | Bad request — invalid payload                      | Check the body against the [API reference](/docs/en/api-reference).            |
| `401`         | Unauthorized — invalid or missing key              | Verify the `x-api-key` header and that the key is still active.           |
| `403`         | Forbidden — key lacks permission for this resource | Use a key from a workspace owner.                                         |
| `429`         | Rate limited                                       | Add a **Delay** action and retry. See [Limits](/docs/en/api-reference/limits). |
| `5xx`         | Server error                                       | Retry with exponential backoff.                                           |

***

## Example flow: daily absence digest in Teams

A common pattern combining everything above:

<Steps>
  <Step title="Trigger">
    **Recurrence** — every weekday at 08:00.
  </Step>

  <Step title="HTTP">
    `GET https://api.absentify.com/api/v1/absences/per-day?start=...&end=...` with the `x-api-key` header.
  </Step>

  <Step title="Parse JSON">
    Generate the schema from a sample response.
  </Step>

  <Step title="Compose / Select">
    Build a Markdown summary from the parsed array.
  </Step>

  <Step title="Post in Teams">
    Send the summary to a Teams channel using **Post message in a chat or channel**.
  </Step>
</Steps>

***

***

# Part 2 — Inbound: webhook trigger

If you want Power Automate to **react** to changes in absentify (request created, status changed, user created or updated) without polling, use a webhook trigger. absentify sends a JSON `POST` to a Power Automate URL whenever the event occurs.

## How it works

```
absentify event  ──►  HTTP POST (JSON)  ──►  Power Automate flow runs
```

You create a flow whose trigger is a public URL, then register that URL as a webhook in absentify.

***

## Step 1: Create a flow with the HTTP request trigger

<Steps>
  <Step title="New instant flow">
    In [Power Automate](https://flow.microsoft.com), select **Create → Instant cloud flow**.
  </Step>

  <Step title="Pick the trigger">
    Select **When a HTTP request is received** as the trigger. (This trigger is included in standard Power Automate plans — it is **not** a premium connector.)
  </Step>

  <Step title="Set Method to POST">
    In the trigger settings, set **Who can trigger the flow** to **Anyone** and the method to **POST**.
  </Step>
</Steps>

***

## Step 2: Generate the request schema

Paste a sample webhook payload into **Use sample payload to generate schema** so Power Automate exposes every field as dynamic content in later steps.

```json theme={null}
{
  "event_type": "request_created",
  "body": {
    "id": "req_example",
    "createdAt": "2026-04-29T08:00:00.000Z",
    "start": "2026-06-01",
    "end": "2026-06-05",
    "status": "PENDING",
    "leave_type": { "id": "lt_xyz", "name": "Vacation" },
    "requester_member": { "id": "mem_abc", "name": "Jane Doe", "email": "jane@example.com" }
  }
}
```

<Tip>
  Use the full v2 payloads documented in [Webhook reference](/docs/en/api-reference/webhooks) — they match the `GET /api/v1/requests/{id}` and `GET /api/v1/members/{id}` responses.
</Tip>

***

## Step 3: Add follow-up actions and save the flow

Add the actions you want. Examples: **Post message in a chat or channel** (Teams), **Send an email**, or **Update a row in Dataverse**. Use the dynamic content from the trigger to fill in fields.

Once you select **Save**, Power Automate displays the **HTTP POST URL** at the top of the trigger. Select the copy icon next to it.

<Warning>
  This URL contains a SAS signature that lets anyone who has it trigger your flow. Treat it like a secret. If it leaks, regenerate it (open the trigger → **…** → **Regenerate URL**) and update the webhook in absentify.
</Warning>

***

## Step 4: Register the URL as a webhook in absentify

<Steps>
  <Step title="Open webhook settings">
    In absentify, go to **Settings → Integrations** and find the **Webhooks** section. Full details: [Webhook integration](./webhooks).
  </Step>

  <Step title="Configure the URL">
    Select **Configure URL** and paste the Power Automate URL from Step 3.
  </Step>

  <Step title="Select the event type">
    Pick **All Events** or one of: `request_created`, `request_status_changed`, `user_created`, `user_updated`.
  </Step>

  <Step title="Select payload v2">
    Always pick **v2** for new integrations. v1 is deprecated.
  </Step>

  <Step title="Save">
    Select **Add**.
  </Step>
</Steps>

***

## Step 5: Test the flow

Trigger the event in absentify (for example, create a request) and open **My flows → Run history** in Power Automate. You should see a successful run with the absentify payload.

If a run does not appear, check:

* The webhook is saved with the **same URL** that the flow trigger now shows.
* The flow is **enabled**.
* The event type matches what you triggered.

***

## Outbound or inbound — combine them

The two approaches work well together. A typical pattern:

<Steps>
  <Step title="Inbound webhook">
    Flow is triggered by `request_status_changed`.
  </Step>

  <Step title="Branch on status">
    A **Condition** checks whether the status is `APPROVED`.
  </Step>

  <Step title="Outbound HTTP">
    On approval, an **HTTP action** calls `GET /api/v1/members/{id}` (using the API key from Part 1) to fetch the requester's department, manager, or custom fields that are not in the webhook payload.
  </Step>

  <Step title="Act">
    Post to Teams, update Dataverse, sync to your HRIS.
  </Step>
</Steps>

***

## Next steps

* [API reference](/docs/en/api-reference) — full list of endpoints, parameters, and example payloads.
* [Authentication](/docs/en/api-reference/authentication) — details of the `x-api-key` header.
* [Webhook reference](/docs/en/api-reference/webhooks) — payload schemas for all event types.
* [Webhook integration](./webhooks) — set up and manage webhooks in the absentify dashboard.
* [Limits](/docs/en/api-reference/limits) — rate limits to design around.
* [absentify Connector for Power Automate](./power_automate) — go back to the connector-based flow.
