- list - Get access keys
- generate - Generate an access key
- delete_by_name - Delete access key by name
- update - Update an access key
- delete - Delete access key
Retrieve an array of all access keys for a product environment.
Learn more about retrieving access keys. https://cloudinary.com/documentation/provisioning_api#get_access_keys
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.access_keys.list(request={
"sub_account_id": "abcde1fghij2klmno3pqrst4uvwxy5z",
"sort_by": cloudinary_account_provisioning.SortBy.CREATED_AT,
"sort_order": cloudinary_account_provisioning.SortOrder.ASC,
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.GetAccessKeysRequest | ✔️ | 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 | */* |
Generate a new access key.
Learn more about generating access keys. https://cloudinary.com/documentation/provisioning_api#generate_an_access_key
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.access_keys.generate(sub_account_id="abcde1fghij2klmno3pqrst4uvwxy5z", access_key_request={
"name": "main_key",
"enabled": True,
})
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
sub_account_id |
str | ✔️ | The ID of the product environment. | abcde1fghij2klmno3pqrst4uvwxy5z |
access_key_request |
models.AccessKeyRequest | ✔️ | Access key details. | |
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 access key by name.
Learn more about deleting access keys. https://cloudinary.com/documentation/provisioning_api#delete_an_access_key
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.access_keys.delete_by_name(sub_account_id="abcde1fghij2klmno3pqrst4uvwxy5z", name="main_key")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
sub_account_id |
str | ✔️ | The ID of the product environment. | abcde1fghij2klmno3pqrst4uvwxy5z |
name |
str | ✔️ | The access key name. | main_key |
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 | */* |
Update the name and/or status of an existing access key.
Learn more about updating access keys. https://cloudinary.com/documentation/provisioning_api#update_an_access_key
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.access_keys.update(sub_account_id="abcde1fghij2klmno3pqrst4uvwxy5z", key="814814814814814", access_key_update_request={
"name": "main_key",
"enabled": True,
"dedicated_for": cloudinary_account_provisioning.DedicatedFor.WEBHOOKS,
})
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
sub_account_id |
str | ✔️ | The ID of the product environment. | abcde1fghij2klmno3pqrst4uvwxy5z |
key |
str | ✔️ | The access key (api key). | 814814814814814 |
access_key_update_request |
models.AccessKeyUpdateRequest | ✔️ | Access key details for 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 access key.
Learn more about deleting access keys. https://cloudinary.com/documentation/provisioning_api#delete_an_access_key
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.access_keys.delete(sub_account_id="abcde1fghij2klmno3pqrst4uvwxy5z", key="814814814814814")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
sub_account_id |
str | ✔️ | The ID of the product environment. | abcde1fghij2klmno3pqrst4uvwxy5z |
key |
str | ✔️ | The access key (api key). | 814814814814814 |
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 | */* |