# inxdays API — SKILL

> **For AI agents and headless automation.**
> **API Docs:** <https://inxdays.com/api/index.en.html>  
> **OpenAPI spec:** <https://api.inxdays.com/openapi.json>

This document describes how to interact with the [inxdays](https://inxdays.com) reminder API programmatically.

## Quick Start

1. Go to <https://app.inxdays.com> and create an account (or log in)
2. Navigate to **User → API** tab and create an API key
3. Copy the full token (`<clientid>:<secretKey>`) — **this is only shown once**
4. Use it against the API base URL: **`https://api.inxdays.com`**

## Authentication

All API requests require an API key via the `Authorization` header:

```
Authorization: Bearer <clientid>:<secretKey>
```

**Base URL:** `https://api.inxdays.com`

Generate keys at `https://app.inxdays.com` → User settings → API tab.

## Reminder Endpoints

### List Reminders

```
GET /reminder
```

Returns all reminders for the authenticated user.

**Query parameters:**
- `page` (optional) — page number, default `1`
- `limit` (optional) — max results per page, default `20`
- `search` (optional) — filter by title/description (partial match)

**Response:**
```json
{
  "total": 5,
  "activeCount": 3,
  "page": 1,
  "limit": 20,
  "reminders": [
    {
      "id": "abc123",
      "title": "Renew domain",
      "description": "Renew inxdays.com before it expires",
      "eventDate": "2026-06-15T00:00:00.000Z",
      "reminderDates": ["2026-06-08T00:00:00.000Z", "2026-06-14T00:00:00.000Z", "2026-06-15T00:00:00.000Z"],
      "nextReminderAt": "2026-06-08T00:00:00.000Z",
      "notificationTypes": ["email"],
      "sentDates": [],
      "createdAt": "2026-05-27T12:00:00.000Z",
      "updatedAt": "2026-05-27T12:00:00.000Z"
    }
  ]
}
```

### Create Reminder

```
POST /reminder
```

Create a new reminder.

**Request body:**
```json
{
  "title": "Renew insurance",
  "description": "Annual home insurance renewal",
  "eventDate": "2026-07-01T00:00:00.000Z",
  "notificationTypes": ["email"]
}
```

- `title` (required) — short title (max 100 chars)
- `description` (optional) — details (max 500 chars)
- `eventDate` (required) — ISO 8601 date/time when the event occurs (UTC)
- `notificationTypes` (optional) — array of `["email", "push", "sms"]`, default `["email"]`

**Response:** the created reminder object (HTTP 201)

### Get Reminder

```
GET /reminder/:id
```

Returns a single reminder by its ID.

**Response:** single reminder object (same shape as above)

### Update Reminder

```
PUT /reminder/:id
```

Update an existing reminder (partial update, only send fields to change).

**Request body (all fields optional):**
```json
{
  "title": "Renew insurance (urgent)",
  "eventDate": "2026-07-15T00:00:00.000Z"
}
```

**Response:** updated reminder object

### Delete Reminder

```
DELETE /reminder/:id
```

Permanently delete a reminder.

**Response:**
```json
{ "ok": true }
```

## CLI (Recommended for AI Agents)

The easiest way to use the API is via the official CLI:

```bash
# Install (no dependencies, just Node.js 18+)
npm install -g @inxdays/cli

# Or use with npx
npx @inxdays/cli --help
```

### Quick Start

```bash
# 1. Set your API token (from app.inxdays.com → API tab)
inxdays auth sk-xxxxx:yyyyy

# 2. Create a reminder
inxdays create "Pay taxes" --date 2026-06-30

# 3. List reminders
inxdays list

# 4. Create with notifications
inxdays create "Review contract" --date 2026-07-15 --desc "Q3 contract review" --notify email,push
```

### Commands

| Command | Description |
|---|---|
| `inxdays auth <token>` | Save API token to `~/.config/inxdays/token` |
| `inxdays list [--search q] [--limit N]` | List reminders |
| `inxdays create <title> --date <ISO> [--desc text] [--notify email,push,sms]` | Create reminder |
| `inxdays get <id>` | Get reminder by ID |
| `inxdays update <id> [--title t] [--date ISO] [--desc d]` | Update reminder |
| `inxdays delete <id>` | Delete reminder |
| `inxdays logout` | Clear saved token |

### Environment Variables

| Variable | Description |
|---|---|
| `INXDAYS_TOKEN` | API key (`clientid:secretKey`) — overrides saved token |
| `INXDAYS_API_URL` | API base URL — default: `https://api.inxdays.com` |

### Notification Types

Use `--notify` to specify notification channels (comma-separated):

```bash
inxdays create "Pay rent" --date 2026-06-01 --notify email,push,sms
```

Available types:
- `email` — Email notification (free)
- `push` — Browser push notification (free)
- `sms` — SMS notification (requires credits)

Default: `email` only.

## Example (cURL)

```bash
# Create a reminder
curl -X POST https://api.inxdays.com/reminder \
  -H "Authorization: Bearer sk-xxxxx:yyyyy" \
  -H "Content-Type: application/json" \
  -d '{"title":"Pay taxes","description":"Annual tax deadline","eventDate":"2026-06-30T00:00:00.000Z","notificationTypes":["email","push"]}'

# Create with SMS notification
curl https://api.inxdays.com/reminder \
  -H "Authorization: Bearer sk-xxxxx:yyyyy"

# Get a reminder
curl https://api.inxdays.com/reminder/abc123 \
  -H "Authorization: Bearer sk-xxxxx:yyyyy"

# Update a reminder
curl -X PUT https://api.inxdays.com/reminder/abc123 \
  -H "Authorization: Bearer sk-xxxxx:yyyyy" \
  -H "Content-Type: application/json" \
  -d '{"title":"Pay taxes (urgent)"}'

# Delete a reminder
curl -X DELETE https://api.inxdays.com/reminder/abc123 \
  -H "Authorization: Bearer sk-xxxxx:yyyyy"
```

## Rate Limiting

API requests are rate-limited to **100 requests per 15 minutes** per IP.
If you exceed the limit, you will receive a `429 Too Many Requests` response.

## Error Handling

All errors return a JSON body:

```json
{ "error": "message" }
```

Common HTTP status codes:
- `400` — Bad request (invalid parameters, missing required fields)
- `401` — Unauthorized (invalid or missing API key)
- `403` — Forbidden (quota exceeded, e.g. max active reminders)
- `404` — Not found (reminder doesn't exist)
- `429` — Too many requests (rate limit exceeded)
- `500` — Internal server error

## Notes

- The API returns dates in ISO 8601 format (UTC)
- Reminders use the **Reverse Spacing** algorithm to calculate optimal notification dates:
  - < 7 days: 1 day before, day of event
  - 7–30 days: 7d, 1d, day of event
  - 30–90 days: 30d, 7d, 1d, day of event
  - > 90 days: 90d, 30d, 7d, 1d, day of event
- `notificationDates` are automatically calculated from `eventDate`
- Maximum active reminders per user is configurable (default: 50)
