# Manage & Operate › Identity & Access Management › Identities › Service Accounts 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/identity-access-management/identities/service-accounts/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/manage-operate/identity-access-management/identities/service-accounts.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/manage-operate/identity-access-management/identities/service-accounts.json?format=openapi3

## Operations

- `GET /me/api/oauth2/client` — List oAuth2 clients
- `POST /me/api/oauth2/client` — Create a new oauth2 client
- `GET /me/api/oauth2/client/{clientId}` — Get Client
- `PUT /me/api/oauth2/client/{clientId}` — Update Client
- `DELETE /me/api/oauth2/client/{clientId}` — Delete an oAuth2 client

## List oAuth2 clients

`GET /1.0/me/api/oauth2/client`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/identities/service-accounts/#get-me-api-oauth2-client

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/api/oauth2/client/get`

### Responses

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

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

### Example

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

# 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/api/oauth2/client");

print_r($result);
?>
```

## Create a new oauth2 client

`POST /1.0/me/api/oauth2/client`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/identities/service-accounts/#post-me-api-oauth2-client

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/api/oauth2/client/create`

### Request body (required)

Type: `oauth2.clientRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `callbackUrls` | string[] |  | allowed callback urls |
| `description` | string | yes | client's description |
| `flow` | oauth2.ClientFlowEnum | yes | oAuth2's flow — one of `AUTHORIZATION_CODE`, `CLIENT_CREDENTIALS` |
| `name` | string | yes | client's name |

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | oauth2.clientSecret | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `clientId` | string | read-only | client's client_id |
| `clientSecret` | string (password) | read-only | client's client_secret |

```json
{
  "clientId": "string",
  "clientSecret": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/me/api/oauth2/client" \
  -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: oauth2.clientRequest
result = client.post("/me/api/oauth2/client",
	callbackUrls = None, # allowed callback urls (type: array)
	description = None, # client's description (type: string)
	flow = None, # oAuth2's flow (type: oauth2.ClientFlowEnum)
	name = None, # client's 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: oauth2.clientRequest
$result = $ovh->post("/me/api/oauth2/client", array(
	callbackUrls => null, // allowed callback urls (type: array)
	description => null, // client's description (type: string)
	flow => null, // oAuth2's flow (type: oauth2.ClientFlowEnum)
	name => null, // client's name (type: string)
));

print_r($result);
?>
```

## Get Client

`GET /1.0/me/api/oauth2/client/{clientId}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/identities/service-accounts/#get-me-api-oauth2-client-clientid

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/api/oauth2/client/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `clientId` | path | string | yes | Client ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | oauth2.client | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `callbackUrls` | string[] |  | allowed callback urls |
| `clientId` | string | read-only | client's client_id |
| `createdAt` | string (date-time) | read-only | client's creation date |
| `description` | string |  | client's description |
| `flow` | oauth2.ClientFlowEnum | read-only | oAuth2's flow — one of `AUTHORIZATION_CODE`, `CLIENT_CREDENTIALS` |
| `identity` | string | read-only | associated IAM identity |
| `name` | string |  | client's name |

```json
{
  "callbackUrls": [
    "string"
  ],
  "clientId": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "flow": "AUTHORIZATION_CODE",
  "identity": "string",
  "name": "string"
}
```

### Example

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

# 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/api/oauth2/client/{clientId}");

print_r($result);
?>
```

## Update Client

`PUT /1.0/me/api/oauth2/client/{clientId}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/identities/service-accounts/#put-me-api-oauth2-client-clientid

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/api/oauth2/client/edit`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `clientId` | path | string | yes | Client ID |

### Request body (required)

Type: `oauth2.client`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `callbackUrls` | string[] |  | allowed callback urls |
| `clientId` | string | read-only | client's client_id |
| `createdAt` | string (date-time) | read-only | client's creation date |
| `description` | string |  | client's description |
| `flow` | oauth2.ClientFlowEnum | read-only | oAuth2's flow — one of `AUTHORIZATION_CODE`, `CLIENT_CREDENTIALS` |
| `identity` | string | read-only | associated IAM identity |
| `name` | string |  | client's name |

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

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/me/api/oauth2/client/{clientId}" \
  -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: oauth2.client
result = client.put("/me/api/oauth2/client/{clientId}",
	callbackUrls = None, # allowed callback urls (type: array, nullable)
	description = None, # client's description (type: string)
	name = None, # client's 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: oauth2.client
$result = $ovh->put("/me/api/oauth2/client/{clientId}", array(
	callbackUrls => null, // allowed callback urls (type: array, nullable)
	description => null, // client's description (type: string)
	name => null, // client's name (type: string)
));

print_r($result);
?>
```

## Delete an oAuth2 client

`DELETE /1.0/me/api/oauth2/client/{clientId}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/identity-access-management/identities/service-accounts/#delete-me-api-oauth2-client-clientid

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/api/oauth2/client/delete`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `clientId` | path | string | yes | Client ID |

### Responses

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

### Example

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

# 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/api/oauth2/client/{clientId}");

print_r($result);
?>
```
