Create and manage subscriptions
Describes how to create and manage a subscription using the Redis Cloud API.
The Redis Cloud REST API lets you create and manage all kinds of subscriptions.
Redis Cloud Essentials
Create an Essentials subscription
Use POST /v1/fixed/subscriptions
to create an Essentials subscription.
POST "https://[host]/v1/fixed/subscriptions"
{
"name": "My new subscription",
"planId": <plan_id>,
"paymentMethodId": <payment_id>
}
Modify the following parameters in the sample JSON document to create a subscription on your own account:
-
paymentMethodId
- Specify a payment method connected to your account.Use
GET /v1/payment-methods
to find a payment method ID.You don't need to pass this field in your API request if you subscribed to Redis Cloud through a marketplace integration.
-
planId
- Specify an essentials plan to create.Use
GET /v1/fixed/plans
to get a list of plan IDs.
After you create an Essentials subscription, you must use the POST /v1/fixed/subscriptions/{subscriptionId}/databases
endpoint to create the database.
You can include the contents of the JSON document in the POST /v1/fixed/subscriptions
operation in the Swagger UI. See Swagger user interface for more details.
POST
and PUT
operations. You can reference these examples and modify them to fit your specific needs and account settings. The examples will fail if used as-is.The response body contains the taskId
for the task that creates the subscription. You can use GET /v1/tasks/{taskId}
to track the task's status.
Update an Essentials subscription
Use PUT /v1/fixed/subscriptions/{subscriptionId}
to update an Essentials subscription.
PUT "https://[host]/v1/fixed/subscriptions/{subscriptionId}"
{
"name": "new-subscription-name",
"planId": <plan_id>,
"paymentMethodId": <payment_id>
}
You can only change the following settings with this endpoint:
-
name
- Specify a new name for your subscription. -
planId
- Specify a new Essentials plan to change to.Use
GET /v1/fixed/plans
to get a list of plan IDs.You can only change to a plan that: - Is in the same cloud provider and region of your current plan. - Has a compatible High-availability option to your current plan. For example, if your current plan has single-zone replication, you cannot switch to a plan with multi-zone replication, but you can switch to a plan with no replication. If your current plan has multi-zone replication, you must switch to a plan with multi-zone replication.
-
paymentMethodId
- Specify a different payment method connected to your account.Use
GET /v1/payment-methods
to find a payment method ID.
The response body contains the taskId
for the task that updates the subscription. You can use GET /v1/tasks/{taskId}
to track the task's status.
Delete an Essentials subscription
Use DELETE /v1/fixed/subscriptions/{subscriptionId}
to delete a subscription.
DELETE "https://[host]/v1/fixed/subscriptions/{subscriptionId}"
The response body contains the taskId
for the task that deletes the subscription. You can use GET /v1/tasks/{taskId}
to track the task's status.
Redis Cloud Pro
Create a Pro subscription
Use POST /v1/subscriptions
to create a Pro subscription.
POST "https://[host]/v1/subscriptions"
{
"name": "Basic Subscription Example",
"paymentMethodId": <payment_id>,
"cloudProviders": [
{
"provider": "AWS",
"regions": [
{
"region": "us-east-1",
"networking": {
"deploymentCIDR": "10.0.1.0/24"
}
}
]
}
],
"databases": [
{
"name": "Redis-database-example",
"protocol": "redis",
"datasetSizeInGb": 1
}
]
}
Modify the following parameters in the sample JSON document to create a subscription on your own account:
-
paymentMethodId
- Specify a payment method connected to your account.Use
GET /v1/payment-methods
to find a payment method ID.You don't need to pass this field in your API request if you subscribed to Redis Cloud through a marketplace integration.
The request JSON body contains two primary segments: subscription specification and databases specification. When you create a subscription, you must specify one or more databases in the "databases
" array.
There are many additional parameters and settings that can be defined on subscription and database creation. Review the subscription parameters and options in the Full API documentation.
The response body contains the taskId
for the task that creates the subscription. You can use GET /v1/tasks/{taskId}
to track the task's status.
Update a Pro subscription
Use PUT /v1/subscriptions/{subscriptionId}
to update a Pro subscription.
PUT "https://[host]/v1/subscriptions/{subscriptionId}"
{
"name": "new-subscription-name",
"paymentMethodId": <payment_id>
}
You can only change the following settings with this endpoint:
-
name
- Specify a new name for your subscription. -
paymentMethodId
- Specify a different payment method connected to your account.Use
GET /v1/payment-methods
to find a payment method ID.
The response body contains the taskId
for the task that updates the subscription. You can use GET /v1/tasks/{taskId}
to track the task's status.
Delete a Pro subscription
Use DELETE /v1/subscriptions/{subscriptionId}
to delete a subscription.
DELETE "https://[host]/v1/subscriptions/{subscriptionId}"
The response body contains the taskId
for the task that deletes the subscription. You can use GET /v1/tasks/{taskId}
to track the task's status.