---
title: "Test Source Ip"
method: POST
path: "/api/v1/settings/session/test-source-ip"
tags: ["Session Settings"]
---

# Test Source Ip

`POST /api/v1/settings/session/test-source-ip`

TestSourceIP checks whether a given IP address would be allowed by the specified CIDR allowlist rules.

## Request body

- C1ApiSettingsV1TestSourceIPRequest — The TestSourceIPRequest message.
  - `allowCidr` string[], nullable — The CIDR allowlist rules to test against. If empty, uses the tenant's current allowlist. Accepts IPv4 (e.g. 10.0.0.0/24) or IPv6 (e.g. 2001:db8::/32) CIDRs.
  - `sourceIp` string — if unset, uses the source IP of the request. Accepts IPv4 (e.g. 10.0.0.5) or IPv6 (e.g. 2001:db8::1) addresses, optionally with a CIDR prefix.

## Response `200`

Successful response

- C1ApiSettingsV1TestSourceIPResponse — The TestSourceIPResponse message.
  - `allowed` boolean — Whether the tested IP address is allowed by the CIDR rules.
  - `checkedIp` string — The IP address that was checked, either from the request or inferred from the caller.
  - `details` GoogleRpcStatus — The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer — The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
    - `details` object[], nullable — A list of messages that carry the error details. There is a common set of message types for APIs to use.
      - `@type` string — The type of the serialized message.
    - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.

---

[API](https://skmtc.net/conductorone/apis/c1-api.md) · [All operations](https://skmtc.net/conductorone/apis/c1-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/conductorone/c1-api/versions/d391405a35d3/schema)
