Skip to content
Start here

Get tenant

client.tenants.get(stringtenantId, RequestOptionsoptions?): Tenant { cdate, edate, tenant_contacts, 9 more }
GET/tenants/{tenant_id}

Retrieves a Tenant by Tenant ID.

Security

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
tenantId: string
ReturnsExpand Collapse
Tenant { cdate, edate, tenant_contacts, 9 more }
cdate: string
formatdate-time
edate: string
formatdate-time
tenant_contacts: TenantContacts { email, website }
email?: string
website?: string
tenant_labels: Array<string>
tenant_metadata: TenantMetadata { dns }
dns?: DNS { ns_pool }
ns_pool: NSPool { primary, secondary }
primary?: string
secondary?: string
tenant_name: string
tenant_network: unknown
tenant_status: string
tenant_tag: string
tenant_type: string
tenant_units: Array<TenantUnit>
unit_memberships: Array<unknown>
unit_metadata: unknown
unit_name: string
unit_status: string
unit_tag: string
customer_id?: string

Get tenant

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted
  apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted
});

const tenant = await client.tenants.get('tenant_id');

console.log(tenant.customer_id);
{
  "errors": [],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "cdate": "2019-12-27T18:11:19.117Z",
    "edate": "2019-12-27T18:11:19.117Z",
    "tenant_contacts": {
      "email": "email",
      "website": "website"
    },
    "tenant_labels": [
      "string"
    ],
    "tenant_metadata": {
      "dns": {
        "ns_pool": {
          "primary": "primary",
          "secondary": "secondary"
        }
      }
    },
    "tenant_name": "tenant_name",
    "tenant_network": {},
    "tenant_status": "tenant_status",
    "tenant_tag": "tenant_tag",
    "tenant_type": "tenant_type",
    "tenant_units": [
      {
        "unit_memberships": [
          {}
        ],
        "unit_metadata": {},
        "unit_name": "unit_name",
        "unit_status": "unit_status",
        "unit_tag": "unit_tag"
      }
    ],
    "customer_id": "customer_id"
  },
  "success": true
}
Returns Examples
{
  "errors": [],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "cdate": "2019-12-27T18:11:19.117Z",
    "edate": "2019-12-27T18:11:19.117Z",
    "tenant_contacts": {
      "email": "email",
      "website": "website"
    },
    "tenant_labels": [
      "string"
    ],
    "tenant_metadata": {
      "dns": {
        "ns_pool": {
          "primary": "primary",
          "secondary": "secondary"
        }
      }
    },
    "tenant_name": "tenant_name",
    "tenant_network": {},
    "tenant_status": "tenant_status",
    "tenant_tag": "tenant_tag",
    "tenant_type": "tenant_type",
    "tenant_units": [
      {
        "unit_memberships": [
          {}
        ],
        "unit_metadata": {},
        "unit_name": "unit_name",
        "unit_status": "unit_status",
        "unit_tag": "unit_tag"
      }
    ],
    "customer_id": "customer_id"
  },
  "success": true
}