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

# Set Tenant Identity Provider and Service Provider OIDC Application for Tenant Management

`PUT /api/web/v1/tenants/{id}/spidentityprovider`

Set Tenant Identity Provider and Service Provider OIDC Application for Tenant Management. Caller requires the SPIDENTITYPROVIDERS:EDIT permission.

## Parameters

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

## Request Body

Required.

### application/json

Schema

```json
{
  "required": [
    "enabled"
  ],
  "type": "object",
  "properties": {
    "createDefaultResourceRule": {
      "type": "boolean",
      "description": "Whether an initial default resource rule accessible to all users should be created for this tenant management. This is only used if tenant management was previously disabled. If not set, it defaults to false."
    },
    "defaultMaxAge": {
      "type": "integer",
      "description": "The default max age of this tenant management. If not set, it is not used.",
      "format": "int32"
    },
    "disableSSODefaultResourceRule": {
      "type": "boolean",
      "description": "If an initial default resource rule is enabled, whether to disable SSO. This is only used if an initial default resource rule is being enabled. If not set, it defaults to false."
    },
    "displayConsent": {
      "type": "boolean",
      "description": "Whether this tenant management should display consent. If not set, it defaults to false."
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether tenant management is enabled."
    },
    "signingKeyId": {
      "type": "string",
      "description": "The signing key of this tenant management."
    }
  },
  "description": "Parameters passed when setting tenant management.",
  "title": "SpIdentityProviderParms"
}
```

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "required": [
    "enabled",
    "name"
  ],
  "type": "object",
  "properties": {
    "clientId": {
      "type": "string",
      "description": "The client id of this tenant management."
    },
    "defaultMaxAge": {
      "type": "integer",
      "description": "The default max age of this tenant management.",
      "format": "int32"
    },
    "displayConsent": {
      "type": "boolean",
      "description": "Whether this tenant management should display consent."
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether tenant management is enabled."
    },
    "initiateLoginUri": {
      "type": "string",
      "description": "The initiate login URI of this tenant management."
    },
    "name": {
      "type": "string",
      "description": "The name of this tenant management."
    },
    "signingKeyId": {
      "type": "string",
      "description": "The signing key of this tenant management."
    }
  },
  "description": "A tenant management configuration.",
  "title": "SpIdentityProvider"
}
```

### 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": [
      "SPIDENTITYPROVIDERS:EDIT"
    ]
  }
]
```
