# Untimely Agent Integration Guide

Untimely lets agents schedule recurring prompts and actions through the same API used by dashboard users.

## Authentication

API keys are created in the dashboard by signed-in users. Agents use an existing key:

```http
Authorization: Bearer <UNTIMELY_API_KEY>
```

The OpenAPI document is available at https://untimely.app/openapi.json.

## Create An Event

Use `POST /api/events` with `Idempotency-Key` for safe retries. Supported action types are EMAIL and WEBHOOK.

For random schedules, provide `interval`, `frequency`, `betweenTimeStart`, `betweenTimeEnd`, and optional `daysOfWeek`.

For fixed schedules, set `scheduleType` to `deterministic`, then provide `fixedTime`, `timezone`, `interval`, and optional `daysOfWeek`.

## Read Status

Use `GET /api/events` to list recent events and `GET /api/events/{id}` to inspect one event. Schedule run details are available through `GET /api/events/{id}/schedules/{scheduleId}`.

## Update Or Delete

Use `PATCH /api/events/{id}` to update event settings. Use `DELETE /api/events/{id}` to remove an event.

## Webhook Notes

Webhook actions accept a method, URL, headers, and optional body. Use placeholder examples in prompts and avoid asking agents to store sensitive values in generated text.
