# Web Cloud › SMS › Senders API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Web Cloud product's sections: https://developers.eu.ovhcloud.com/reference/web-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 11 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/sms/senders.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/sms/senders.json?format=openapi3

## Operations

- `GET /sms/{serviceName}/senders` — List senders
- `GET /sms/{serviceName}/senders/{sender}` — Get a sender
- `POST /sms/{serviceName}/senders` — Create a sender
- `DELETE /sms/{serviceName}/senders/{sender}` — Delete a sender
- `PUT /sms/{serviceName}/senders/{sender}` — Update a sender
- `GET /sms/{serviceName}/senders/{sender}/documents` — List validation documents
- `GET /sms/{serviceName}/senders/{sender}/documents/{documentID}` — Get a validation document
- `POST /sms/{serviceName}/senders/{sender}/documents` — Create a validation document
- `PUT /sms/{serviceName}/senders/{sender}/documents/{documentID}` — Update a validation document
- `POST /sms/{serviceName}/senders/{sender}/validate` — Validate a sender
- `GET /sms/{serviceName}/sendersAvailableForValidation` — List senders available for validation

## List senders

`GET /1.0/sms/{serviceName}/senders`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#get-sms-servicename-senders

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/get`

List senders. Returns the senders of the account. A sender is the name or number shown to receivers, and must be validated before it can be used.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string[] | successful operation |

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/sms/{serviceName}/senders")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/sms/{serviceName}/senders");

print_r($result);
?>
```

## Get a sender

`GET /1.0/sms/{serviceName}/senders/{sender}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#get-sms-servicename-senders-sender

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/get`

Get a sender. Returns the sender: status (enable, disable, waitingValidation or refused), type, description and the comment of the moderator.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sender` | path | string | yes | The sms sender |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.Sender | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string | read-only | Message sent by the moderator |
| `description` | string |  | Sender description |
| `referer` | sms.RefererSenderEnum | read-only | Specify if the sender is custom or not — one of `custom`, `domain`, `line`, `nic`, `owner`, `virtual` |
| `sender` | string | read-only | The sms sender |
| `status` | sms.StatusSenderEnum |  | Sender status — one of `disable`, `enable`, `refused`, `waitingValidation` |
| `type` | sms.TypeSenderEnum | read-only | Specify the kind of sender — one of `alpha`, `numeric`, `shortcode`, `time2chat`, `virtual` |
| `validationMedia` | string | read-only | Validation media identifier |

```json
{
  "comment": "string",
  "description": "string",
  "referer": "custom",
  "sender": "string",
  "status": "disable",
  "type": "alpha",
  "validationMedia": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders/{sender}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/sms/{serviceName}/senders/{sender}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/sms/{serviceName}/senders/{sender}");

print_r($result);
?>
```

## Create a sender

`POST /1.0/sms/{serviceName}/senders`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#post-sms-servicename-senders

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/create`

Create a sender. Creates a sender (alphanumeric or phone number). The sender is moderated before it can be used.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | Sender description |
| `reason` | string |  | Message seen by the moderator |
| `sender` | string | yes | The sender (alpha or phone number) |

```json
{
  "description": "string",
  "reason": "string",
  "sender": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string | successful operation |

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: string
result = client.post("/sms/{serviceName}/senders",
	description = None, # Sender description (type: string, nullable)
	reason = None, # Message seen by the moderator (type: string, nullable)
	sender = None, # The sender (alpha or phone number) (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: string
$result = $ovh->post("/sms/{serviceName}/senders", array(
	description => null, // Sender description (type: string, nullable)
	reason => null, // Message seen by the moderator (type: string, nullable)
	sender => null, // The sender (alpha or phone number) (type: string)
));

print_r($result);
?>
```

## Delete a sender

`DELETE /1.0/sms/{serviceName}/senders/{sender}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#delete-sms-servicename-senders-sender

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/delete`

Delete a sender. Deletes the sender. It can no longer be used as the name or number shown to the receivers of the SMS sent.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sender` | path | string | yes | The sms sender |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders/{sender}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/sms/{serviceName}/senders/{sender}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/sms/{serviceName}/senders/{sender}");

print_r($result);
?>
```

## Update a sender

`PUT /1.0/sms/{serviceName}/senders/{sender}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#put-sms-servicename-senders-sender

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/edit`

Update a sender. Updates the sender description and its status, to enable or disable a validated sender.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sender` | path | string | yes | The sms sender |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `sms.Sender`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string | read-only | Message sent by the moderator |
| `description` | string |  | Sender description |
| `referer` | sms.RefererSenderEnum | read-only | Specify if the sender is custom or not — one of `custom`, `domain`, `line`, `nic`, `owner`, `virtual` |
| `sender` | string | read-only | The sms sender |
| `status` | sms.StatusSenderEnum |  | Sender status — one of `disable`, `enable`, `refused`, `waitingValidation` |
| `type` | sms.TypeSenderEnum | read-only | Specify the kind of sender — one of `alpha`, `numeric`, `shortcode`, `time2chat`, `virtual` |
| `validationMedia` | string | read-only | Validation media identifier |

```json
{
  "description": "string",
  "status": "disable"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders/{sender}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: sms.Sender
result = client.put("/sms/{serviceName}/senders/{sender}",
	description = None, # Sender description (type: string)
	status = None, # Sender status (type: sms.StatusSenderEnum)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: sms.Sender
$result = $ovh->put("/sms/{serviceName}/senders/{sender}", array(
	description => null, // Sender description (type: string)
	status => null, // Sender status (type: sms.StatusSenderEnum)
));

print_r($result);
?>
```

## List validation documents

`GET /1.0/sms/{serviceName}/senders/{sender}/documents`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#get-sms-servicename-senders-sender-documents

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/documents/get`

List validation documents. Returns the identifiers of the documents sent to validate the sender. Get a validation document for its name, size and download URL.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sender` | path | string | yes | The sms sender |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string (uuid)[] | successful operation |

```json
[
  "00000000-0000-0000-0000-000000000000"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders/{sender}/documents" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/sms/{serviceName}/senders/{sender}/documents")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/sms/{serviceName}/senders/{sender}/documents");

print_r($result);
?>
```

## Get a validation document

`GET /1.0/sms/{serviceName}/senders/{sender}/documents/{documentID}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#get-sms-servicename-senders-sender-documents-documentid

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/documents/get`

Get a validation document. Returns the validation document: name, description, size, creation date and the URL to download it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `documentID` | path | string (uuid) | yes | Document ID |
| `sender` | path | string | yes | The sms sender |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.SenderDocument | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation datetime |
| `description` | string |  | Document description |
| `documentID` | string (uuid) | read-only | Document ID |
| `getUrl` | string | read-only | URL to get document |
| `name` | string |  | Document name |
| `putUrl` | string | read-only | URL to upload document |
| `size` | integer | read-only | Document size (in bytes) |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "documentID": "00000000-0000-0000-0000-000000000000",
  "getUrl": "string",
  "name": "string",
  "putUrl": "string",
  "size": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders/{sender}/documents/{documentID}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/sms/{serviceName}/senders/{sender}/documents/{documentID}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/sms/{serviceName}/senders/{sender}/documents/{documentID}");

print_r($result);
?>
```

## Create a validation document

`POST /1.0/sms/{serviceName}/senders/{sender}/documents`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#post-sms-servicename-senders-sender-documents

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/documents/create`

Create a validation document. Creates an empty validation document with a name and a description. Returns the URL to upload the file.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sender` | path | string | yes | The sms sender |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | Document description |
| `name` | string | yes | Document name |

```json
{
  "description": "string",
  "name": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.SenderDocument | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation datetime |
| `description` | string |  | Document description |
| `documentID` | string (uuid) | read-only | Document ID |
| `getUrl` | string | read-only | URL to get document |
| `name` | string |  | Document name |
| `putUrl` | string | read-only | URL to upload document |
| `size` | integer | read-only | Document size (in bytes) |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "documentID": "00000000-0000-0000-0000-000000000000",
  "getUrl": "string",
  "name": "string",
  "putUrl": "string",
  "size": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders/{sender}/documents" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/sms/{serviceName}/senders/{sender}/documents",
	description = None, # Document description (type: string, nullable)
	name = None, # Document name (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/sms/{serviceName}/senders/{sender}/documents", array(
	description => null, // Document description (type: string, nullable)
	name => null, // Document name (type: string)
));

print_r($result);
?>
```

## Update a validation document

`PUT /1.0/sms/{serviceName}/senders/{sender}/documents/{documentID}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#put-sms-servicename-senders-sender-documents-documentid

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/documents/edit`

Update a validation document. Updates the name and the description of the validation document. The file itself is uploaded with the URL given at creation.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `documentID` | path | string (uuid) | yes | Document ID |
| `sender` | path | string | yes | The sms sender |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `sms.SenderDocument`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Creation datetime |
| `description` | string |  | Document description |
| `documentID` | string (uuid) | read-only | Document ID |
| `getUrl` | string | read-only | URL to get document |
| `name` | string |  | Document name |
| `putUrl` | string | read-only | URL to upload document |
| `size` | integer | read-only | Document size (in bytes) |

```json
{
  "description": "string",
  "name": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders/{sender}/documents/{documentID}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: sms.SenderDocument
result = client.put("/sms/{serviceName}/senders/{sender}/documents/{documentID}",
	description = None, # Document description (type: string, nullable)
	name = None, # Document name (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: sms.SenderDocument
$result = $ovh->put("/sms/{serviceName}/senders/{sender}/documents/{documentID}", array(
	description => null, // Document description (type: string, nullable)
	name => null, // Document name (type: string)
));

print_r($result);
?>
```

## Validate a sender

`POST /1.0/sms/{serviceName}/senders/{sender}/validate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#post-sms-servicename-senders-sender-validate

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:senders/validate`

Validate a sender. Validates the sender with the validation code received. Once validated, the sender can be used to send SMS.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sender` | path | string | yes | The sms sender |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string | yes | The validation code |

```json
{
  "code": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/senders/{sender}/validate" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: string
result = client.post("/sms/{serviceName}/senders/{sender}/validate",
	code = None, # The validation code (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: string
$result = $ovh->post("/sms/{serviceName}/senders/{sender}/validate", array(
	code => null, // The validation code (type: string)
));

print_r($result);
?>
```

## List senders available for validation

`GET /1.0/sms/{serviceName}/sendersAvailableForValidation`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/senders/#get-sms-servicename-sendersavailableforvalidation

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:sendersAvailableForValidation/get`

List senders available for validation. Returns the senders linked to the customer account or to OVHcloud services, which can be validated automatically.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `referer` | query | sms.SenderRefererEnum |  | Information type — one of `domain`, `nichandle` |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.SenderAvailable[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `referer` | sms.SenderRefererEnum |  | The referer of the available sender — one of `domain`, `nichandle` |
| `sender` | string |  |  |

```json
[
  {
    "referer": "domain",
    "sender": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/sendersAvailableForValidation" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/sms/{serviceName}/sendersAvailableForValidation")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/sms/{serviceName}/sendersAvailableForValidation");

print_r($result);
?>
```
