Skip to content

Enumerate tenants

GET/tenants

Partner API · Tenants

List all the tenants for a partner.

Required permissionaccount_management:read OR partner:listMembers

Parameters

Name In Type Required Description
X-Partner-ID header string (uuid) Yes Partner ID.
fields query array of string No The fields to return in a partial response.
billingType query array of string (enum) No Search for accounts by billing type.
Items must be unique. Each item must be one of: term, trial, usage, ordered.
marketplaceIds query array of string No Search by External IDs this tenant has in other systems.
Items must be unique.
status query array of string (enum) No Search for accounts by status.
Items must be unique. Each item must be one of: active, canceled, suspended.
ids query array of string (uuid) No Tenant IDs.
Must contain at most 50 items. Items must be unique.
page query integer No The page number to fetch, starting with 1.
pageSize query integer No The size of the page requested.
pageTotal query boolean No Whether the number of pages should be calculated and returned in the response.
managed query boolean No Match tenants by whether they have enabled management by this partner.

Request samples

curl -X GET "https://api.central.sophos.com/partner/v1/tenants" -H "Authorization: Bearer <access-token>" -H "X-Partner-ID: <partner-id>"

import requests

response = requests.get(
    "https://api.central.sophos.com/partner/v1/tenants",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Partner-ID": "<partner-id>",
    },
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Partner-ID" = "<partner-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api.central.sophos.com/partner/v1/tenants" -Headers $headers

package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, err := http.NewRequest("GET", "https://api.central.sophos.com/partner/v1/tenants", nil)
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Partner-ID", "<partner-id>")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}

const response = await fetch("https://api.central.sophos.com/partner/v1/tenants", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Partner-ID": "<partner-id>",
  },
});
const data = await response.json();
console.log(data);

Responses

200 — Page of tenants.

Response fields

itemsarray of objectrequired
List of tenants.
Tenant.
Show child attributesHide child attributes
idstring (uuid)required
Tenant ID.
namestringrequired
Name set when the tenant was created.
dataGeographystringrequired
Geographical location where the tenant data is stored.
Must be one of: US, IE, DE, CA, AU, JP, IN, BR, AE.
dataRegionstringrequired
The data region where tenant data is stored.
Must be one of: eu01, eu02, us01, us02, us03, ca01, au01, jp01, in01, br01, ae01.
billingTypestringrequired
Billing type.
Must be one of: term, trial, usage, ordered.
partnerobjectrequired
Represents a referenced object.
Show child attributesHide child attributes
idstring (uuid)required
The ID of the referenced object.
organizationobject
Represents a referenced object.
Show child attributesHide child attributes
idstring (uuid)required
The ID of the referenced object.
apiHoststring (uri)required
Tenant API host URL.
productsarray of object
Products list.
Items must be unique.
Sophos product code with an optional quantity.
Show child attributesHide child attributes
codestringrequired
Sophos product code.
Must match the pattern ^[A-Z][a-zA-Z]{0,19}([0-9]{0,4})([-_][a-zA-Z0-9]{0,20}([0-9]{0,3})){0,5}$.
quantityinteger
Quantity for the number of seats.
statusstring
Tenant account status.
Must be one of: active, suspended, canceled.
primaryboolean
Indicates whether tenant is primary subestate or not.
managedboolean
Indicates if tenant has enabled management by this partner.
contactobject
Contact information for a partner, organization or tenant.
Show child attributesHide child attributes
firstNamestringrequired
First name.
lastNamestringrequired
Last name.
emailstring (email)
Email address.
phonestringrequired
Phone number.
mobilestring
Mobile number.
faxstring
Fax number.
addressobjectrequired
Address of a partner, organization or tenant.
Show child attributesHide child attributes
address1stringrequired
Line 1 of the address.
address2string
Line 2 of the address.
address3string
Line 3 of the address.
citystringrequired
City.
statestring
State.
countryCodestringrequired
Country code.
postalCodestringrequired
Postal code.
pagesobjectrequired
Show child attributesHide child attributes
currentintegerrequired
The 1-based page number being returned.
sizeintegerrequired
The size of the page being returned.
totalinteger
(Optional) The total number of pages that exist, if pageTotal=true in the request.
itemsinteger
(Optional) The total number of items across all pages.
maxSizeintegerrequired
The maximum page size that can be requested.

Errors

Status Meaning
500 Unexpected error.

All error responses share the same shape — see the error response object.

Response examples

200

{
  "items": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "dataGeography": "US",
      "dataRegion": "eu01",
      "billingType": "term",
      "partner": {
        "id": "00000000-0000-0000-0000-000000000000"
      },
      "organization": {
        "id": "00000000-0000-0000-0000-000000000000"
      },
      "apiHost": "https://example.com",
      "products": [
        {
          "code": "string",
          "quantity": 0
        }
      ],
      "status": "active",
      "primary": true,
      "managed": true,
      "contact": {
        "firstName": "string",
        "lastName": "string",
        "email": "user@example.com",
        "phone": "string",
        "mobile": "string",
        "fax": "string",
        "address": {
          "address1": "string",
          "address2": "string",
          "address3": "string",
          "city": "string",
          "state": "string",
          "countryCode": "string",
          "postalCode": "string"
        }
      }
    }
  ],
  "pages": {
    "current": 0,
    "size": 0,
    "total": 0,
    "items": 0,
    "maxSize": 0
  }
}

See the guide for a narrative walkthrough of this API.