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

# List expected locations for a user

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

Lists the expected locations for the specified user. Caller requires the USERRBASETTINGS:VIEW permission.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| userid | path | Yes | string | The UUID of the user whose expected locations will be returned. |

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "required": [
    "expectedLocations",
    "maximumExpectedLocations"
  ],
  "type": "object",
  "properties": {
    "expectedLocations": {
      "type": "array",
      "description": "The list of expected locations stored for this user.",
      "items": {
        "type": "object",
        "properties": {
          "city": {
            "type": "string",
            "description": "The city name--always returned in upper-case."
          },
          "countryCode": {
            "type": "string",
            "description": "A two-character (alpha-2) ISO 3166-1  country code."
          },
          "id": {
            "type": "string",
            "description": "The UUID of this expected location."
          },
          "ipAddress": {
            "type": "string",
            "description": "The IPv4 Address."
          },
          "isp": {
            "type": "string",
            "description": "The ISP name--always returned in upper-case."
          },
          "privateIpAddress": {
            "type": "boolean",
            "description": "Whether the IP provided is a private IP Address.  The value is ignored when adding an ExpectedLocation. It is returned when getting ExpectedLocations if the location has an IP address defined"
          }
        },
        "description": "Information stored for an expected location.",
        "title": "ExpectedLocation"
      }
    },
    "maximumExpectedLocations": {
      "type": "integer",
      "description": "The maximum number of expected locations that can be stored for this user.",
      "format": "int32"
    }
  },
  "description": "Information about the expected locations stored for a user.",
  "title": "UserExpectedLocations"
}
```

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