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

# API Quickstart

> Make your first Znift API call in under 2 minutes.

This page covers the **REST API** for developers and AI agents. If you're looking for how the product works, start with the [Introduction](/introduction) or browse the [Features](/features/quick-log) section.

## Prerequisites

* A Znift account at [znift.com](https://znift.com)
* An API key (created in Profile > API Keys)

## Step 1: Get your API key

1. Log in to [znift.com](https://znift.com)
2. Go to **Profile** > **API Keys**
3. Click **Create API Key**, give it a name
4. Copy the key immediately — it's only shown once

Your key looks like: `znift_abc123...xyz`

## Step 2: Create a task

<Note>Replace `YOUR_KEY` with your actual API key and use today's date in YYYY-MM-DD format.</Note>

```bash theme={null}
curl -X POST https://znift.com/api/v1/tasks \
  -H "x-api-key: znift_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Review pull request",
    "date": "2026-04-04",
    "priority": "high"
  }'
```

**Response (201 Created):**

```json theme={null}
{
  "_id": "k57abc123def456"
}
```

## Step 3: List your tasks

```bash theme={null}
curl "https://znift.com/api/v1/tasks?date=2026-04-04" \
  -H "x-api-key: znift_YOUR_KEY"
```

**Response (200):**

```json theme={null}
[
  {
    "_id": "k57abc123def456",
    "text": "Review pull request",
    "date": "2026-04-04",
    "isCompleted": false,
    "priority": "high",
    "dueTime": null,
    "timeSpent": null,
    "details": null,
    "order": 0,
    "createdAt": 1743724800000,
    "archivedAt": null,
    "previousDates": []
  }
]
```

## Step 4: Get your dashboard

The most useful endpoint for AI agents — one call gives you everything you need for a daily briefing:

```bash theme={null}
curl "https://znift.com/api/v1/tasks/dashboard?date=2026-04-04" \
  -H "x-api-key: znift_YOUR_KEY"
```

**Response (200):**

```json theme={null}
{
  "overdue": [],
  "pending": [
    {
      "_id": "k57abc123def456",
      "text": "Review pull request",
      "date": "2026-04-04",
      "isCompleted": false,
      "priority": "high",
      "dueTime": null,
      "timeSpent": null,
      "details": null,
      "order": 0,
      "createdAt": 1743724800000
    }
  ],
  "completedToday": [],
  "stats": {
    "pendingCount": 1,
    "completedTodayCount": 0,
    "streak": 3
  }
}
```

## Step 5: Complete a task

```bash theme={null}
curl -X POST "https://znift.com/api/v1/tasks/k57abc123def456/toggle" \
  -H "x-api-key: znift_YOUR_KEY"
```

**Response (200):**

```json theme={null}
{
  "success": true
}
```

The task's `isCompleted` flips from `false` to `true` (or vice versa).

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    API key security, rate limits, and both header formats
  </Card>

  <Card title="API Reference" icon="square-terminal" href="/api-reference/overview">
    All 13 endpoints with the interactive playground
  </Card>
</CardGroup>
