23. Partner API
Partner API gives UpCloud partners the ability to create new accounts for their end users.
Get account list
Returns list of accounts that have been associated with the partner.
Request
Normal response
[
{
"address" : "Some street",
"city" : "Some city",
"company" : "Some company",
"country" : "FIN",
"email" : "[email protected]",
"first_name" : "Some",
"last_name" : "User",
"phone" : "+358.91234567",
"postal_code" : "00100",
"state" : "",
"username" : "someuser",
"vat_number" : ""
},
{
"address" : "Another street",
"city" : "Another city",
"company" : "Another company",
"country" : "FIN",
"email" : "[email protected]",
"first_name" : "Another",
"last_name" : "User",
"phone" : "+358.97654321",
"postal_code" : "90100",
"state" : "",
"username" : "anotheruser",
"vat_number" : ""
}
]
Create new account
Creates new UpCloud account that will be linked to partner's existing invoicing.
Request (without contact details)
Request (with minimal contact details)
{
"username": "newuser",
"password": "superSecret123",
"contact_details": {
"country": "FIN",
"email": "[email protected]",
"first_name": "New",
"last_name": "User",
"phone": "+358.91111111"
}
}
Attributes
Attribute | Accepted value | Required | Description |
---|---|---|---|
username | 4-64 characters matching regexp pattern ^[a-z0-9]+(_[a-z0-9]+)*$ |
yes | Account username |
password | 8-256 characters; at least one lowercase letter (a-z ), one uppercase letter (A-Z ) and one digit (0-9 ) required |
yes | Account password |
contact_details | JSON object containing contact details (described below) | no | Account contact details |
If attribute contact_details
is omitted, contact details for new account are copied from the partner account. Otherwise, contact_details
should be a JSON object
consisting of the following attributes:
Attribute | Accepted value | Required | Description |
---|---|---|---|
first_name | 1-50 characters | yes | First name |
last_name | 1-50 characters | yes | Last name |
company | 1-100 characters | no | Company name |
address | 1 or 2 lines, each containing 1-100 characters | no | Street address |
postal_code | 1-20 characters | no | Postal/zip code |
city | 1-100 characters | no | City |
state | If country is USA , needs to be a valid U.S. state |
yes if country is USA |
State |
country | ISO 3166-1 alpha-3 code | yes | ISO 3166-1 three character country code |
phone | +countrycode.nationalpart | yes | Phone number in international format, country code and national part separated by a period |
Valid e-mail address | yes | E-mail address | |
vat_number | Valid VAT number | no | Valid VAT number in the contact's country |
Normal response
{
"address" : "",
"city" : "",
"company" : "",
"country" : "FIN",
"email" : "[email protected]",
"first_name" : "New",
"last_name" : "User",
"phone" : "+358.91111111",
"postal_code" : "",
"state" : "",
"username" : "newuser",
"vat_number" : ""
}
Error response
HTTP status | Error code | Description |
---|---|---|
403 Forbidden | ACCOUNT_CREATION_LIMIT_REACHED | Partner specific account creation limit has been reached. |
409 Conflict | ACCOUNT_EXISTS | An account using the given username already exists. |
400 Bad Request | ADDRESS_INVALID | The attribute address has an invalid value. |
400 Bad Request | CITY_INVALID | The attribute city has an invalid value. |
400 Bad Request | COMPANY_INVALID | The attribute company has an invalid value. |
400 Bad Request | COUNTRY_INVALID | The attribute country has an invalid value. |
400 Bad Request | COUNTRY_MISSING | The attribute country is missing from the request. |
400 Bad Request | EMAIL_INVALID | The attribute email has an invalid value. |
400 Bad Request | EMAIL_MISSING | The attribute email is missing from the request. |
400 Bad Request | FIRST_NAME_INVALID | The attribute first_name has an invalid value. |
400 Bad Request | FIRST_NAME_MISSING | The attribute first_name is missing from the request. |
400 Bad Request | LAST_NAME_INVALID | The attribute last_name has an invalid value. |
400 Bad Request | LAST_NAME_MISSING | The attribute last_name is missing from the request. |
400 Bad Request | PASSWORD_INVALID | The attribute password has an invalid value. |
400 Bad Request | PASSWORD_MISSING | The attribute password is missing from the request. |
400 Bad Request | PHONE_INVALID | The attribute phone has an invalid value. |
400 Bad Request | PHONE_MISSING | The attribute phone is missing from the request. |
400 Bad Request | POSTAL_CODE_INVALID | The attribute postal_code has an invalid value. |
400 Bad Request | STATE_INVALID | The attribute state has an invalid value. |
400 Bad Request | STATE_MISSING | The attribute state is missing from the request. |
400 Bad Request | USERNAME_INVALID | The attribute username has an invalid value. |
400 Bad Request | USERNAME_MISSING | The attribute username is missing from the request. |
400 Bad Request | VAT_NUMBER_INVALID | The attribute vat_number has an invalid value. |