Tenant APIs

Authentication

Unlike the other services, the tenant services do not accept API keys or OAuth access tokens. Instead, authentication is done with a “tenant admin key” that is configured in the Identity Server

  • Usage with HTTP Authorization Header: TenantAdminKey XXXXX
  • Usage with gRPC call credentials (in the authorization header): TenantAdminKey XXXXX

The TenantRegistry service

Method TenantRegistry.Create
Request type CreateTenantRequest
Response type Tenant
HTTP bindings

POST /api/v3/tenants

Method TenantRegistry.Get
Request type GetTenantRequest
Response type Tenant
HTTP bindings

GET /api/v3/tenants/{tenant_ids.tenant_id}

Method TenantRegistry.GetRegistryTotals
Request type GetTenantRegistryTotalsRequest
Response type TenantRegistryTotals
HTTP bindings

GET /api/v3/tenants/{tenant_ids.tenant_id}/registry-totals

Method TenantRegistry.List
Request type ListTenantsRequest
Response type Tenants
HTTP bindings

GET /api/v3/tenants

Method TenantRegistry.Update
Request type UpdateTenantRequest
Response type Tenant
HTTP bindings

PUT /api/v3/tenants/{tenant.ids.tenant_id}

Method TenantRegistry.Delete
Request type TenantIdentifiers
Response type google.protobuf.Empty
HTTP bindings

DELETE /api/v3/tenants/{tenant_id}

Messages

Message Tenant

Tenant is the message that defines a Tenant in the network.

Field Type Description
ids TenantIdentifiers

required

created_at google.protobuf.Timestamp
updated_at google.protobuf.Timestamp
name string

max_len: 50

description string

max_len: 2000

attributes map of string to string
contact_info repeated ttn.lorawan.v3.ContactInfo
max_applications google.protobuf.UInt64Value

If set, restricts the maximum number of applications that can be created.

max_clients google.protobuf.UInt64Value

If set, restricts the maximum number of clients that can be created.

max_end_devices google.protobuf.UInt64Value

If set, restricts the maximum number of end_devices that can be created.

max_gateways google.protobuf.UInt64Value

If set, restricts the maximum number of gateways that can be created.

max_organizations google.protobuf.UInt64Value

If set, restricts the maximum number of organizations that can be created.

max_users google.protobuf.UInt64Value

If set, restricts the maximum number of users that can be created.

state ttn.lorawan.v3.State

The reviewing state of the tenant. This field can only be modified by tenant admins.

defined_only

capabilities google.protobuf.Struct
configuration Configuration
billing Billing
Show object example
{
  "ids": {},
  "created_at": "0001-01-01T00:00:00Z",
  "updated_at": "0001-01-01T00:00:00Z",
  "name": "",
  "description": "",
  "attributes": {},
  "contact_info": [],
  "max_applications": null,
  "max_clients": null,
  "max_end_devices": null,
  "max_gateways": null,
  "max_organizations": null,
  "max_users": null,
  "state": "STATE_REQUESTED",
  "capabilities": {},
  "configuration": {},
  "billing": {},
}

Message TenantIdentifiers

Field Type Description
tenant_id string

max_len: 36

pattern: ^[a-z0-9](?:[-]?[a-z0-9]){2,}$

Show object example
{
  "tenant_id": "",
}

Message Tenants

Field Type Description
tenants repeated Tenant
Show object example
{
  "tenants": [],
}

Message CreateTenantRequest

Field Type Description
tenant Tenant

required

initial_user ttn.lorawan.v3.User
Show object example
{
  "tenant": {},
  "initial_user": {},
}

Message GetTenantRequest

Field Type Description
tenant_ids TenantIdentifiers

required

field_mask google.protobuf.FieldMask
Show object example
{
  "tenant_ids": {},
  "field_mask": {},
}

Message GetTenantRegistryTotalsRequest

Field Type Description
tenant_ids TenantIdentifiers
field_mask google.protobuf.FieldMask
Show object example
{
  "tenant_ids": {},
  "field_mask": {},
}

Message TenantRegistryTotals

Field Type Description
applications uint64
clients uint64
end_devices uint64
gateways uint64
organizations uint64
users uint64
Show object example
{
  "applications": 0,
  "clients": 0,
  "end_devices": 0,
  "gateways": 0,
  "organizations": 0,
  "users": 0,
}

Message ListTenantsRequest

Field Type Description
field_mask google.protobuf.FieldMask
order string

Order the results by this field path (must be present in the field mask). Default ordering is by ID. Prepend with a minus (-) to reverse the order.

in: [ tenant_id -tenant_id name -name created_at -created_at]

limit uint32

Limit the number of results per page.

lte: 1000

page uint32

Page number for pagination. 0 is interpreted as 1.

Show object example
{
  "field_mask": {},
  "order": "",
  "limit": 0,
  "page": 0,
}

Message UpdateTenantRequest

Field Type Description
tenant Tenant

required

field_mask google.protobuf.FieldMask
Show object example
{
  "tenant": {},
  "field_mask": {},
}