---
title: "Create or update a wait-time alert"
---

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

# Create or update a wait-time alert

Path: FlightQueue API › Alerts

`POST /alerts`

Creates an alert, or updates the threshold if the key owner already has one for the airport. Requires a user-scoped key. The airport must have a live wait-time feed. Thresholds are 1 to 240 minutes. Each user can hold up to 20 alerts.

Access: User-scoped key (MCP OAuth or developer key).

## Authentication

Requires one of the following:

- `BearerAuth`, http, header `Authorization`
- `ApiKeyAuth`, apiKey, in header, header `X-API-Key`

## Request body

_Required._

- `airportCode` (`createWaitTimeAlert.airportCode`; string, required) — Three-letter IATA code of an airport with a live wait-time feed.
  - pattern `^[A-Za-z]{3}$`
- `thresholdMinutes` (`createWaitTimeAlert.thresholdMinutes`; integer, required) — Wait time in minutes that triggers the alert.
  - min 1; max 240
- `direction` (`createWaitTimeAlert.direction`; string, optional) — Trigger when the wait is above or below the threshold.
  - one of `"above"`, `"below"`; default `"above"`

## Example request

```json
{
  "airportCode": "JFK",
  "thresholdMinutes": 30,
  "direction": "above"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://flightqueue.com/api/v1/alerts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "airportCode": "JFK",
  "thresholdMinutes": 30,
  "direction": "above"
}
'
```

### TypeScript

```typescript
const url = 'https://flightqueue.com/api/v1/alerts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({airportCode: 'JFK', thresholdMinutes: 30, direction: 'above'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://flightqueue.com/api/v1/alerts"

payload = {
    "airportCode": "JFK",
    "thresholdMinutes": 30,
    "direction": "above"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Success

#### Example

```json
{
  "success": true,
  "data": {
    "alert": {
      "id": "101",
      "airportCode": "JFK",
      "thresholdMinutes": 30,
      "direction": "above",
      "createdAt": "2026-11-07T11:00:00.000Z"
    }
  },
  "meta": {
    "requestId": "3f8c2b1e-6d4a-4f7b-9a1e-2c5d8e7f0a12",
    "timestamp": "2026-11-07T12:00:00.000Z"
  }
}
```

- `success` (`createWaitTimeAlert.response.200.success`; boolean, required)
- `data` (`createWaitTimeAlert.response.200.data`; object, required)
  - `alert` (`createWaitTimeAlert.response.200.data.alert`; object, required)
    - `id` (`createWaitTimeAlert.response.200.data.alert.id`; string, required)
    - `airportCode` (`createWaitTimeAlert.response.200.data.alert.airportCode`; string, required)
      - pattern `^[A-Z]{3}$`
    - `thresholdMinutes` (`createWaitTimeAlert.response.200.data.alert.thresholdMinutes`; integer, required)
      - min -9007199254740991; max 9007199254740991
    - `direction` (`createWaitTimeAlert.response.200.data.alert.direction`; string, required)
      - one of `"above"`, `"below"`
    - `createdAt` (`createWaitTimeAlert.response.200.data.alert.createdAt`; string, required) — ISO 8601 timestamp in UTC.
      - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
- `meta` (`createWaitTimeAlert.response.200.meta`; object, required)
  - `requestId` (`createWaitTimeAlert.response.200.meta.requestId`; string, required) — Unique ID for this request. Quote it when you contact support.
    - format `uuid`; pattern `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$`
  - `timestamp` (`createWaitTimeAlert.response.200.meta.timestamp`; string, required) — ISO 8601 timestamp in UTC.
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`

### 400

Bad request

#### Example

```json
{
  "success": false,
  "error": {
    "code": "INVALID_BODY",
    "message": "The body is invalid, the airport has no live feed, or the user has too many alerts."
  }
}
```

- `success` (`createWaitTimeAlert.response.400.success`; boolean, required)
- `error` (`createWaitTimeAlert.response.400.error`; object, required)
  - `code` (`createWaitTimeAlert.response.400.error.code`; string, required) — Machine-readable error code.
    - one of `"MISSING_API_KEY"`, `"INVALID_API_KEY"`, `"RATE_LIMIT_EXCEEDED"`, `"PREMIUM_REQUIRED"`, `"ENTERPRISE_REQUIRED"`, `"INVALID_AIRPORT"`, `"INVALID_DATE"`, `"INVALID_BODY"`, `"TOO_MANY_AIRPORTS"`, `"NOT_FOUND"`, `"INTERNAL_ERROR"`
  - `message` (`createWaitTimeAlert.response.400.error.message`; string, required) — Human-readable explanation.

### 401

Unauthorized

#### Example

```json
{
  "success": false,
  "error": {
    "code": "MISSING_API_KEY",
    "message": "No API key was sent in X-API-Key or Authorization."
  }
}
```

- `success` (`createWaitTimeAlert.response.401.success`; boolean, required)
- `error` (`createWaitTimeAlert.response.401.error`; object, required)
  - `code` (`createWaitTimeAlert.response.401.error.code`; string, required) — Machine-readable error code.
    - one of `"MISSING_API_KEY"`, `"INVALID_API_KEY"`, `"RATE_LIMIT_EXCEEDED"`, `"PREMIUM_REQUIRED"`, `"ENTERPRISE_REQUIRED"`, `"INVALID_AIRPORT"`, `"INVALID_DATE"`, `"INVALID_BODY"`, `"TOO_MANY_AIRPORTS"`, `"NOT_FOUND"`, `"INTERNAL_ERROR"`
  - `message` (`createWaitTimeAlert.response.401.error.message`; string, required) — Human-readable explanation.

### 429

Too many requests

#### Example

```json
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "The key sent more requests per minute than its tier allows."
  }
}
```

- `success` (`createWaitTimeAlert.response.429.success`; boolean, required)
- `error` (`createWaitTimeAlert.response.429.error`; object, required)
  - `code` (`createWaitTimeAlert.response.429.error.code`; string, required) — Machine-readable error code.
    - one of `"MISSING_API_KEY"`, `"INVALID_API_KEY"`, `"RATE_LIMIT_EXCEEDED"`, `"PREMIUM_REQUIRED"`, `"ENTERPRISE_REQUIRED"`, `"INVALID_AIRPORT"`, `"INVALID_DATE"`, `"INVALID_BODY"`, `"TOO_MANY_AIRPORTS"`, `"NOT_FOUND"`, `"INTERNAL_ERROR"`
  - `message` (`createWaitTimeAlert.response.429.error.message`; string, required) — Human-readable explanation.

### 500

Server error

#### Example

```json
{
  "success": false,
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "The alert could not be saved."
  }
}
```

- `success` (`createWaitTimeAlert.response.500.success`; boolean, required)
- `error` (`createWaitTimeAlert.response.500.error`; object, required)
  - `code` (`createWaitTimeAlert.response.500.error.code`; string, required) — Machine-readable error code.
    - one of `"MISSING_API_KEY"`, `"INVALID_API_KEY"`, `"RATE_LIMIT_EXCEEDED"`, `"PREMIUM_REQUIRED"`, `"ENTERPRISE_REQUIRED"`, `"INVALID_AIRPORT"`, `"INVALID_DATE"`, `"INVALID_BODY"`, `"TOO_MANY_AIRPORTS"`, `"NOT_FOUND"`, `"INTERNAL_ERROR"`
  - `message` (`createWaitTimeAlert.response.500.error.message`; string, required) — Human-readable explanation.


Source: https://flightqueue.com/developers/reference/api/alerts/create/index.md
