NAV
HTTP cURL AJAX

Introduction

Overview

Welcome to the Trenclo API!

We have language bindings in HTTP, Shell and jQuery AJAX. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

This API documentation page was created with Slate.

This documentation is open source. If you spot an error or something which could be more clearly worded, submit an issue or pull request on the GitLab repo.

Quick Start Examples

HTML5 / Javascript

Check out the source code for the Trenclo Admin app on GitLab to understand how we've implemented this API in a cross-platform HTML5 / Javascript application.

Bash / Shell / cURL

Find examples for curl on the command line throughout this documentation. The easiest way to get started testing API calls is to create an API key in the Trenclo Admin app and send the Authorization header as Authorization: ApiKey <Your-API-Key>.

Regions

The API operates in multiple segregated regions. You should connect to the region on which the account was created. The available regions are as follows:

Region Code Region Name Data Location Availability
Test Sandbox Mode United Kingdom ✅ Live
GB United Kingdom United Kingdom ✅ Live
... ... ... ⌛ Coming Soon

Errors

The API uses the following HTTP response codes:

Unsuccessful requests will always return a JSON body in the following format:

{
  "success": false,
  "error": {
    "exceptionText": "User not created. Missing field `emailaddress` from request.",
    "userMessage": "An error occured while attempting to create the user, please check your input and try again."
  },
  "data": []
}
Code Message Description
400 Bad Request Your request is invalid.
403 Forbidden The resource requested is forbidden.
404 Not Found The specified resource could not be found.
429 Too Many Requests You're requesting too many resources! Slow down!
500 Internal Server Error We had a problem with our server. Try again later.
503 Service Unavailable We're temporarily offline for maintenance. Please try again later.

Authentication

Overview

When using an API key, set a header similar to the following:

Authorization: ApiKey <Your-API-Key>

When using a Bearer token, set a header similar to the following:

Authorization: Bearer <Your-Bearer-Token>

The Trenclo API supports OAuth2.0 (for actions on behalf of a user) and API Key authorization (for automation scenarios).

OAuth2.0 Authorization

API Key Authorization

Partner Tenant Access

Partner tenants can perform API actions on behalf of tenants they manage.

Account

Get All Users

GET /v1/users/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/users/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [
    {
      "userid": "1a2b3c4d",
      "tenantid": "1a2b3c4d",
      "emailaddress": "john@doe.com",
      "fullname": "John Doe",
      "usertype": "Admin|Partner|User",
      "language": "en-gb",
      "timezone": "Europe/London",
      "iconfile": "data:uri",
      "emailverified": true,
      "timecreated": "2021-01-01 00:00:00.00000 GMT",
      "timemodified": "2021-01-01 00:00:00.00000 GMT"
    }
  ]
}

This endpoint returns a list of all users in the current tenant.

Get Current User

GET /v1/users/me HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/users/me" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint returns the user object for the owner of the current authorization token.

Get User by ID

GET /v1/users/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/users/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint returns a user by ID.

Update User

Create User

POST /v1/users/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/users/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint creates a new user.

Delete User

DELETE /v1/users/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/users/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint deletes a user by ID.

Get All Tenants

GET /v1/tenants/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/tenants/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint returns a list of all tenants.

Get Current Tenant

GET /v1/tenants/me HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/tenants/me" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint returns the tenant object for the owner of the current authorization token.

Get Tenant by ID

GET /v1/tenants/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/tenants/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint returns a tenant by ID.

Update Tenant

Create Tenant

POST /v1/tenants/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/tenants/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint creates a new tenant.

Delete Tenant

DELETE /v1/tenants/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/tenants/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint deletes a tenant by ID.

Billing

Get All Invoices

GET /v1/billing/invoices/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/invoices/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get Invoice by ID

GET /v1/billing/invoices/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/invoices/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get All Payment Methods

GET /v1/billing/paymentmethods/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/paymentmethods/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get Payment Method by ID

GET /v1/billing/paymentmethods/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/paymentmethods/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Update Payment Method by ID

Create Payment Method

POST /v1/billing/paymentmethods/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/paymentmethods/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Delete Payment Method

DELETE /v1/billing/paymentmethods/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/paymentmethods/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get All Subscriptions

GET /v1/billing/subscriptions/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/subscriptions/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get Subscription by ID

GET /v1/billing/subscriptions/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/subscriptions/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Update Subscription by ID

Create Subscription

POST /v1/billing/subscriptions/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/subscriptions/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Delete Subscription

DELETE /v1/billing/subscriptions/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/subscriptions/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get All Licenses

Get All Licenses for a User

Get License by ID

Update License

Create License

Delete License

Get All Products

GET /v1/billing/products/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/products/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get Product by ID

GET /v1/billing/products/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/products/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get All Plans for a Product

GET /v1/billing/products/1a2b3c4d/plans/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/products/1a2b3c4d/plans/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get Product Plan by ID

GET /v1/billing/products/1a2b3c4d/plans/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/billing/products/1a2b3c4d/plans/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Domain Names

Get All Domains

GET /v1/resources/domains/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/domains/" \
  -H "Authorization: Bearer 1a2b3c4d"
$.ajax({
  'url': 'https://api.<REGION>.trenclo.com/v1/resources/domains/',
  'method': 'GET',
  'dataType': 'json',
  beforeSend: function(){

  },
  success: function(data){

  },
  error: function(){

  }
});

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get Domain by ID

GET /v1/resources/domains/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/domains/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Update Domain by ID

Create Domain

POST /v1/resources/domains/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/domains/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Delete Domain

DELETE /v1/resources/domains/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/domains/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get All DNS Records for Domain

GET /v1/resources/domains/1a2b3c4d/dns/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/domains/1a2b3c4d/dns/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get DNS Record by ID

Update DNS Record by ID

Create DNS Record

Delete DNS Record by ID

Get All Domain Contacts

GET /v1/resources/domaincontacts/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/domaincontacts/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get Domain Contact

Update Domain Contact

Create Domain Contact

Delete Domain Contact

Server Hosting

Get All Servers

GET /v1/resources/servers/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/servers/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Get Server by ID

GET /v1/resources/servers/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/servers/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Update Server by ID

Create Server

POST /v1/resources/servers/ HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/servers/" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint

Delete Server

DELETE /v1/resources/servers/1a2b3c4d HTTP/2.0
Host: api.<REGION>.trenclo.com:443
Authorization: Bearer 1a2b3c4d
curl "https://api.<REGION>.trenclo.com/v1/resources/servers/1a2b3c4d" \
  -H "Authorization: Bearer 1a2b3c4d"

This endpoint returns JSON structured like this:

{
  "success": true,
  "data": [

  ]
}

This endpoint