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

# Create IP location

`POST /api/web/v1/iplocations`

Gets IP location information for an IP address. The IP location can be used to create an ExpectedLocation. Caller requires the USERRBASETTINGS:ADD permission.

## Request Body

Required.

### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "cityName": {
      "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."
    },
    "ipAddress": {
      "type": "string",
      "description": "The IPv4 Address."
    },
    "isp": {
      "type": "string",
      "description": "The ISP name--always returned in upper-case."
    },
    "latitude": {
      "type": "number",
      "description": "The latitude.",
      "format": "float"
    },
    "longitude": {
      "type": "number",
      "description": "The longitude.",
      "format": "float"
    },
    "privateIpAddress": {
      "type": "boolean",
      "description": "Whether the IP provided is a private IP Address.  The value is only available when resolving an IP address to an IpLocation."
    }
  },
  "description": "The IP address for which the IP location information is to be returned.",
  "title": "IpLocation"
}
```

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "cityName": {
      "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."
    },
    "ipAddress": {
      "type": "string",
      "description": "The IPv4 Address."
    },
    "isp": {
      "type": "string",
      "description": "The ISP name--always returned in upper-case."
    },
    "latitude": {
      "type": "number",
      "description": "The latitude.",
      "format": "float"
    },
    "longitude": {
      "type": "number",
      "description": "The longitude.",
      "format": "float"
    },
    "privateIpAddress": {
      "type": "boolean",
      "description": "Whether the IP provided is a private IP Address.  The value is only available when resolving an IP address to an IpLocation."
    }
  },
  "description": "The IP address for which the IP location information is to be returned.",
  "title": "IpLocation"
}
```

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