Create Customer

Create Customer #

Creates a new Customer tenant

POST /v1.0/accounts/{ACCOUNT_TENANT_ID}/customers

Example #

This request will create a new Customer with the following details:

  • Name: "New customer"
  • Description: "This is my new customer"
  • Reference: "ABC00001"
  • Enabled: false
  • TimeZone : "America/Los_Angeles",
  • CountryCode: "US"
  • PbxConnectionProfile
    • Crossbar Rest Api: "https://hostrest"
    • Blackhole Websocket Api: "wss//:hostwebsocket"
    • ~.pbx.kazoo.name.~ AccountId: "accountid"
    • ~.pbx.kazoo.name.~ Api Key: "apikey"
    • monitorSubAccounts: False
  • sendNewUserEmail: False
  • sendConnectWelcomeEmail: False
  • TrialDuration: "0"

Request #

POST <https://api.na.myreports.cloud/api/v1.0/accounts/{ACCOUNT_TENANT_ID}/customers> HTTP/1.1
Content-Type: application/json
accept-charges: true
Authorisation: Bearer {TOKEN}
Connection: keep-alive
{
	"name": "New customer",
	"description": "This is my new customer",
	"reference" : "ABC00001",
	"enabled": false,
	"timezone": "America/Los_Angeles",
	"countryCode": "US",
	"pbxConnectionProfile": {
		"\_type": "KazooPbxConnectionProfile",
		"hostRest": "http\://hostrest",
		"hostWebsocket": "wss//:hostwebsokcet",
		"accountId": "accountid",
		"apiKey": "apikey",
		monitorSubAccounts: false
	},
	"sendNewUserEmail": false,
	"sendConnectWelcomeEmail": false,
	"trialduration" : "0"
}

Response #

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Content-Length: xx
Location: h <https://api.na.myreports.cloud/api/v1.0/accounts/{ACCOUNT_TENANT_ID}/customers/{NEW_CUSTOMER_TENANT_ID}>
{
	"data": {
		"id": "{NEW_CUSTOMER_TENANT_ID}",
		"name": "New customer",
		"description": "This is my new customer",
		"enabled": false,
		"parentTenantId": "{ACCOUNT_TENANT_ID}"
	},
	"status": "success",
	"timestamp": "2019-01-01T10:00:00.6829447Z"
}

Errors #

Unauthorised #

When the token is not provided, invalid or expired

HTTP/1.1 401 Unauthorised

Bad Request (1) #

When requesting a trial and your reseller account does not have permission.

HTTP/1.1 400 Bad Request
Date: Thu, 06 Feb 2020 12:45:27 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 149
{
	"error": 400,
	"message": "Trial customers are not enabled for your account.",
	"status": "error",
	"timestamp": "2020-02-06T12:45:27.5903465Z"
}

Bad Request (2) #

When requesting a trial beyond the configured maximum trial duration.

HTTP/1.1 400 Bad Request
Date: Thu, 06 Feb 2020 12:45:27 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 149
{
	"error": 400,
	"message": "The customers trial exceeds the maximum duration allowed for your account.",
	"status": "error",
	"timestamp": "2020-02-06T12:45:27.5903465Z"
}