# Web Cloud › OverTheBox › Device › Actions 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

> 4 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/overthebox/device/actions/

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

## Operations

- `GET /overTheBox/{serviceName}/device/actions` — List the actions of an OverTheBox device
- `GET /overTheBox/{serviceName}/device/availableActions` — List the actions available on an OverTheBox device
- `POST /overTheBox/{serviceName}/device/actions` — Create an action on an OverTheBox device
- `GET /overTheBox/{serviceName}/device/actions/{actionId}` — Get an action of an OverTheBox device

## List the actions of an OverTheBox device

`GET /1.0/overTheBox/{serviceName}/device/actions`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/actions/#get-overthebox-servicename-device-actions

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/actions/get`

List the actions of an OverTheBox device. Returns the IDs of the actions scheduled on the device, which can be filtered by status and name.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | query | string |  | Filter the value of name property (=) |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |
| `status` | query | overTheBox.ActionStatusEnum |  | Filter the value of status property (=) — one of `doing`, `done`, `error`, `todo` |

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device/actions" \
  -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("/overTheBox/{serviceName}/device/actions")

# 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("/overTheBox/{serviceName}/device/actions");

print_r($result);
?>
```

## List the actions available on an OverTheBox device

`GET /1.0/overTheBox/{serviceName}/device/availableActions`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/actions/#get-overthebox-servicename-device-availableactions

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/availableActions/get`

List the actions available on an OverTheBox device. Returns the name and description of each action that can be created on the device.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.AvailableDeviceAction[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | Description of the action |
| `name` | string |  | Name of the action |

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device/availableActions" \
  -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("/overTheBox/{serviceName}/device/availableActions")

# 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("/overTheBox/{serviceName}/device/availableActions");

print_r($result);
?>
```

## Create an action on an OverTheBox device

`POST /1.0/overTheBox/{serviceName}/device/actions`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/actions/#post-overthebox-servicename-device-actions

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/actions/create`

Create an action on an OverTheBox device. Schedules one of the available device actions, given by its name, and returns the created action.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | Name of the action |

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.DeviceAction | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `actionId` | string | read-only | The id of the action |
| `createdAt` | string (date-time) | read-only | Date of creation of the action |
| `details` | string | read-only | The details of the action |
| `name` | string | read-only | The name of the action |
| `status` | overTheBox.ActionStatusEnum | read-only | The status of the action — one of `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Date of execution of the action |
| `updatedAt` | string (date-time) | read-only | Last time the action was updated |

```json
{
  "actionId": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "details": "string",
  "name": "string",
  "status": "doing",
  "todoDate": "2024-01-01T12:00:00Z",
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device/actions" \
  -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("/overTheBox/{serviceName}/device/actions",
	name = None, # Name of the action (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("/overTheBox/{serviceName}/device/actions", array(
	name => null, // Name of the action (type: string)
));

print_r($result);
?>
```

## Get an action of an OverTheBox device

`GET /1.0/overTheBox/{serviceName}/device/actions/{actionId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/actions/#get-overthebox-servicename-device-actions-actionid

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/actions/get`

Get an action of an OverTheBox device. Returns the name, status, details and the creation, update and execution dates of an action of the device.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `actionId` | path | string | yes | The id of the action |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.DeviceAction | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `actionId` | string | read-only | The id of the action |
| `createdAt` | string (date-time) | read-only | Date of creation of the action |
| `details` | string | read-only | The details of the action |
| `name` | string | read-only | The name of the action |
| `status` | overTheBox.ActionStatusEnum | read-only | The status of the action — one of `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Date of execution of the action |
| `updatedAt` | string (date-time) | read-only | Last time the action was updated |

```json
{
  "actionId": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "details": "string",
  "name": "string",
  "status": "doing",
  "todoDate": "2024-01-01T12:00:00Z",
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device/actions/{actionId}" \
  -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("/overTheBox/{serviceName}/device/actions/{actionId}")

# 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("/overTheBox/{serviceName}/device/actions/{actionId}");

print_r($result);
?>
```
