> For AI agents: [llms.txt](https://docs.trustedauth.com/llms.txt) provides a Markdown index of this documentation.

# Get a tenant

`GET /api/web/v4/tenants/{id}`

Get the specified tenant for a service provider. Caller requires the TENANTS:VIEW permission from a service provider role.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| id | path | Yes | string | The UUID of the tenant to be fetched. |

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "required": [
    "authenticationAccount",
    "companyName",
    "hostname",
    "id",
    "issuanceAccount",
    "locked",
    "serviceProvider",
    "spIdp"
  ],
  "type": "object",
  "properties": {
    "authenticationAccount": {
      "type": "boolean",
      "description": "A flag indicating if this tenant is an authentication account."
    },
    "companyName": {
      "type": "string",
      "description": "The name of the company that owns this tenant.",
      "example": "MyCompany Corp."
    },
    "contractMode": {
      "type": "string",
      "description": "The contract mode of a tenant, allowable values = 'PRODUCTION', 'TRIAL', example='TRIAL'.",
      "enum": [
        "PRODUCTION",
        "TRIAL",
        "UNKNOWN"
      ]
    },
    "hostname": {
      "type": "string",
      "description": "The hostname of the tenant.",
      "example": "mycompany.us.trustedauth.com"
    },
    "id": {
      "type": "string",
      "description": "The UUID of this tenant within the service provider."
    },
    "issuanceAccount": {
      "type": "boolean",
      "description": "A flag indicating if this tenant is an issuance account."
    },
    "locked": {
      "type": "boolean",
      "description": "A flag indicating if this tenant has been locked."
    },
    "otpProviderId": {
      "type": "string",
      "description": "The ID of the preferred OTP provider associated with this tenant, if any. Only visible to root tenant."
    },
    "previousHostname": {
      "type": "string",
      "description": "The previous hostname of the tenant.",
      "example": "mycompany.us.trustedauth.com"
    },
    "serviceProvider": {
      "type": "boolean",
      "description": "A flag indicating if this child tenant is a service provider."
    },
    "spIdp": {
      "type": "boolean",
      "description": "A flag indicating if this tenant is enabled for tenant management authentication."
    }
  },
  "description": "Information returned about a tenant of a service provider.",
  "title": "Tenant"
}
```

### 400

Bad Request

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 401

Access denied

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 403

Forbidden

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 404

Not Found

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 409

Conflict

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

## Security

Requirements

```json
[
  {
    "AdminAPIAuthentication": [
      "TENANTS:VIEW"
    ]
  }
]
```
