# List Tenants

```http
GET /tenants/lists
```

API: Cisco Secure Access Multi-Tenants API (version 1.0.1)

Operation ID: listTenants

Tags: Tenants, Secure Access

## Description

List the tenants in the organization.

## Servers

```json
[
  {
    "url": "https://api.sse.cisco.com/{basePath}",
    "variables": {
      "basePath": {
        "default": "admin/v2"
      }
    }
  }
]
```

## Authentication

Satisfy any one of the following alternatives. Within each alternative, all listed schemes are required. An empty object allows anonymous access.

```json
[
  {
    "oauthFlow": [
      "admin.tenants:read"
    ]
  }
]
```

### Security schemes

```json
{
  "oauthFlow": {
    "type": "oauth2",
    "description": "The client credential flow.",
    "flows": {
      "clientCredentials": {
        "tokenUrl": "https://api.sse.cisco.com/auth/v2/token",
        "scopes": {
          "admin.tenants:read": "Read the tenant resources in the organization."
        }
      }
    }
  }
}
```

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| organizationIds | query | yes | string | A comma-separated list of IDs for the tenant organizations. |
| optionalFields | query | no | array\<string\> | Optional fields to request additional data along with regular response. |
| filters | query | no | object | Filters that can be applied to the response by the system. |
| sort | query | no | object | The properties to sort the collection. |

### Parameter definitions

```json
[
  {
    "in": "query",
    "name": "organizationIds",
    "required": true,
    "style": "form",
    "explode": true,
    "schema": {
      "type": "string",
      "pattern": "^\\d+(,\\d+)*$",
      "example": "1234567,2345678,3123456,4234567"
    },
    "description": "A comma-separated list of IDs for the tenant organizations.",
    "$$ref": "#/components/parameters/tenantIds"
  },
  {
    "in": "query",
    "name": "optionalFields",
    "required": false,
    "schema": {
      "type": "array",
      "description": "The list of labels for the fields to filter the query.",
      "items": {
        "type": "string",
        "description": "The label for a field to filter the query."
      }
    },
    "description": "Optional fields to request additional data along with regular response.",
    "$$ref": "#/components/parameters/optionalFields"
  },
  {
    "in": "query",
    "name": "filters",
    "description": "Filters that can be applied to the response by the system.",
    "required": false,
    "schema": {
      "type": "object",
      "description": "The properties of the tenant.",
      "properties": {
        "organizationId": {
          "type": "integer",
          "description": "Filter by the ID of the tenant."
        },
        "organizationName": {
          "type": "string",
          "description": "Filter by the name of the tenant."
        }
      }
    },
    "$$ref": "#/components/parameters/filters"
  },
  {
    "in": "query",
    "description": "The properties to sort the collection.",
    "name": "sort",
    "required": false,
    "schema": {
      "type": "object",
      "description": "The properties to use when sorting the collection.",
      "properties": {
        "order[organizationId]": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "description": "The order to use when sorting the ID of the tenants.",
          "example": "desc"
        },
        "order[organizationName]": {
          "type": "string",
          "description": "The order to use when sorting the name of the tenants.",
          "enum": [
            "asc",
            "desc"
          ],
          "example": "asc"
        }
      }
    },
    "$$ref": "#/components/parameters/sort"
  }
]
```

## Responses

### 200

OK

```json
{
  "description": "OK",
  "headers": {
    "Content-Type": {
      "schema": {
        "type": "string"
      },
      "description": "The MIME content type of the response body.",
      "example": "application/json",
      "$$ref": "#/components/headers/Content-Type"
    },
    "Date": {
      "schema": {
        "type": "string",
        "pattern": "^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"
      },
      "description": "The timestamp of the response.",
      "example": "2023-03-14T18:34:25Z",
      "$$ref": "#/components/headers/Date"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "type": "array",
        "description": "The list of tenants in the organization.",
        "items": {
          "type": "object",
          "description": "The properties of the tenant.",
          "properties": {
            "organizationName": {
              "type": "string",
              "description": "The legal or canonical name of the tenant.",
              "minLength": 1,
              "maxLength": 255,
              "example": "NameOfCustomer",
              "$$ref": "#/components/schemas/orgName"
            },
            "organizationId": {
              "type": "integer",
              "description": "The unique identifier of the tenant.",
              "example": 1233,
              "$$ref": "#/components/schemas/orgId"
            }
          },
          "example": {
            "organizationId": 8276505,
            "organizationName": "tenant one"
          },
          "$$ref": "#/components/schemas/TenantResponse"
        },
        "example": [
          {
            "organizationId": 8276505,
            "organizationName": "tenant one"
          },
          {
            "organizationId": 1235467,
            "organizationName": "tenant two"
          }
        ],
        "$$ref": "#/components/schemas/TenantListResponse"
      },
      "example": [
        {
          "organizationId": 1234567,
          "organizationName": "tenant one"
        }
      ]
    }
  }
}
```

### 400

Bad Request

```json
{
  "description": "Bad Request",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "example": {
          "message": "Bad Request"
        }
      }
    }
  },
  "$$ref": "#/components/responses/400Error"
}
```

### 401

Unauthorized

```json
{
  "description": "Unauthorized",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "example": {
          "message": "Unauthorized"
        }
      }
    }
  },
  "$$ref": "#/components/responses/401Error"
}
```

### 403

Forbidden

```json
{
  "description": "Forbidden",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "example": {
          "message": "Forbidden"
        }
      }
    }
  },
  "$$ref": "#/components/responses/403Error"
}
```

### 404

Not Found

```json
{
  "description": "Not Found",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "example": {
          "message": "Not Found"
        }
      }
    }
  },
  "$$ref": "#/components/responses/404Error"
}
```

### 500

Internal Server Error

```json
{
  "description": "Internal Server Error",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "example": {
          "message": "Internal Server error"
        }
      }
    }
  },
  "$$ref": "#/components/responses/500Error"
}
```

## Additional OpenAPI fields

```json
{
  "__originalOperationId": "listTenants"
}
```
