Cherry Servers API Docs (1.0.0)

Download OpenAPI specification:Download

Authentication

Most of the endpoints require authentication. Authenticating is done with an Bearer Token in the Authorization header.

    curl -H 'Authorization: Bearer my_authentication_token'

Authentication tokens are used to identify the user your application is connecting to the Cherry Servers API on behalf of. Think of authentication tokens as permanent sessions—the user creates authentication tokens, and your app can use them to connect to the API on their behalf until they delete the token.

Users can create authentication tokens in the Cherry Server client portal.

Response codes

Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with internal servers.

200, 201, 204 Everything worked as expexted.
400 Bad parameters or request can't be made.
401 No valid API key provided.
403 Insufficient permissions to access resource.
404 Resource doesn't exist.
500 Something went wrong.

Common parameters

List parameters:

Limit Ofset X-Total-Count header

More params: query parameter fields

Images

Retrieve plan oses

path Parameters
planId
required
string
query Parameters
fields
required
string
Default: "images,pricing"
limit
string\d+
Default: 0
offset
string\d+
Default: 0

Responses

200

Returns list of available operating systemsšą

get /v1/plans/{planId}/images
http://api.cherryservers.com//v1/plans/{planId}/images
https://api.cherryservers.com//v1/plans/{planId}/images

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Retrieve custom plan oses

path Parameters
teamId
required
string
planId
required
string
query Parameters
fields
required
string
Default: "images,pricing"
limit
string\d+
Default: 0
offset
string\d+
Default: 0

Responses

200

Returns list of available operating systems

get /v1/teams/{teamId}/plans/{planId}/images
http://api.cherryservers.com//v1/teams/{teamId}/plans/{planId}/images
https://api.cherryservers.com//v1/teams/{teamId}/plans/{planId}/images

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

<no summary>

path Parameters
serverId
required
string
query Parameters
fields
required
string
Default: "images,pricing"
limit
string\d+
Default: 0
offset
string\d+
Default: 0

Responses

200

Returns server plan available images

get /v1/servers/{serverId}/images
http://api.cherryservers.com//v1/servers/{serverId}/images
https://api.cherryservers.com//v1/servers/{serverId}/images

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Invitations

Retrieve team invitations

path Parameters
teamId
required
string
query Parameters
fields
required
string
Default: "invitation,href"
limit
string\d+
Default: 0
offset
string\d+
Default: 0

Responses

200

Returns team invitation list

get /v1/teams/{teamId}/invitations
http://api.cherryservers.com//v1/teams/{teamId}/invitations
https://api.cherryservers.com//v1/teams/{teamId}/invitations

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Send inviation

path Parameters
teamId
required
string
query Parameters
fields
required
string
Default: "invitation,href"
Request Body schema: application/json
email
required
string

invitee email

message
required
string
Default: ""
projects
Array of any
roles
required
Array of anyROLE_ADMIN|ROLE_BILLING|ROLE_COLLABORATOR
Default: "ROLE_COLLABORATOR"

Responses

201

Create invitation

post /v1/teams/{teamId}/invitations
http://api.cherryservers.com//v1/teams/{teamId}/invitations
https://api.cherryservers.com//v1/teams/{teamId}/invitations

Request samples

application/json
Copy
Expand all Collapse all
{
  • "email": "string",
  • "message": "",
  • "projects":
    [
    ],
  • "roles": "ROLE_COLLABORATOR"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "href": "string",
  • "invitee": "string",
  • "message": "string",
  • "updated": "2019-06-05T12:43:12Z",
  • "created": "2019-06-05T12:43:12Z",
  • "invited_by":
    {
    },
  • "team":
    {
    },
  • "roles":
    [
    ],
  • "projects":
    [
    ]
}

View an invitation

path Parameters
invitationId
required
string
query Parameters
fields
required
string
Default: "invitation,href"

Responses

200

Get invitation

get /v1/invitations/{invitationId}
http://api.cherryservers.com//v1/invitations/{invitationId}
https://api.cherryservers.com//v1/invitations/{invitationId}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "href": "string",
  • "invitee": "string",
  • "message": "string",
  • "updated": "2019-06-05T12:43:12Z",
  • "created": "2019-06-05T12:43:12Z",
  • "invited_by":
    {
    },
  • "team":
    {
    },
  • "roles":
    [
    ],
  • "projects":
    [
    ]
}

Accept invitation

path Parameters
invitationId
required
string
query Parameters
fields
required
string
Default: "membership,href"

Responses

200

Accept invitation

put /v1/invitations/{invitationId}
http://api.cherryservers.com//v1/invitations/{invitationId}
https://api.cherryservers.com//v1/invitations/{invitationId}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "href": "string",
  • "roles": { }
}

Decline invitation

path Parameters
invitationId
required
string

Responses

204

Successfully delete invitation object

403

Access denied

delete /v1/invitations/{invitationId}
http://api.cherryservers.com//v1/invitations/{invitationId}
https://api.cherryservers.com//v1/invitations/{invitationId}

Ip Addresses

Retrieve available project ip addresses

List of free project ip addresses.

path Parameters
projectId
required
string
query Parameters
fields
required
string
Default: "ip,href,region"
region
required
string <RegionConstraint>

Responses

200

Returns list of available ip addresses

get /v1/projects/{projectId}/available_ips
http://api.cherryservers.com//v1/projects/{projectId}/available_ips
https://api.cherryservers.com//v1/projects/{projectId}/available_ips

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Retrieve all project ip addresses

path Parameters
projectId
required
string
query Parameters
fields
required
string
Default: "ip,href,region"
limit
string\d+
Default: 0
offset
string\d+
Default: 0
type
Array of anysubnet|primary-ip|floating-ip|private-ip

Responses

200

Returns list of ip addresses

get /v1/projects/{projectId}/ips
http://api.cherryservers.com//v1/projects/{projectId}/ips
https://api.cherryservers.com//v1/projects/{projectId}/ips

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Request ip address

path Parameters
projectId
required
string
query Parameters
fields
required
string
Default: "ip,href"
Request Body schema: application/json
region
required
string <RegionConstraint>

Available regions EU-East-1, EU-West-1.

routed_to
string

Server primary or secondary ip id identificator where requested ip will be routed to.

ptr_record
string
a_record
string
ddos_scrubbing
boolean <AntiDDosConstraint>

Responses

201

Order ip address

400

Bad request

post /v1/projects/{projectId}/ips
http://api.cherryservers.com//v1/projects/{projectId}/ips
https://api.cherryservers.com//v1/projects/{projectId}/ips

Request samples

application/json
Copy
Expand all Collapse all
{
  • "region": "string",
  • "routed_to": "string",
  • "ptr_record": "string",
  • "a_record": "string",
  • "ddos_scrubbing": true
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "address": "string",
  • "address_family": 0,
  • "cidr": "string",
  • "gateway": "string",
  • "type": "string",
  • "region":
    {
    },
  • "routed_to": { },
  • "assigned_to":
    {
    },
  • "ptr_record": "string",
  • "a_record": "string",
  • "ddos_scrubbing": true,
  • "href": "string"
}

Retrieve single ip address

path Parameters
projectId
required
string
ipId
required
string
query Parameters
fields
required
string
Default: "ip,href,region,server"

Responses

200

Returns ip object

get /v1/projects/{projectId}/ips/{ipId}
http://api.cherryservers.com//v1/projects/{projectId}/ips/{ipId}
https://api.cherryservers.com//v1/projects/{projectId}/ips/{ipId}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "address": "string",
  • "address_family": 0,
  • "cidr": "string",
  • "gateway": "string",
  • "type": "string",
  • "region":
    {
    },
  • "routed_to": { },
  • "assigned_to":
    {
    },
  • "ptr_record": "string",
  • "a_record": "string",
  • "ddos_scrubbing": true,
  • "href": "string"
}

Update ip address

Floating ip addresses can be routed_to server primary ip address or subnet ip address. Subnet ip addresses can be assigned_to servers.

path Parameters
projectId
required
string
ipId
required
string
query Parameters
fields
required
string
Default: "ip,href"
Request Body schema: application/json
routed_to
string

Server primary or secondary ip id.

assigned_to
string\d+

Server id identificator.

ptr_record
string
a_record
string

Responses

201

Ip has been updated

400

Wrong parameters

put /v1/projects/{projectId}/ips/{ipId}
http://api.cherryservers.com//v1/projects/{projectId}/ips/{ipId}
https://api.cherryservers.com//v1/projects/{projectId}/ips/{ipId}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "routed_to": "string",
  • "assigned_to": "string",
  • "ptr_record": "string",
  • "a_record": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "address": "string",
  • "address_family": 0,
  • "cidr": "string",
  • "gateway": "string",
  • "type": "string",
  • "region":
    {
    },
  • "routed_to": { },
  • "assigned_to":
    {
    },
  • "ptr_record": "string",
  • "a_record": "string",
  • "ddos_scrubbing": true,
  • "href": "string"
}

Remove ip address

path Parameters
projectId
required
string
ipId
required
string

Responses

204

Successfully deleted ip object

400

Bad request

delete /v1/projects/{projectId}/ips/{ipId}
http://api.cherryservers.com//v1/projects/{projectId}/ips/{ipId}
https://api.cherryservers.com//v1/projects/{projectId}/ips/{ipId}

Memberships

Retrieve team memberships

path Parameters
teamId
required
string
query Parameters
fields
required
string
Default: "membership,href,project,user"
limit
string\d+
Default: 0
offset
string\d+
Default: 0

Responses

200

Returns list of team memberships

get /v1/teams/{teamId}/memberships
http://api.cherryservers.com//v1/teams/{teamId}/memberships
https://api.cherryservers.com//v1/teams/{teamId}/memberships

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Retrieve current session membership

path Parameters
teamId
required
string
query Parameters
fields
required
string
Default: "membership"

Responses

200

Return current user membership

get /v1/teams/{teamId}/membership
http://api.cherryservers.com//v1/teams/{teamId}/membership
https://api.cherryservers.com//v1/teams/{teamId}/membership

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "href": "string",
  • "roles": { }
}

Retrieve a membership

path Parameters
membershipId
required
string
query Parameters
fields
required
string
Default: "membership,href,project,user"

Responses

200

Return membership object

get /v1/memberships/{membershipId}
http://api.cherryservers.com//v1/memberships/{membershipId}
https://api.cherryservers.com//v1/memberships/{membershipId}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "href": "string",
  • "roles": { },
  • "user":
    {
    },
  • "projects":
    [
    ]
}

Update a membership

Only members with ROLE_ADMIN can update a membership.

path Parameters
membershipId
required
string
query Parameters
fields
required
string
Default: "membership,href,project,user"
Request Body schema: application/json
roles
required
Array of anyROLE_ADMIN|ROLE_BILLING|ROLE_COLLABORATOR
projects
required
Array of any\d+

If user have only ROLE_COLLABORATOR, there is ability to choose with which projects user can collaborate.

Responses

201

Membership has been updated

400

Wrong parameters

put /v1/memberships/{membershipId}
http://api.cherryservers.com//v1/memberships/{membershipId}
https://api.cherryservers.com//v1/memberships/{membershipId}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "roles":
    [
    ],
  • "projects":
    [
    ]
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "href": "string",
  • "roles": { },
  • "user":
    {
    },
  • "projects":
    [
    ]
}

Remove a membership

Only members with ROLE_ADMIN can remove a membership.

path Parameters
membershipId
required
string

Responses

204

Membership successfully deleted

403

Access denied

delete /v1/memberships/{membershipId}
http://api.cherryservers.com//v1/memberships/{membershipId}
https://api.cherryservers.com//v1/memberships/{membershipId}

Plans

Retrieve plans

path Parameters
teamId
required
string
query Parameters
fields
required
string
Default: "plan,