Endpoints

Overview

An Endpoint is what clients will call to consume the RPC. Endpoints belong to a Subscription, which holds its metadata. An endpoint's name is assigned to you when it's created and is randomly assigned.

List Endpoints

GET /api/v1/endpoints

Returns all endpoints to which the current authentication token has access.

Parameters

NameTypeDescription

account_uuid *

string

Will filter the results by account_uuid.

subscription_uuid *

string

Will limit the results by subscription_uuid.

* Either a subscription_uuid or account_uuid parameter is required

Request

Example requests with account_uuid and subscription_uuid filtering.

curl 'https://customers.triton.one/api/v1/endpoints?account_uuid=c92a9cea-47cc-494b-b1b0-4230a2316ee5' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" 
curl 'https://customers.triton.one/api/v1/endpoints?subscription_uuid=74ea9d9a-4b2a-4f01-af47-1c175f8a2af6' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" 

Response

Returns a hash with the endpoints key containing an array of endpoints objects.

{
   "endpoints": [
      {
         "uuid": "23ab660b-cb09-4ca5-b49a-518b422a8d81",
         "name": "Jacobson LLC cbp4i3u71m",
         "value": null,
         "slug": "academy-strict-fnalfmab4l",
         "rate_tier": "developer",
         "is_active": true,
         "value_override": null,
         "values": [
            "academy-strict-fnalfmab4l.TEST 1",
            "academy-strict-fnalfmab4l.TWST 2",
            "academy-strict-fnalfmab4l.value-3"
         ],
         "default_values": [
            "academy-strict-fnalfmab4l.TEST 1",
            "academy-strict-fnalfmab4l.TWST 2",
            "academy-strict-fnalfmab4l.value-3"
         ],
         "allowed_origins": [
            {
               "uuid": "b4d5ec62-410d-45f8-8b45-44fe6641cf1f",
               "value": "vonrueden-haag.co",
               "is_active": true
            }
         ],
         "deactivation_reasons": [
            {
               "description": "Deactivation reason description",
               "created_at": "2023-06-26T20:16:05Z"
            }
         ]
      },
      { endpoint_object_2 },
      { endpoint_object_3 },
      ...
   ]
}

Get Endpoint

This API is not available.

Create Endpoint

This API is only limited to account management API tokens created with the reseller role.

POST /api/v1/subscriptions/:subscription_uuid/endpoints

Parameters

NameTypeDescription

name *required

string

A human-readable name to describe the endpoint.

rate_tier *required

string

The name of the Rate Tier for this endpoint, which defines rate limits on the Endpoint. Each endpoint incurs costs based on the Rate Tier defined for it.

allowed_origins

array[{ value: dns_cname }, { value: dns_cname }]

An array of DNS CNAME records that define origins that can access the endpoint. This is commonly used by frontends that can't obscure an API access token.

Request

Example requests with account_uuid and subscription_uuid filtering. All new allowed origins are automatically enabled.

curl -X POST 'https://customers.triton.one/api/v1/subscriptions/74ea9d9a-4b2a-4f01-af47-1c175f8a2af6/endpoints' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" -d '
{
    "endpoint": {
        "name": "Endpoint 123",
        "rate_tier": "developer",
        "allowed_origins":  [{ value: "example.com" }, { value: "frontend.website.com" }]
    }
}' 

Response

All submitted keys, plus the following are returned:

NameTypeDescription

uuid

string

The generated primary key to reference this endpoint.

values

array[string (DNS CNAME), ...]

The endpoint values that should be called by clients to consume the RPC.

{
   "endpoint": {
      "uuid": "a5131884-1ce4-4415-98f8-d040901ecbd0",
      "name": "Endpoint 123",
      "slug": "tylerqt-example-3c6e",
      "rate_tier": "developer",
      "is_active": false,
      "value_override": null,
      "values": [
         "tylerqt-example-3c6e.TEST 1",
         "tylerqt-example-3c6e.TWST 2",
         "tylerqt-example-3c6e.value-3"
      ],
      "default_values": [
         "tylerqt-example-3c6e.TEST 1",
         "tylerqt-example-3c6e.TWST 2",
         "tylerqt-example-3c6e.value-3"
      ],
      "allowed_origins": [
         {
            "uuid": "4d63807d-84f2-491c-898e-9190fa334592",
            "value": "example.com",
            "is_active": true
         },
         {
            "uuid": "a21d362b-f488-4778-8e5c-d3c917efd764",
            "value": "frontend.website.com",
            "is_active": true
         }
      ],
      "deactivation_reasons": []
   }
}    

Update Endpoint

PUT /api/v1/endpoints/:endpoint_uuid

Update an endpoint. Only allowed_origins can be updated. Accepts updates as full-updates, where the passed in list overwrites any existing allowed_origins.

Parameters

NameTypeDescription

name

string

A human-readable name to describe the endpoint.

rate_tier *limited to REST API tokens created with the reseller role.

string

A Rate Tier name. It's assigned to an Endpoint in order to determine how much the endpoint costs

allowed_origins *limited to one allowed origin for standard role.

array[{ value: dns_cname, is_active: boolean }, { value: dns_cname, is_active: boolean }]

An array of DNS CNAME and is_active records that define origins that can access the endpoint. This is commonly used by frontends that can't obscure an API access token.

Request

Example requests with account_uuid and subscription_uuid filtering.

curl -X PUT 'https://customers.triton.one/api/v1/endpoints/74ea9d9a-4b2a-4f01-af47-1c175f8a2af6' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" -d '
{
    "endpoint": {
        "name": "Endpoint 123",
        "rate_tier": "developer",
        "allowed_origins": [{ value: "example.com", is_active: true }, { value: "frontend.website.com", is_active: true }]
    }
}' 

Response

All submitted keys, plus the following are returned:

NameTypeDescription

uuid

string

The generated primary key to reference this endpoint.

values

array[string (DNS CNAME), ...]

The endpoint values that should be called by clients to consume the RPC.

{
   "endpoint": {
      "uuid": "6ec86e74-783b-4779-b626-937a5c1e2a89",
      "name": "New Endpoint Name",
      "value": null,
      "slug": "tylerqt-example-f988",
      "rate_tier": "developer",
      "is_active": false,
      "value_override": null,
      "values": [
         "tylerqt-example-f988.TEST 1",
         "tylerqt-example-f988.TWST 2",
         "tylerqt-example-f988.value-3"
      ],
      "default_values": [
         "tylerqt-example-f988.TEST 1",
         "tylerqt-example-f988.TWST 2",
         "tylerqt-example-f988.value-3"
      ],
      "allowed_origins": [
         {
            "uuid": "32d511f0-3fb0-4570-8922-f8bc988b41a1",
            "value": "example.com",
            "is_active": true
         }
      ],
      "deactivation_reasons": [
          {
            "description": "Deactivation reason description",
            "created_at": "2023-07-03T12:00:22Z"
         }
      ]
   }
}

Activate Endpoint

This API is only limited to accoutn management API tokens created with the reseller role.

PUT /api/v1/endpoints/:endpoint_uuid/activate

Activate an endpoint so that it can be used.

Parameters

endpoint_uuid is the only parameter that needs to be provided.

Request

curl -X PUT 'https://customers.triton.one/api/v1/endpoints/74ea9d9a-4b2a-4f01-af47-1c175f8a2af6/activate' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json"

Response

204 No Content

Deactivate Endpoint

This API is only limited to account managemrnt API tokens created with the reseller role.

PUT /api/v1/endpoints/:endpoint_uuid/deactivate

Deactivate an endpoint so that it cannot be used.

Parameters

All parameters are optional.

NameTypeDescription

deactivation_reason

string

A human readable description to describe the deactivation reason.

Request

Example request with optional deactivation_reason.

curl -X PUT 'https://customers.triton.one/api/v1/endpoints/74ea9d9a-4b2a-4f01-af47-1c175f8a2af6/deactivate' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" -d '
{
    "deactivation_reason": "Deactivation reason description"
}' 

Response

204 No Content

Last updated