---
title: "Automations for link expiry and scheduled changes · Flared"
description: "Change a Flared short link's destination, turn it off, send a webhook, post in Slack or Teams, or email the owner on an end date, a number of days after creation, a click count, or a broken destination."
---

Documentation

# Automations

An automation is a template: one trigger, then one to five actions. The workspace owner creates templates on the Automations page in the dashboard. The owner and members apply them to links from the Links page, the API, or an AI assistant. Each applied template runs once on its link.

## Triggers

**End date**

The date and time that you set when you apply the template to a link. Each link can have its own date.

**Days after creation**

A number of days after the link was created, from 1 to 3,650.

**Clicks**

The link passes a number of counted clicks: a multiple of 100, from 100 to 100,000,000. Flared counts clicks as it does for webhook click milestones.

**Destination stops loading**

Two checks in a row find that the link’s destination does not load. See Destination checks below.

When the trigger is already met at the time you apply the template, such as an end date in the past, the template runs within 10 minutes.

## Destination checks

For each link with a Destination stops loading template, Flared requests the destination about every 6 hours. Each request has the user agent `Flared-LinkCheck/1.0`.

- A check is a GET request. It follows up to 2 redirects, so it makes at most 3 requests. Each request has 10 seconds to answer.
- A check fails when the request gets no connection, no answer within 10 seconds, or a 404, 410, or 5xx status.
- Other answers show that the site is up, including 401, 403, 429, and a 503 Cloudflare challenge.
- Two failed checks in a row of the same destination run the automation. A check that passes starts the count again, and so does a change to the destination.

Flared cannot check a destination on an IP address, a private hostname, or a Flared address, and you cannot apply the template to such a link. When a destination or a redirect moves to one later, the template waits and the check does not count as failed. The link’s page shows the time and the result of the last check.

## Actions

A template has each action at most once. The actions run in this order:

**Change the destination**

The link goes to a new URL. The short URL stays the same.

**Turn off the link**

The short URL stops redirecting. You can turn the link back on at any time.

**Send a webhook**

Flared sends an automation.triggered event to one webhook endpoint of the workspace, signed and retried like the other webhook events.

**Post a message**

Flared posts in one Slack or Microsoft Teams channel that the owner added on the Slack or Teams page. The post names the automation, its trigger, the link, and the actions that ran.

**Email the workspace owner**

One email for each template and run. It names the automation and the short URL, or the number of links when the template ran on more than one.

For link expiry, use an end date template that turns off the link. When an action changes a link, endpoints that subscribe to `link.updated` or `link.disabled` also get that event. See [Webhooks](https://flared.page/docs/webhooks). To set up Post a message, see [Slack](https://flared.page/docs/slack) or [Microsoft Teams](https://flared.page/docs/teams).

## Timing

- Flared runs due automations within 10 minutes of the trigger. A click trigger counts a click after Flared records it.
- An applied template runs once on its link. To run it again, apply it again. Applying a template that still waits, with the same end date, changes nothing.
- The link’s page in the dashboard shows each template on the link as waiting, done, failed, or skipped. The Automations page shows the runs of each template.
- A template that is off when its trigger is met is skipped on that link.

## Limits

- Plus and Founding Lifetime keep 25 templates per workspace. Free does not include automations. See [pricing](https://flared.page/pricing).
- A link takes up to 5 templates.
- One request or tool call applies a template to up to 100 links.
- When Plus ends, a template whose trigger is met is skipped.
- Flared keeps the record of each run for 90 days.
- A self-hosted installation keeps 25 templates by default. Its owner changes the number on the Limits page. It has no email action and no Post a message action.

## Webhook payload

The Send a webhook action sends `automation.triggered` to the endpoint that the template names. Endpoints cannot subscribe to this event. The request has the same headers and signature as the other [webhook events](https://flared.page/docs/webhooks).

`data.automation` has the template’s ID, name, and trigger. `data.link` is the link after the actions changed it. `data.actions` lists the actions of the template, in the order they run. The trigger is `end_date` with `endsAt`, `link_age` with `days`, `clicks` with `clicks`, or `destination_down` with `lastResult`, the result of the last check, such as `404` or `timeout`.

```
{
  "id": "evt_5d2e8f1a9b3c4d7e8f0a1b2c3d4e5f60",
  "type": "automation.triggered",
  "timestamp": "2026-11-01T09:04:12.345Z",
  "workspace": {
    "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
  },
  "data": {
    "automation": {
      "id": "aut_1a2b3c4d5e6f47a8b9c0d1e2f3a4b5c6",
      "name": "Spring sale ends",
      "trigger": {
        "type": "end_date",
        "endsAt": "2026-11-01T09:00:00.000Z"
      }
    },
    "link": {
      "id": "3b241101-e2bb-4255-8caf-4136c566a962",
      "domainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "hostname": "go.example.com",
      "slug": "spring-sale",
      "shortUrl": "https://go.example.com/spring-sale",
      "destination": "https://example.com/sale-ended",
      "title": "Spring sale",
      "iosDestination": null,
      "androidDestination": null,
      "enabled": true,
      "blocked": null,
      "createdAt": "2026-10-17T09:12:30.123Z",
      "updatedAt": "2026-11-01T09:04:12.345Z"
    },
    "actions": [
      "change_destination",
      "send_webhook"
    ]
  }
}
```

## API

Send requests to `https://api.flared.page/v1` with an API token as a bearer token. Create and edit templates in the dashboard.

**`GET /v1/automations` links:read**

Lists the templates, the number of links each one is on, and the workspace limit.

**`GET /v1/links/{id}/automations` links:read**

Lists the templates on one link, with their state: waiting, done, failed, or skipped.

**`PUT /v1/links/{id}/automations/{automationId}` links:write**

Applies a template to one link. An end date template needs endsAt in the body.

**`DELETE /v1/links/{id}/automations/{automationId}` links:write**

Takes a template off a link. The template stays in the workspace.

**`POST /v1/automations/{id}/links` links:write**

Applies a template to up to 100 links. The body has linkIds and, for an end date template, endsAt. The answer has a result for each link: applied, unchanged, or failed with an error.

`endsAt` is an ISO 8601 date and time with an offset, such as `2026-11-01T09:00:00Z`.

```
curl https://api.flared.page/v1/automations/aut_1a2b3c4d5e6f47a8b9c0d1e2f3a4b5c6/links \
  -H "Authorization: Bearer $FLARED_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"linkIds":["3b241101-e2bb-4255-8caf-4136c566a962"],"endsAt":"2026-11-01T09:00:00Z"}'
```

The [OpenAPI description](https://api.flared.page/v1/openapi.json) lists each route, its scope, and its responses.

## AI assistants

The MCP server has three automation tools. Ask your assistant, for example, to apply your Spring sale ends template to the spring-sale link on 1 November at 09:00 UTC.

**`list_automations`**

Lists the templates of the workspace. With a link, it lists the templates on that link and their state.

**`apply_automation`**

Applies a template to up to 100 links, with an end date for an end date template.

**`remove_automation`**

Takes a template off a link.

[Connect an AI assistant](https://flared.page/docs/assistants) has every step and the other tools.

## Support

Email [support@flared.page](mailto:support@flared.page). The other ways to use Flared are in the [documentation](https://flared.page/docs).
