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

# Set expected locations for a user

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

Sets the list of expected locations for the specified user. Caller requires the USERRBASETTINGS:EDIT permission.

## Parameters

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

## Request Body

Required.

### application/json

Schema

```json
{
  "type": "array",
  "description": "The new list of expected locations that will be set for the 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"
  }
}
```

## Responses

### 200

Successful

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