Manage the users for your account.
Learn more about users management. https://cloudinary.com/documentation/provisioning_api#users
- list - Get users
- create - Create user
- get - Get user
- update - Update user
- delete - Delete user
- get_groups - Get user groups
- list_sub_accounts - Get user sub-accounts
Returns an array of all users in the account, or if conditions are specified, returns the relevant users.
Learn more about retrieving users. https://cloudinary.com/documentation/provisioning_api#get_users
import cloudinary_account_provisioning
from cloudinary_account_provisioning import CldProvisioning
from datetime import date
with CldProvisioning(
account_id="<id>",
security=cloudinary_account_provisioning.Security(
provisioning_api_key="CLOUDINARY_PROVISIONING_API_KEY",
provisioning_api_secret="CLOUDINARY_PROVISIONING_API_SECRET",
),
) as cld_provisioning:
res = cld_provisioning.users.list(request={
"pending": False,
"prefix": "john",
"from_": date.fromisoformat("2023-01-01T00:00:00Z"),
"to": date.fromisoformat("2024-12-31T00:00:00Z"),
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.GetUsersRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ErrorResponse | 401, 404, 420, 429 | application/json |
| models.APIError | 4XX, 5XX | */* |
Create a new user.
Learn more about creating users. https://cloudinary.com/documentation/provisioning_api#create_user
import cloudinary_account_provisioning
from cloudinary_account_provisioning import CldProvisioning
with CldProvisioning(
account_id="<id>",
security=cloudinary_account_provisioning.Security(
provisioning_api_key="CLOUDINARY_PROVISIONING_API_KEY",
provisioning_api_secret="CLOUDINARY_PROVISIONING_API_SECRET",
),
) as cld_provisioning:
res = cld_provisioning.users.create(request={
"name": "jenny_bar",
"email": "jenny_bar@example.com",
"role": cloudinary_account_provisioning.CreateUserRole.MASTER_ADMIN,
})
# Handle response
print(res)import cloudinary_account_provisioning
from cloudinary_account_provisioning import CldProvisioning
with CldProvisioning(
account_id="<id>",
security=cloudinary_account_provisioning.Security(
provisioning_api_key="CLOUDINARY_PROVISIONING_API_KEY",
provisioning_api_secret="CLOUDINARY_PROVISIONING_API_SECRET",
),
) as cld_provisioning:
res = cld_provisioning.users.create(request={
"name": "John",
"email": "john@example.com",
"role": cloudinary_account_provisioning.CreateUserRole.TECHNICAL_ADMIN,
"enabled": True,
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.CreateUserRequestBody | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ErrorResponse | 400, 401, 403, 404, 409, 420, 429 | application/json |
| models.APIError | 4XX, 5XX | */* |
Retrieve a specific user.
Learn more about retrieving a specific user. https://cloudinary.com/documentation/provisioning_api#get_user
import cloudinary_account_provisioning
from cloudinary_account_provisioning import CldProvisioning
with CldProvisioning(
account_id="<id>",
security=cloudinary_account_provisioning.Security(
provisioning_api_key="CLOUDINARY_PROVISIONING_API_KEY",
provisioning_api_secret="CLOUDINARY_PROVISIONING_API_SECRET",
),
) as cld_provisioning:
res = cld_provisioning.users.get(user_id="0abed8dfcc039ea05e2a1d494fd442")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
user_id |
str | ✔️ | The ID of the user. | 0abed8dfcc039ea05e2a1d494fd442 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ErrorResponse | 401, 404, 420, 429 | application/json |
| models.APIError | 4XX, 5XX | */* |
Update the details of a user.
Learn more about updating a specific user. https://cloudinary.com/documentation/provisioning_api#update_user
import cloudinary_account_provisioning
from cloudinary_account_provisioning import CldProvisioning
with CldProvisioning(
account_id="<id>",
security=cloudinary_account_provisioning.Security(
provisioning_api_key="CLOUDINARY_PROVISIONING_API_KEY",
provisioning_api_secret="CLOUDINARY_PROVISIONING_API_SECRET",
),
) as cld_provisioning:
res = cld_provisioning.users.update(user_id="0abed8dfcc039ea05e2a1d494fd442", user_request={
"name": "John",
"email": "john@example.com",
"role": cloudinary_account_provisioning.UserRequestRole.TECHNICAL_ADMIN,
"enabled": True,
})
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
user_id |
str | ✔️ | The ID of the user. | 0abed8dfcc039ea05e2a1d494fd442 |
user_request |
models.UserRequest | ✔️ | User details to update. | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ErrorResponse | 400, 401, 403, 404, 409, 420, 429 | application/json |
| models.APIError | 4XX, 5XX | */* |
Delete a specific user.
Learn more about deleting a specific user. https://cloudinary.com/documentation/provisioning_api#delete_user
import cloudinary_account_provisioning
from cloudinary_account_provisioning import CldProvisioning
with CldProvisioning(
account_id="<id>",
security=cloudinary_account_provisioning.Security(
provisioning_api_key="CLOUDINARY_PROVISIONING_API_KEY",
provisioning_api_secret="CLOUDINARY_PROVISIONING_API_SECRET",
),
) as cld_provisioning:
res = cld_provisioning.users.delete(user_id="0abed8dfcc039ea05e2a1d494fd442")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
user_id |
str | ✔️ | The ID of the user. | 0abed8dfcc039ea05e2a1d494fd442 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ErrorResponse | 400, 401, 403, 404, 420, 429 | application/json |
| models.APIError | 4XX, 5XX | */* |
Retrieve the groups that a specific user belongs to.
Learn more about retrieving user groups. https://cloudinary.com/documentation/provisioning_api#get_users_groups
import cloudinary_account_provisioning
from cloudinary_account_provisioning import CldProvisioning
with CldProvisioning(
account_id="<id>",
security=cloudinary_account_provisioning.Security(
provisioning_api_key="CLOUDINARY_PROVISIONING_API_KEY",
provisioning_api_secret="CLOUDINARY_PROVISIONING_API_SECRET",
),
) as cld_provisioning:
res = cld_provisioning.users.get_groups(user_id="0abed8dfcc039ea05e2a1d494fd442")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
user_id |
str | ✔️ | The ID of the user. | 0abed8dfcc039ea05e2a1d494fd442 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ErrorResponse | 401, 404, 420, 429 | application/json |
| models.APIError | 4XX, 5XX | */* |
Retrieve the product environments (sub-accounts) that a specific user has access to.
Learn more about retrieving user sub-accounts. https://cloudinary.com/documentation/provisioning_api#get_user_sub_accounts
import cloudinary_account_provisioning
from cloudinary_account_provisioning import CldProvisioning
with CldProvisioning(
account_id="<id>",
security=cloudinary_account_provisioning.Security(
provisioning_api_key="CLOUDINARY_PROVISIONING_API_KEY",
provisioning_api_secret="CLOUDINARY_PROVISIONING_API_SECRET",
),
) as cld_provisioning:
res = cld_provisioning.users.list_sub_accounts(user_id="0abed8dfcc039ea05e2a1d494fd442")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
user_id |
str | ✔️ | The ID of the user. | 0abed8dfcc039ea05e2a1d494fd442 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.UserSubAccountsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ErrorResponse | 401, 404, 420, 429 | application/json |
| models.APIError | 4XX, 5XX | */* |