---
title: "Create a new absence email rule"
method: POST
path: "/absence-email-rules"
tags: ["Absence Email Management"]
---

# Create a new absence email rule

`POST /absence-email-rules`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/absence-email-rules`
- Auth: HTTP bearer

Creates a new tier-based rule mapping an escalation tier + absence scenario to a template or no-email flag. Prevents duplicate rules.

## Request body

- object
  - `escalation_tier` 'first_warning' | 'first_warning_with_offer' | 'mid_escalation' | 'deferral_offer' | 'forced_deferral', required
  - `absence_type` 'unexcused' | 'business' | 'personal' | 'any', required
  - `is_first_session` boolean
  - `no_email` boolean
  - `template_id` string, uuid, nullable
  - `priority` integer, required

## Response `201`

Rule created successfully

## Other responses

- `400`: Invalid template_id/no_email combination
- `401`: Unauthorized
- `409`: Duplicate rule exists
- `422`: Validation failed

---

[API](https://skmtc.dev/withmedley/apis/medley-api.md) - [All operations](https://skmtc.dev/withmedley/apis/medley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/withmedley/apis/medley-api/revisions/40aaac5ca6bd?raw)
