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

# API Interface

> Authenticate with an API key and send SMS messages through the YCloud API.

## Get an API key

YCloud authenticates server-side requests with API keys. Create or view an API key in [**Dashboard > Developers > API keys**](https://www.ycloud.com/console/#/app/developers/apikey), then send it in the `X-API-Key` request header.

<Warning>
  Keep API keys on your server. Never commit them to a repository or expose them in browser or mobile application code.
</Warning>

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --request POST 'https://api.ycloud.com/v2/sms' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "to": "+16315551234",
    "text": "Your verification code is 123456."
  }'
```

If you prefer an SDK, see the available languages and installation instructions in [YCloud Developers](https://github.com/ycloud-developers).

## Explore the endpoint

Open [Send an SMS](/api-reference/sms/send-an-sms) for the complete request parameters, response schema, and interactive request builder. For the end-to-end integration workflow and delivery considerations, see [Send an SMS](/en/api-reference/guides/messaging/send-sms).

## Handle the response

A `2xx` response means YCloud accepted the request. It does not necessarily mean that the SMS reached the recipient. Store the returned message ID and correlate it with retrieval results or webhook events to track delivery.

## Handle errors

Error responses include three fields:

* `code` is the stable, machine-readable error identifier.
* `message` explains the error to developers.
* `requestId` helps YCloud support troubleshoot a request.

Use the stable error identifier in your application logic. Do not match the developer-facing explanation. See [Handle errors](/en/api-reference/guides/api-fundamentals/handle-errors) for the response format and retry guidance.


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