# Public Cloud › Analytics › Managed Dashboards › Users API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-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/public-cloud/analytics/managed-dashboards/users/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/analytics/managed-dashboards/users.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/analytics/managed-dashboards/users.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user` — List users
- `GET /publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}` — Get a user
- `PATCH /publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}` — Reset user credentials
- `POST /publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}/resetPassword` — Reset the password of a user

## List users

`GET /v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/managed-dashboards/users/#get-publiccloud-project-projectid-managedanalytics-grafana-serviceid-user

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/grafana/user/get`

Returns the users of the service with their status. Users are provisioned by the service and cannot be created or deleted.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.User[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `admin` | boolean | read-only | Whether this is the service administrator, the user created automatically at provisioning time, which cannot be deleted |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the user was created |
| `credentialsLastUpdatedAt` | string (date-time) | read-only | Date at which the user credentials were last updated |
| `id` | string (uuid) | read-only | Unique identifier of the user |
| `password` | string (password) | read-only | Password of the user. Returned only on creation or password reset. |
| `status` | publicCloud.database.UserStatusEnum | read-only | Current readiness status of the user — one of `CREATING`, `DELETING`, `ERROR`, `READY`, `UPDATING` |
| `username` | string | read-only | Login name of the user |

```json
[
  {
    "admin": true,
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "credentialsLastUpdatedAt": "2024-01-01T12:00:00Z",
    "id": "00000000-0000-0000-0000-000000000000",
    "password": "string",
    "status": "CREATING",
    "username": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user" \
  -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("/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user")

# 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("/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user");

print_r($result);
?>
```

## Get a user

`GET /v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/managed-dashboards/users/#get-publiccloud-project-projectid-managedanalytics-grafana-serviceid-user-userid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/grafana/user/get`

Returns the user and its status. The password is not returned.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |
| `userId` | path | string (uuid) | yes | User ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.User | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `admin` | boolean | read-only | Whether this is the service administrator, the user created automatically at provisioning time, which cannot be deleted |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the user was created |
| `credentialsLastUpdatedAt` | string (date-time) | read-only | Date at which the user credentials were last updated |
| `id` | string (uuid) | read-only | Unique identifier of the user |
| `password` | string (password) | read-only | Password of the user. Returned only on creation or password reset. |
| `status` | publicCloud.database.UserStatusEnum | read-only | Current readiness status of the user — one of `CREATING`, `DELETING`, `ERROR`, `READY`, `UPDATING` |
| `username` | string | read-only | Login name of the user |

```json
{
  "admin": true,
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "credentialsLastUpdatedAt": "2024-01-01T12:00:00Z",
  "id": "00000000-0000-0000-0000-000000000000",
  "password": "string",
  "status": "CREATING",
  "username": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}" \
  -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("/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}")

# 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("/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}");

print_r($result);
?>
```

## Reset user credentials

`PATCH /v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/managed-dashboards/users/#patch-publiccloud-project-projectid-managedanalytics-grafana-serviceid-user-userid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/grafana/user/edit`

Resets the password of the user when credentialsLastUpdatedAt is set. The new password is returned in the response.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |
| `userId` | path | string (uuid) | yes | User ID |

### Request body (required)

Type: `publicCloud.database.UserCredentialsUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `credentialsLastUpdatedAt` | string (date-time) | yes | Date at which the user credentials were last updated. Setting this field triggers a credential reset and returns the new password. |

```json
{
  "credentialsLastUpdatedAt": "2024-01-01T12:00:00Z"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.User | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `admin` | boolean | read-only | Whether this is the service administrator, the user created automatically at provisioning time, which cannot be deleted |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the user was created |
| `credentialsLastUpdatedAt` | string (date-time) | read-only | Date at which the user credentials were last updated |
| `id` | string (uuid) | read-only | Unique identifier of the user |
| `password` | string (password) | read-only | Password of the user. Returned only on creation or password reset. |
| `status` | publicCloud.database.UserStatusEnum | read-only | Current readiness status of the user — one of `CREATING`, `DELETING`, `ERROR`, `READY`, `UPDATING` |
| `username` | string | read-only | Login name of the user |

```json
{
  "admin": true,
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "credentialsLastUpdatedAt": "2024-01-01T12:00:00Z",
  "id": "00000000-0000-0000-0000-000000000000",
  "password": "string",
  "status": "CREATING",
  "username": "string"
}
```

### Example

```bash
curl -X PATCH \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}" \
  -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: publicCloud.database.UserCredentialsUpdate
result = client.patch("/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}",
	credentialsLastUpdatedAt = None, # Date at which the user credentials were last updated. Setting this field triggers a credential reset and returns the new password. (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: publicCloud.database.UserCredentialsUpdate
$result = $ovh->patch("/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}", array(
	credentialsLastUpdatedAt => null, // Date at which the user credentials were last updated. Setting this field triggers a credential reset and returns the new password. (type: string)
));

print_r($result);
?>
```

## Reset the password of a user

`POST /v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}/resetPassword`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/managed-dashboards/users/#post-publiccloud-project-projectid-managedanalytics-grafana-serviceid-user-userid-resetpassword

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/grafana/user/credentials/reset`

Generates a new password for the user and returns it in the response. Reading the user never returns it. The previous password stops working once the new one is applied, and credentialsLastUpdatedAt becomes the date of this reset. This is the same reset as a partial update of the user that sets credentialsLastUpdatedAt.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |
| `userId` | path | string (uuid) | yes | User ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.User | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `admin` | boolean | read-only | Whether this is the service administrator, the user created automatically at provisioning time, which cannot be deleted |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the user was created |
| `credentialsLastUpdatedAt` | string (date-time) | read-only | Date at which the user credentials were last updated |
| `id` | string (uuid) | read-only | Unique identifier of the user |
| `password` | string (password) | read-only | Password of the user. Returned only on creation or password reset. |
| `status` | publicCloud.database.UserStatusEnum | read-only | Current readiness status of the user — one of `CREATING`, `DELETING`, `ERROR`, `READY`, `UPDATING` |
| `username` | string | read-only | Login name of the user |

```json
{
  "admin": true,
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "credentialsLastUpdatedAt": "2024-01-01T12:00:00Z",
  "id": "00000000-0000-0000-0000-000000000000",
  "password": "string",
  "status": "CREATING",
  "username": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}/resetPassword" \
  -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.post("/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}/resetPassword")

# 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("/v2/publicCloud/project/{projectId}/managedAnalytics/grafana/{serviceId}/user/{userId}/resetPassword");

print_r($result);
?>
```
