> For the complete documentation index, see [llms.txt](https://docs.material.security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.material.security/reference/api-v1/tenants.md).

# Tenants

**Overview**

The Tenants API lists the Google Workspace and Microsoft 365 tenants connected to Material that your API token can reach. Use it to find which tenant a tenant ID (`tnt.1.<base64>`) refers to, and to find the ID to pass to a `tenant` filter or a role assignment.

Two endpoints make up the Tenants API:

* [**List Tenants**](https://docs.material.security/reference/api-v1/tenants#get-api-v1-tenants) (`GET /api/v1/tenants`): page through the tenants your token can reach, sorted by name
* [**Get Tenant**](https://docs.material.security/reference/api-v1/tenants#get-api-v1-tenants-id) (`GET /api/v1/tenants/{id}`): retrieve a single tenant by its encoded ID

Each tenant reports its display name, its provider (`google` or `microsoft`), the provider's own ID for it (the Google Workspace customer ID or the Microsoft Entra tenant ID), its primary domain, and its domains. Tenants are read-only through the API.

**Permissions**

Listing and retrieving tenants requires the same read permission as accounts and groups. Endpoints that take a tenant ID can require more permissions.

**Response Structure**

The list follows the standard two-part structure: a `meta` object (with `totalCount`, `limit`, `hasMore`, and `nextCursor`) and an `items` array of tenant objects. It doesn't take any filters.

**Want a walkthrough?**

Review [Hello World](https://docs.material.security/reference/api-v1/hello-world).

**Pagination and Rate Limiting**

* Material APIs use **cursor-based pagination**: pass the `nextCursor` value from one response as the `cursor` parameter in the next request.
* The `limit` parameter controls page size and is locked into the cursor, so later pages keep the page size of the first request.
* When `hasMore` is false and `nextCursor` is null, you've reached the last page.

## List Tenants

> Lists the Google Workspace and Microsoft 365 tenants your API token can reach, sorted by name. Each tenant includes the encoded ID that you pass to \`tenant\` filters and that \`tenantId\` fields return. Requires the same read permission as accounts and groups.

```json
{"openapi":"3.1.0","info":{"title":"Material Security API","version":"v1"},"tags":[{"name":"Tenants","description":"**Overview**\n\nThe Tenants API lists the Google Workspace and Microsoft 365 tenants connected to Material that your API token can reach. Use it to find which tenant a tenant ID (`tnt.1.<base64>`) refers to, and to find the ID to pass to a `tenant` filter or a role assignment.\n\nTwo endpoints make up the Tenants API:\n\n* **[List Tenants](https://docs.material.security/reference/api-v1/tenants#get-api-v1-tenants)** (`GET /api/v1/tenants`): page through the tenants your token can reach, sorted by name\n* **[Get Tenant](https://docs.material.security/reference/api-v1/tenants#get-api-v1-tenants-id)** (`GET /api/v1/tenants/{id}`): retrieve a single tenant by its encoded ID\n\nEach tenant reports its display name, its provider (`google` or `microsoft`), the provider's own ID for it (the Google Workspace customer ID or the Microsoft Entra tenant ID), its primary domain, and its domains. Tenants are read-only through the API.\n\n**Permissions**\n\nListing and retrieving tenants requires the same read permission as accounts and groups. Endpoints that take a tenant ID can require more permissions.\n\n**Response Structure**\n\nThe list follows the standard two-part structure: a `meta` object (with `totalCount`, `limit`, `hasMore`, and `nextCursor`) and an `items` array of tenant objects. It doesn't take any filters.\n\n**Want a walkthrough?**\n\nReview [Hello World](https://docs.material.security/reference/api-v1/hello-world).\n\n**Pagination and Rate Limiting**\n\n* Material APIs use **cursor-based pagination**: pass the `nextCursor` value from one response as the `cursor` parameter in the next request.\n* The `limit` parameter controls page size and is locked into the cursor, so later pages keep the page size of the first request.\n* When `hasMore` is false and `nextCursor` is null, you've reached the last page.\n"}],"servers":[{"url":"https://{domain}","description":"Material Security instance","variables":{"domain":{"default":"your-instance.on.material.security","description":"Your Material Security instance domain"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-material-client-secret","description":"Material Security API key"}},"schemas":{"APITenantCollection":{"title":"APITenantCollection","type":"object","properties":{"meta":{"$ref":"#/components/schemas/CollectionMeta"},"items":{"type":"array","items":{"$ref":"#/components/schemas/APITenant"}}},"required":["meta","items"]},"CollectionMeta":{"title":"CollectionMeta","type":"object","properties":{"totalCount":{"description":"The total number of items matching the query.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"description":"The page size used for this response.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"description":"True if more items exist beyond the current page; false otherwise.","type":"boolean"},"nextCursor":{"description":"The cursor to fetch the next page of results. Pass this value to the `cursor` query parameter. Null if no more pages exist.","anyOf":[{"type":"string"},{"type":"null"}]}}},"APITenant":{"title":"APITenant","description":"A Google Workspace or Microsoft 365 tenant connected to Material.","type":"object","properties":{"id":{"description":"The encoded tenant ID. Pass it to `tenant` filters. `tenantId` fields return the same value. Format: `tnt.1.<base64>`.","type":"string"},"name":{"description":"The tenant's display name: the custom name set in Material, otherwise the first of `domains`. If the tenant doesn't have any domains yet, the name comes from the provider.","type":"string"},"csp":{"description":"The cloud service provider: `google` or `microsoft`.","type":"string","enum":["microsoft","google"]},"providerTenantId":{"description":"The tenant's ID at the provider: the Google Workspace customer ID, or the Microsoft Entra tenant ID.","type":"string"},"primaryDomain":{"description":"The provider's primary domain for the tenant. Null until Material has synced it from the provider.","anyOf":[{"type":"string"},{"type":"null"}]},"domains":{"description":"The tenant's domains, `primaryDomain` first. These are usually the provider's verified and alias domains. Until Material first syncs the tenant from the provider, they come from the domains in the tenant's account email addresses.","type":"array","items":{"type":"string"}},"keyEvents":{"$ref":"#/components/schemas/APITenantKeyEvents"}},"required":["id","name","csp","providerTenantId","primaryDomain","domains","keyEvents"]},"APITenantKeyEvents":{"title":"APITenantKeyEvents","type":"object","properties":{"created":{"description":"When the tenant was connected to Material.","type":"object","properties":{"at":{"description":"ISO 8601 timestamp of the event","type":"string","format":"date-time"}},"required":["at"]}},"required":["created"]},"ValidationErrorResponse":{"title":"Validation Error Response","type":"object","properties":{"error":{"description":"A human-readable description of the error.","type":"string"},"validationFailures":{"description":"List of individual validation failures when request parameters fail schema validation.","type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}},"required":["error"]},"ErrorResponse":{"title":"Error Response","type":"object","properties":{"error":{"description":"A human-readable description of the error.","type":"string"}},"required":["error"]}}},"paths":{"/api/v1/tenants":{"get":{"operationId":"listTenants","summary":"List Tenants","description":"Lists the Google Workspace and Microsoft 365 tenants your API token can reach, sorted by name. Each tenant includes the encoded ID that you pass to `tenant` filters and that `tenantId` fields return. Requires the same read permission as accounts and groups.","tags":["Tenants"],"parameters":[{"in":"query","name":"cursor","schema":{"description":"The pagination cursor returned in a previous response. Pass this value to retrieve the next page of results.","type":"string"},"description":"The pagination cursor returned in a previous response. Pass this value to retrieve the next page of results."},{"in":"query","name":"limit","schema":{"description":"The maximum number of items to return per page.","type":"integer"},"description":"The maximum number of items to return per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APITenantCollection"}}}},"400":{"description":"Bad request: invalid parameters or request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden: the API key doesn't have permission to perform this action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found: the requested resource doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests: you've reached a rate limit. When the response includes a `Retry-After` header, wait that many seconds before you try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get Tenant

> Retrieves a single tenant by its encoded ID, including its name, \`csp\` (\`google\` or \`microsoft\`), provider tenant ID, and domains.

```json
{"openapi":"3.1.0","info":{"title":"Material Security API","version":"v1"},"tags":[{"name":"Tenants","description":"**Overview**\n\nThe Tenants API lists the Google Workspace and Microsoft 365 tenants connected to Material that your API token can reach. Use it to find which tenant a tenant ID (`tnt.1.<base64>`) refers to, and to find the ID to pass to a `tenant` filter or a role assignment.\n\nTwo endpoints make up the Tenants API:\n\n* **[List Tenants](https://docs.material.security/reference/api-v1/tenants#get-api-v1-tenants)** (`GET /api/v1/tenants`): page through the tenants your token can reach, sorted by name\n* **[Get Tenant](https://docs.material.security/reference/api-v1/tenants#get-api-v1-tenants-id)** (`GET /api/v1/tenants/{id}`): retrieve a single tenant by its encoded ID\n\nEach tenant reports its display name, its provider (`google` or `microsoft`), the provider's own ID for it (the Google Workspace customer ID or the Microsoft Entra tenant ID), its primary domain, and its domains. Tenants are read-only through the API.\n\n**Permissions**\n\nListing and retrieving tenants requires the same read permission as accounts and groups. Endpoints that take a tenant ID can require more permissions.\n\n**Response Structure**\n\nThe list follows the standard two-part structure: a `meta` object (with `totalCount`, `limit`, `hasMore`, and `nextCursor`) and an `items` array of tenant objects. It doesn't take any filters.\n\n**Want a walkthrough?**\n\nReview [Hello World](https://docs.material.security/reference/api-v1/hello-world).\n\n**Pagination and Rate Limiting**\n\n* Material APIs use **cursor-based pagination**: pass the `nextCursor` value from one response as the `cursor` parameter in the next request.\n* The `limit` parameter controls page size and is locked into the cursor, so later pages keep the page size of the first request.\n* When `hasMore` is false and `nextCursor` is null, you've reached the last page.\n"}],"servers":[{"url":"https://{domain}","description":"Material Security instance","variables":{"domain":{"default":"your-instance.on.material.security","description":"Your Material Security instance domain"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-material-client-secret","description":"Material Security API key"}},"schemas":{"APITenant":{"title":"APITenant","description":"A Google Workspace or Microsoft 365 tenant connected to Material.","type":"object","properties":{"id":{"description":"The encoded tenant ID. Pass it to `tenant` filters. `tenantId` fields return the same value. Format: `tnt.1.<base64>`.","type":"string"},"name":{"description":"The tenant's display name: the custom name set in Material, otherwise the first of `domains`. If the tenant doesn't have any domains yet, the name comes from the provider.","type":"string"},"csp":{"description":"The cloud service provider: `google` or `microsoft`.","type":"string","enum":["microsoft","google"]},"providerTenantId":{"description":"The tenant's ID at the provider: the Google Workspace customer ID, or the Microsoft Entra tenant ID.","type":"string"},"primaryDomain":{"description":"The provider's primary domain for the tenant. Null until Material has synced it from the provider.","anyOf":[{"type":"string"},{"type":"null"}]},"domains":{"description":"The tenant's domains, `primaryDomain` first. These are usually the provider's verified and alias domains. Until Material first syncs the tenant from the provider, they come from the domains in the tenant's account email addresses.","type":"array","items":{"type":"string"}},"keyEvents":{"$ref":"#/components/schemas/APITenantKeyEvents"}},"required":["id","name","csp","providerTenantId","primaryDomain","domains","keyEvents"]},"APITenantKeyEvents":{"title":"APITenantKeyEvents","type":"object","properties":{"created":{"description":"When the tenant was connected to Material.","type":"object","properties":{"at":{"description":"ISO 8601 timestamp of the event","type":"string","format":"date-time"}},"required":["at"]}},"required":["created"]},"ValidationErrorResponse":{"title":"Validation Error Response","type":"object","properties":{"error":{"description":"A human-readable description of the error.","type":"string"},"validationFailures":{"description":"List of individual validation failures when request parameters fail schema validation.","type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}},"required":["error"]},"ErrorResponse":{"title":"Error Response","type":"object","properties":{"error":{"description":"A human-readable description of the error.","type":"string"}},"required":["error"]}}},"paths":{"/api/v1/tenants/{id}":{"get":{"operationId":"getTenant","summary":"Get Tenant","description":"Retrieves a single tenant by its encoded ID, including its name, `csp` (`google` or `microsoft`), provider tenant ID, and domains.","tags":["Tenants"],"parameters":[{"in":"path","name":"id","schema":{"description":"The encoded ID of the tenant to retrieve. Format: `tnt.1.<base64>`.","type":"string","pattern":"^[a-z]{1,6}\\.[0-9]{1,2}\\.[A-Za-z0-9_-]+$"},"required":true,"description":"The encoded ID of the tenant to retrieve. Format: `tnt.1.<base64>`."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APITenant"}}}},"400":{"description":"Bad request: invalid parameters or request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden: the API key doesn't have permission to perform this action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found: the requested resource doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests: you've reached a rate limit. When the response includes a `Retry-After` header, wait that many seconds before you try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.material.security/reference/api-v1/tenants.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
