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

# List oauth roles

`GET /api/web/v1/oauthroles`

List all oauth roles. Caller requires the OAUTHROLES:VIEW permission.

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "type": "array",
  "items": {
    "required": [
      "ancestorIds",
      "descendantIds",
      "id",
      "inheritedResourceServerScopeIds",
      "name",
      "resourceServerScopeIds"
    ],
    "type": "object",
    "properties": {
      "ancestorIds": {
        "type": "array",
        "description": "The set of ancestor oauth role ids.",
        "items": {
          "type": "string",
          "description": "The set of ancestor oauth role ids."
        }
      },
      "descendantIds": {
        "type": "array",
        "description": "The set of descendant oauth role ids.",
        "items": {
          "type": "string",
          "description": "The set of descendant oauth role ids."
        }
      },
      "description": {
        "type": "string",
        "description": "The description of this oauth role."
      },
      "id": {
        "type": "string",
        "description": "The UUID of this oauth role. This value is generated when the oauth role is created."
      },
      "inheritedResourceServerScopeIds": {
        "type": "array",
        "description": "The set of resource server scopes ids associated with this oauth role based on inheritance from its ancestors.",
        "items": {
          "type": "string",
          "description": "The set of resource server scopes ids associated with this oauth role based on inheritance from its ancestors."
        }
      },
      "name": {
        "type": "string",
        "description": "The name of this oauth role."
      },
      "parentId": {
        "type": "string",
        "description": "The UUID of the parent of this oauth role, if one exists."
      },
      "resourceServerScopeIds": {
        "type": "array",
        "description": "The set of resource server scopes ids associated with this oauth role.",
        "items": {
          "type": "string",
          "description": "The set of resource server scopes ids associated with this oauth role."
        }
      }
    },
    "description": "A list of all oauth roles to which this user belongs.",
    "title": "OAuthRole"
  }
}
```

### 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": [
      "OAUTHROLES:VIEW"
    ]
  }
]
```
