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

# Get the knowledge-based authenticator

`GET /api/web/v1/users/{userid}/userquestions`

Get the knowledge-based authenticator for the specified user. Caller requires the USERQUESTIONS:VIEW permission.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| userid | path | Yes | string | The UUID of the user whose KBA information is to be retrieved. |

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "required": [
    "userQuestions"
  ],
  "type": "object",
  "properties": {
    "maximumNumberOfQuestions": {
      "type": "integer",
      "description": "The maximum number of questions a user can answer for KBA. If zero, then KBA is disabled. This value is not used when adding or updating a KBA. If provided, it will be ignored.",
      "format": "int32"
    },
    "maximumResponseSize": {
      "type": "integer",
      "description": "The maximum number of characters in an answer. This value is not used when adding or updating a KBA. If provided, it will be ignored.",
      "format": "int32"
    },
    "minimumNumberOfQuestions": {
      "type": "integer",
      "description": "The minimum number of questions a user must answer to perform KBA. Defaults to the maximum Q&A challenge size setting. This value is not used when adding or updating a KBA. If provided, it will be ignored.",
      "format": "int32"
    },
    "userQuestions": {
      "type": "array",
      "description": "The list of question/answer pairs stored for a user. This is the only attribute required when adding or updating a KBA.",
      "items": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string",
            "description": "The question's answer."
          },
          "id": {
            "type": "string",
            "description": "The UUID of the KBA question/answer."
          },
          "question": {
            "type": "string",
            "description": "The question."
          }
        },
        "description": "A KBA question/answer stored for a user.",
        "title": "UserQuestion"
      }
    }
  },
  "description": "KBA information stored for a user.",
  "title": "KnowledgeBasedAuthenticator"
}
```

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