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

# Quick start

> Send your first SMS message in 5 minutes

## Prerequisites

Before you begin, you'll need:

1. An account on our messaging platform
2. A workspace created in your dashboard
3. Your messaging provider configured

## Step 1: Get your API key

Navigate to your workspace settings and generate an API key.

<Note>
  Keep your API key secure and never commit it to version control.
</Note>

## Step 2: Send your first message

Use your API key to send a message:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.yourdomain.com/api/messages \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "to": "+15551234567",
      "body": "Hello from the API!"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.yourdomain.com/api/messages', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      to: '+15551234567',
      body: 'Hello from the API!'
    })
  });

  const result = await response.json();
  console.log('Message sent:', result.sid);
  ```

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

  response = requests.post(
      'https://api.yourdomain.com/api/messages',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'to': '+15551234567',
          'body': 'Hello from the API!'
      }
  )

  result = response.json()
  print(f"Message sent: {result['sid']}")
  ```

  ```php PHP theme={null}
  $ch = curl_init('https://api.yourdomain.com/api/messages');
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
      'to' => '+15551234567',
      'body' => 'Hello from the API!'
  ]));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: Bearer YOUR_API_KEY',
      'Content-Type: application/json'
  ]);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

  $response = curl_exec($ch);
  $result = json_decode($response, true);
  echo "Message sent: " . $result['sid'];
  ```
</CodeGroup>

## Step 3: Check the response

A successful response will look like this:

```json theme={null}
{
  "sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "status": "queued"
}
```

The `sid` is a unique identifier for your message, and the `status` indicates the message has been queued for delivery.

## What's next?

<CardGroup cols={2}>
  <Card title="Send MMS messages" icon="image" href="/guides/sending-messages#mms">
    Learn how to send multimedia messages
  </Card>

  <Card title="Track delivery status" icon="chart-line" href="/guides/message-status">
    Monitor your message delivery in real-time
  </Card>

  <Card title="Handle errors" icon="triangle-exclamation" href="/guides/error-handling">
    Build robust error handling
  </Card>

  <Card title="View API reference" icon="book" href="/api-reference/messaging/send-message">
    See all available parameters
  </Card>
</CardGroup>
