# Manage & Operate › Tags API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Manage & Operate product's sections: https://developers.eu.ovhcloud.com/reference/manage-operate/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 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/manage-operate/tags/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/manage-operate/tags.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/manage-operate/tags.json?format=openapi3

## Operations

- `GET /me/tag` — Retrieve customer tags list
- `POST /me/tag` — Activate customer tag
- `GET /me/tag/available` — Retrieve all available tags
- `GET /me/tag/{tag}` — Retrieve a customer tag
- `DELETE /me/tag/{tag}` — Delete a customer tag

## Retrieve customer tags list

`GET /1.0/me/tag`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/tags/#get-me-tag

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/tag/get`

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/me/tag" \
  -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("/me/tag")

# 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("/me/tag");

print_r($result);
?>
```

## Activate customer tag

`POST /1.0/me/tag`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/tags/#post-me-tag

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/tag/create`

### Request body (required)

Type: `me.tag.Creation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `reason` | string |  | Reason |
| `tagName` | string | yes | Tag name |

```json
{
  "reason": "string",
  "tagName": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | me.tag.Tag | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `customerCode` | string | read-only | Customer code |
| `expirationDate` | string (date-time) | read-only | Expiration date |
| `extra` | me.tag.TagExtra | read-only | Extra data |
| `extra.exemption` | string | read-only | Tax exemption |
| `lastUpdate` | string (date-time) | read-only | Last update |
| `status` | me.tag.StatusEnum | read-only | Tag Status — one of `CREATED`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `MODERATING`, `REFUSED`, `REFUSING`, `REVOCATING`, `WAIT_MODERATION`, `WAIT_REVOCATION` |
| `tag` | string | read-only | Tag name |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "customerCode": "string",
  "expirationDate": "2024-01-01T12:00:00Z",
  "extra": {
    "exemption": "string"
  },
  "lastUpdate": "2024-01-01T12:00:00Z",
  "status": "CREATED",
  "tag": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/me/tag" \
  -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: me.tag.Creation
result = client.post("/me/tag",
	reason = None, # Reason (type: string, nullable)
	tagName = None, # Tag 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: me.tag.Creation
$result = $ovh->post("/me/tag", array(
	reason => null, // Reason (type: string, nullable)
	tagName => null, // Tag name (type: string)
));

print_r($result);
?>
```

## Retrieve all available tags

`GET /1.0/me/tag/available`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/tags/#get-me-tag-available

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/tag/available/get`

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | me.tag.AvailableTag[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `keys` | me.tag.TagKey[] | read-only | Tag configuration keys |
| `keys[].enum` | string[] | read-only | Enum values |
| `keys[].key` | string | read-only | Tag key name |
| `keys[].maxLength` | integer | read-only | Maximum length for a text |
| `keys[].minValue` | integer | read-only | Minimum value for a number |
| `keys[].optional` | boolean | read-only | Tag key optional |
| `keys[].pattern` | string | read-only | Tag value regex pattern |
| `keys[].type` | me.tag.tagKey.TypeEnum | read-only | Tag key type — one of `ARRAY`, `DATE`, `ENUM`, `INTEGER`, `TEXT`, `VARCHAR` |
| `name` | string | read-only | Tag name |

```json
[
  {
    "keys": [
      {
        "enum": [
          "string"
        ],
        "key": "string",
        "maxLength": 0,
        "minValue": 0,
        "optional": true,
        "pattern": "string",
        "type": "ARRAY"
      }
    ],
    "name": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/me/tag/available" \
  -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("/me/tag/available")

# 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("/me/tag/available");

print_r($result);
?>
```

## Retrieve a customer tag

`GET /1.0/me/tag/{tag}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/tags/#get-me-tag-tag

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/tag/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `tag` | path | string | yes | Tag |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | me.tag.Tag | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `customerCode` | string | read-only | Customer code |
| `expirationDate` | string (date-time) | read-only | Expiration date |
| `extra` | me.tag.TagExtra | read-only | Extra data |
| `extra.exemption` | string | read-only | Tax exemption |
| `lastUpdate` | string (date-time) | read-only | Last update |
| `status` | me.tag.StatusEnum | read-only | Tag Status — one of `CREATED`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `MODERATING`, `REFUSED`, `REFUSING`, `REVOCATING`, `WAIT_MODERATION`, `WAIT_REVOCATION` |
| `tag` | string | read-only | Tag name |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "customerCode": "string",
  "expirationDate": "2024-01-01T12:00:00Z",
  "extra": {
    "exemption": "string"
  },
  "lastUpdate": "2024-01-01T12:00:00Z",
  "status": "CREATED",
  "tag": "string"
}
```

### Example

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

# 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("/me/tag/{tag}");

print_r($result);
?>
```

## Delete a customer tag

`DELETE /1.0/me/tag/{tag}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/tags/#delete-me-tag-tag

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/tag/delete`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `tag` | path | string | yes | Tag |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | me.tag.Tag | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `customerCode` | string | read-only | Customer code |
| `expirationDate` | string (date-time) | read-only | Expiration date |
| `extra` | me.tag.TagExtra | read-only | Extra data |
| `extra.exemption` | string | read-only | Tax exemption |
| `lastUpdate` | string (date-time) | read-only | Last update |
| `status` | me.tag.StatusEnum | read-only | Tag Status — one of `CREATED`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `MODERATING`, `REFUSED`, `REFUSING`, `REVOCATING`, `WAIT_MODERATION`, `WAIT_REVOCATION` |
| `tag` | string | read-only | Tag name |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "customerCode": "string",
  "expirationDate": "2024-01-01T12:00:00Z",
  "extra": {
    "exemption": "string"
  },
  "lastUpdate": "2024-01-01T12:00:00Z",
  "status": "CREATED",
  "tag": "string"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/me/tag/{tag}" \
  -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("/me/tag/{tag}")

# 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("/me/tag/{tag}");

print_r($result);
?>
```
