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

# Quickstart

> Send your first WhatsApp message in 5 minutes

# Quickstart

Get started with the TimelinesAI API in just a few steps.

## Prerequisites

> [!TIP]
>
> A TimelinesAI account with at least one connected WhatsApp number

> [!TIP]
>
> Basic familiarity with REST APIs

## Step 1: Get your API token

**1. Log in to TimelinesAI**

Go to [app.timelines.ai](https://app.timelines.ai) and sign in to your account.

**2. Navigate to API settings**

Click **Integrations** → **Public API** in the left sidebar.

**3. Copy your token**

Click **Copy** to copy your API token. Keep this secure—it provides full access to your workspace.

> [!WARNING]
>
> Never share your API token publicly or commit it to version control. Use environment variables in production.

## Step 2: Test your connection

Verify your token works by listing your WhatsApp accounts:

```bash cURL theme={null}
curl -X GET "https://app.timelines.ai/integrations/api/whatsapp_accounts" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

```javascript JavaScript theme={null}
const response = await fetch('https://app.timelines.ai/integrations/api/whatsapp_accounts', {
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
});
const data = await response.json();
console.log(data);
```

```python Python theme={null}
import requests

response = requests.get(
    'https://app.timelines.ai/integrations/api/whatsapp_accounts',
    headers={'Authorization': 'Bearer YOUR_API_TOKEN'}
)
print(response.json())
```

You should see a response like:

```json theme={null}
{
  "status": "ok",
  "data": [
    {
      "id": "14155551234@s.whatsapp.net",
      "phone": "+14155551234",
      "name": "Business WhatsApp",
      "connected": true
    }
  ]
}
```

## Step 3: Send your first message

Now send a message to a phone number:

```bash cURL theme={null}
curl -X POST "https://app.timelines.ai/integrations/api/messages" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+14155559999",
    "text": "Hello from TimelinesAI API! 🎉"
  }'
```

```javascript JavaScript theme={null}
const response = await fetch('https://app.timelines.ai/integrations/api/messages', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    phone: '+14155559999',
    text: 'Hello from TimelinesAI API! 🎉'
  })
});
const data = await response.json();
console.log(data);
```

```python Python theme={null}
import requests

response = requests.post(
    'https://app.timelines.ai/integrations/api/messages',
    headers={
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'Content-Type': 'application/json'
    },
    json={
        'phone': '+14155559999',
        'text': 'Hello from TimelinesAI API! 🎉'
    }
)
print(response.json())
```

> [!NOTE]
>
> Replace `+14155559999` with a real phone number. The recipient must have WhatsApp installed.

Success response:

```json theme={null}
{
  "status": "ok",
  "data": {
    "message_uid": "a5bbb005-37f2-402c-96fa-e479a2e09b02"
  }
}
```

> [!NOTE]
>
> Messages are queued and sent asynchronously. Use the `message_uid` to track delivery status.

## Step 4: Check message status

Track your message delivery:

```bash cURL theme={null}
curl -X GET "https://app.timelines.ai/integrations/api/messages/a5bbb005-37f2-402c-96fa-e479a2e09b02/status_history" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

```javascript JavaScript theme={null}
const response = await fetch(
  'https://app.timelines.ai/integrations/api/messages/a5bbb005-37f2-402c-96fa-e479a2e09b02/status_history',
  {
    headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' }
  }
);
const data = await response.json();
console.log(data);
```

```python Python theme={null}
import requests

response = requests.get(
    'https://app.timelines.ai/integrations/api/messages/a5bbb005-37f2-402c-96fa-e479a2e09b02/status_history',
    headers={'Authorization': 'Bearer YOUR_API_TOKEN'}
)
print(response.json())
```

## Next steps

> [card] [Send attachments](https://timelines.ai/docs/guides/file-attachments.md)
>
> Learn to send images and documents

> [card] [Set up webhooks](https://timelines.ai/docs/guides/webhooks.md)
>
> Receive real-time notifications

> [card] [Manage chats](https://timelines.ai/docs/guides/managing-chats.md)
>
> Organize and assign conversations

> [card] [API Reference](https://timelines.ai/docs/public-api-reference/overview.md)
>
> Explore all endpoints


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.