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

# Get Started with SmsManager in 5 Minutes

> Send your first SMS with SmsManager's JSON API v2. Learn how to authenticate, build a request, and handle the response in minutes.

This guide walks you through sending your first SMS with SmsManager's JSON API v2. By the end, you'll have made a successful API call, received a `message_id`, and know where to go next to explore advanced features like multi-channel flows and delivery webhooks.

<Note>
  **Prerequisites:** You need an SmsManager account and an API key before you begin. Retrieve your key from [app.smsmanager.com/api-cloud](https://app.smsmanager.com/api-cloud).
</Note>

<Steps>
  <Step title="Get your API key">
    Log in to your SmsManager account and navigate to [API & Cloud](https://app.smsmanager.com/api-cloud). Your primary API key is displayed on that page. Copy it — you'll pass it as the `x-api-key` header in every request.

    If you need a scoped key for a specific integration (for example, to isolate credits or simplify revocation), you can create sub-keys through the [REST API](/en/api-reference/rest/overview).
  </Step>

  <Step title="Send your first message">
    Send a POST request to `https://api.smsmngr.com/v2/message` with a JSON body containing the message text and at least one recipient phone number in international E.164 format (without a leading `+` or `00`).

    **Request body:**

    ```json theme={null}
    {
      "body": "Hello from SmsManager!",
      "to": [
        { "phone_number": "420777123456" }
      ]
    }
    ```

    **cURL:**

    ```bash theme={null}
    curl -X POST https://api.smsmngr.com/v2/message \
      -H "x-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"body": "Hello from SmsManager!", "to": [{"phone_number": "420777123456"}]}'
    ```

    Replace `YOUR_API_KEY` with the key you copied in Step 1 and `420777123456` with the destination phone number.
  </Step>

  <Step title="Check the response">
    A successful request returns HTTP `200` with a JSON body similar to the following:

    ```json theme={null}
    {
      "request_id": "bc36f3d1-d284-463a-921b-a3560c154649",
      "accepted": [
        { "key": "0", "message_id": "e27ff0ac-87b5-4e1d-b644-5fc6029e2a11" }
      ],
      "rejected": []
    }
    ```

    * **`request_id`** — a unique identifier for the entire API call. Use this to correlate requests in your logs.
    * **`message_id`** — a unique identifier for the individual message sent to a specific recipient. Store this value if you want to match delivery webhook events back to the originating send.
    * **`rejected`** — an array of any recipients that were not accepted (for example, due to an invalid phone number format). An empty array means all recipients were accepted.
  </Step>

  <Step title="Set up a webhook (optional)">
    To receive real-time delivery updates, add a `callback` URL to your request body. SmsManager will POST a delivery notification to that URL whenever the message status changes (delivered, failed, etc.).

    ```json theme={null}
    {
      "body": "Hello from SmsManager!",
      "to": [{ "phone_number": "420777123456" }],
      "callback": "https://your-app.example.com/webhooks/sms"
    }
    ```

    See the [Webhooks guide](/en/guides/webhooks) for the full event payload schema and verification details.
  </Step>
</Steps>

## Code examples

The examples below all send the same basic message. Pick the language that matches your stack.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.smsmngr.com/v2/message \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "body": "Hello from SmsManager!",
      "to": [{"phone_number": "420777123456"}]
    }'
  ```

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

  url = "https://api.smsmngr.com/v2/message"
  headers = {
      "x-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
  }
  payload = {
      "body": "Hello from SmsManager!",
      "to": [{"phone_number": "420777123456"}],
  }

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

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.smsmngr.com/v2/message", {
    method: "POST",
    headers: {
      "x-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      body: "Hello from SmsManager!",
      to: [{ phone_number: "420777123456" }],
    }),
  });

  const data = await response.json();
  console.log(data);
  ```

  ```php PHP theme={null}
  <?php

  $payload = json_encode([
      "body" => "Hello from SmsManager!",
      "to"   => [["phone_number" => "420777123456"]],
  ]);

  $ch = curl_init("https://api.smsmngr.com/v2/message");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "x-api-key: YOUR_API_KEY",
      "Content-Type: application/json",
  ]);

  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```
</CodeGroup>

## Next steps

<CardGroup cols={3}>
  <Card title="Message flow" icon="arrow-right-arrow-left" href="/en/concepts/message-flow">
    Learn how to build multi-channel fallback chains with the `flow` property.
  </Card>

  <Card title="Channels overview" icon="layer-group" href="/en/concepts/channels">
    Explore the differences between SMS, Viber, and WhatsApp sending.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/en/guides/webhooks">
    Receive delivery receipts and inbound messages in real time.
  </Card>
</CardGroup>
