๐ง Account
You can retrieve your user information and manage your account settings with calls to the user endpoint.
Userโ
This endpoint allows authenticated users to get their account information.
Endpointโ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Example Requestโ
Empty body
Example Response:โ
{
"id": "63ed1b0f405d8a45bdc42c19",
"email": "[email protected]",
"name": "Richard",
"surname": "Hill",
"address": {
"company": "GreenCloud",
"street": "123 Hill St.",
"district": "North district",
"city": "England",
"postCode": "YO31 8SB",
"country": "United Kingdom"
},
"twofa": false,
"apiKey": "92c85d5c-daea-447d-9eac-1d6d64d8b340",
"bundle": {
"name": "DEVELOPER",
"quota": 100000
"price": 9.99
},
"flags": {
"bundleAutoRenewal": true,
"lowQuotaNotification": true
}
}
Set Account Flagsโ
With this endpoint, authenticated users can modify their account specific details with the following flags:
bundleAuthRenewal: This feature automatically renews the bundle when its remaining quota falls below 1%. Enabled by default.lowQuotaNotification: This feature sends notifications to the user when the bundle quota falls below 10%. Enabled by default.
Endpointโ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Content-Type | application/json | true |
Request Bodyโ
| Key | Example | Requirements |
|---|---|---|
bundleAutoRenewal | true | optional bool | Note: defaults to false if empty |
lowQuotaNotification | false | optional bool | Note: defaults to false if empty |
Example Requestโ
{
"bundleAutoRenewal": false, // optional
"lowQuotaNotification": false // optional
}
Example Responseโ
Empty body
Change Passwordโ
This endpoint allows authenticated users to change their password. It also requires a twofa field if two-factor authentication is enabled.
Endpointโ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Content-Type | application/json | true |
Request Bodyโ
| Key | Example | Requirements |
|---|---|---|
password | Hello123! | required min=8 containsany=!@#$%&\* |
twofa | 123456 | required when 2FA is enabled |
Example Requestโ
{
"password":"Hello123!",
"twofa":"123456" // optional, required only when active
}
Example Responseโ
Empty body
Reset Passwordโ
This endpoint allows users to request a password reset code to be sent to their registered email address.
Endpointโ
https://api.greencloud.dev/v1/user/resetPassword
| Key | Value | Required |
|---|---|---|
Content-Type | application/json | true |
Request Bodyโ
| Key | Example | Requirements |
|---|---|---|
email | required |
Example Requestโ
{
"email": "[email protected]"
}
Example Responseโ
Empty body
Set Passwordโ
This endpoint allows users to set a new password with the password reset code sent to their registered email address. It also requires a twofa field if two-factor authentication is enabled.
Endpointโ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Content-Type | application/json | true |
Request Bodyโ
| Key | Example | Requirements |
|---|---|---|
password | Hello123! | required min=8 containsany=!@#$%&\* |
code | b352935253674aeeb43d4ed4362745ab | required |
twofa | 123456 | required when 2FA is enabled |
Example Requestโ
{
"password": "Hello123!",
"code": "b352935253674aeeb43d4ed4362745ab",
"twofa": "123456" // optional, required only when active
}
Example Responseโ
Empty body
Set Bundleโ
This endpoint allows users sign up for one of the 3 bundles we offer:
- STARTER - 1000 invocations
- DEVELOPER - 100,000 invocations
- ENTERPRISE - 1,000,000 invocations
Endpointโ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Content-Type | application/json | true |
Request Bodyโ
| Key | Example | Requirements |
|---|---|---|
name | DEVELOPER | required oneof=STARTER DEVELOPER ENTERPRISE |
paymentMethod | pm_1MrQQuEt48Mjl075t4BHF9pw | required startswith=pm_ |
address.company | GreenCloud | optional alphanumspace |
address.street | Main st. | required alphanumspace |
address.city | England | required alphaspace |
address.district | South district | optional alphaspace |
address.postCode | YO31 8SB | required alphanumspace |
address.country | GB | required iso3166_1_alpha2 |
Example Requestโ
{
"name": "DEVELOPER",
"paymentMethod": "pm_1MrQQuEt48Mjl075t4BHF9pw",
"address": {
"company": "GreenCloud", // optional
"street": "My House 8295",
"city": "Parana",
"district": "Entre Rios", // optional
"postCode": "3100",
"country": "AR"
}
}
Example Responseโ
Empty body
Change Bundleโ
With this endpoint, authenticated users can change their account bundle. We offer three different bundles to choose from: starter, developer, and enterprise.
Endpointโ
https://api.greencloud.dev/v1/user/bundle/[bundleName]
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Request Parametersโ
| Value | Example | Requirement |
|---|---|---|
| bundleName | developer | required oneof=starter developer enterpise |
Example Requestโ
Empty body
Example Responseโ
Empty body
Buyโ
This endpoint allows users to refill their bundle quota.
For example: Suppose you are on the start plan, which comes with 1000 invocations, and you have used 500 of them. By calling our endpoint, you can add 1000 to your quota, bringing your total to 1500.
Endpointโ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Example Requestโ
Empty body
Example Responseโ
Empty body
Change Cardโ
With this endpoint, authenticated users can change their credit card on file. This action can be performed once every 24 hours. It's available for users who are not currently enrolled in auto-pay or whose credit card has been declined.
Endpointโ
Request Headersโ
| Key | Value | Required |
|---|---|---|
Authorization | Valid Access Token | true |
Content-Type | application/json | true |
Request Bodyโ
- Default address
- New address
| Key | Example | Requirements |
|---|---|---|
paymentMethod | pm_1MrQQuEt48Mjl075t4BHF9pw | required |
address.default | true | required |
| Key | Example | Requirements |
|---|---|---|
paymentMethod | pm_1MrQQuEt48Mjl075t4BHF9pw | required |
address.company | GreenCloud | optional alphanumspace |
address.street | Main st. | required alphanumspace |
address.city | England | required alphaspace |
address.district | South district | optional alphaspace |
address.postCode | YO31 8SB | required alphanumspace |
address.country | GB | required iso3166_1_alpha2 |
Example Requestโ
- Default address
- New address
{
"paymentMethod": "pm_1MrQQuEt48Mjl075t4BHF9pw",
"address": {
"default": true
}
}
{
"paymentMethod": "pm_1MrQQuEt48Mjl075t4BHF9pw",
"address": {
"company": "GreenCloud", // optional
"street": "My House 8295",
"city": "Parana",
"district": "Entre Rios", // optional
"postCode": "3100",
"country": "AR"
}
}
Example Responseโ
Empty body