Skip to main content

๐Ÿง‘ Account

You can retrieve your user information and manage your account settings with calls to the user endpoint.

Userโ€‹

info

This endpoint allows authenticated users to get their account information.

Endpointโ€‹

GET
https://api.greencloud.dev/v1/user
https://api.greencloud.dev/v1/user

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue

Example Requestโ€‹

Empty body

Example Response:โ€‹

Status: 200 OK
{
"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โ€‹

info

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โ€‹

PUT
https://api.greencloud.dev/v1/user/flags
https://api.greencloud.dev/v1/user/flags

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue
Content-Typeapplication/jsontrue

Request Bodyโ€‹

KeyExampleRequirements
bundleAutoRenewaltrueoptional bool | Note: defaults to false if empty
lowQuotaNotificationfalseoptional bool | Note: defaults to false if empty

Example Requestโ€‹

{
"bundleAutoRenewal": false, // optional
"lowQuotaNotification": false // optional
}

Example Responseโ€‹

Status: 204 No Content
Empty body

Change Passwordโ€‹

info

This endpoint allows authenticated users to change their password. It also requires a twofa field if two-factor authentication is enabled.

Endpointโ€‹

PUT
https://api.greencloud.dev/v1/user/password
https://api.greencloud.dev/v1/user/password

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue
Content-Typeapplication/jsontrue

Request Bodyโ€‹

KeyExampleRequirements
passwordHello123!required min=8 containsany=!@#$%&\*
twofa123456required when 2FA is enabled

Example Requestโ€‹

{
"password":"Hello123!",
"twofa":"123456" // optional, required only when active
}

Example Responseโ€‹

Status: 204 No Content
Empty body

Reset Passwordโ€‹

info

This endpoint allows users to request a password reset code to be sent to their registered email address.

Endpointโ€‹

POST
https://api.greencloud.dev/v1/user/resetPassword
https://api.greencloud.dev/v1/user/resetPassword
KeyValueRequired
Content-Typeapplication/jsontrue

Request Bodyโ€‹

KeyExampleRequirements
email
[email protected]
required

Example Requestโ€‹

{
"email": "[email protected]"
}

Example Responseโ€‹

Status: 204 No Content
Empty body

Set Passwordโ€‹

info

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โ€‹

GET
https://api.greencloud.dev/v1/user/resetPassword
https://api.greencloud.dev/v1/user/resetPassword

Request Headersโ€‹

KeyValueRequired
Content-Typeapplication/jsontrue

Request Bodyโ€‹

KeyExampleRequirements
passwordHello123!required min=8 containsany=!@#$%&\*
codeb352935253674aeeb43d4ed4362745abrequired
twofa123456required when 2FA is enabled

Example Requestโ€‹

{
"password": "Hello123!",
"code": "b352935253674aeeb43d4ed4362745ab",
"twofa": "123456" // optional, required only when active
}

Example Responseโ€‹

Status: 204 No Content
Empty body

Set Bundleโ€‹

info

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โ€‹

POST
https://api.greencloud.dev/v1/user/bundle
https://api.greencloud.dev/v1/user/bundle

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue
Content-Typeapplication/jsontrue

Request Bodyโ€‹

KeyExampleRequirements
nameDEVELOPERrequired oneof=STARTER DEVELOPER ENTERPRISE
paymentMethodpm_1MrQQuEt48Mjl075t4BHF9pwrequired startswith=pm_
address.companyGreenCloudoptional alphanumspace
address.streetMain st.required alphanumspace
address.cityEnglandrequired alphaspace
address.districtSouth districtoptional alphaspace
address.postCodeYO31 8SBrequired alphanumspace
address.countryGBrequired 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โ€‹

Status: 204 No Content
Empty body

Change Bundleโ€‹

info

With this endpoint, authenticated users can change their account bundle. We offer three different bundles to choose from: starter, developer, and enterprise.

Endpointโ€‹

PUT
https://api.greencloud.dev/v1/user/bundle/[bundleName]
https://api.greencloud.dev/v1/user/bundle/[bundleName]

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue

Request Parametersโ€‹

ValueExampleRequirement
bundleNamedeveloperrequired oneof=starter developer enterpise

Example Requestโ€‹

Empty body

Example Responseโ€‹

Status: 204 No Content
Empty body

Buyโ€‹

info

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โ€‹

POST
https://api.greencloud.dev/v1/user/buy
https://api.greencloud.dev/v1/user/buy

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue

Example Requestโ€‹

Empty body

Example Responseโ€‹

Status: 201 Created
Empty body

Change Cardโ€‹

info

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โ€‹

PUT
https://api.greencloud.dev/v1/user/card/
https://api.greencloud.dev/v1/user/card/

Request Headersโ€‹

KeyValueRequired
AuthorizationValid Access Tokentrue
Content-Typeapplication/jsontrue

Request Bodyโ€‹

KeyExampleRequirements
paymentMethodpm_1MrQQuEt48Mjl075t4BHF9pwrequired
address.defaulttruerequired

Example Requestโ€‹

{
"paymentMethod": "pm_1MrQQuEt48Mjl075t4BHF9pw",
"address": {
"default": true
}
}

Example Responseโ€‹

Status: 204 No Content
Empty body