<!-- llms.txt: https://workos.com/llms.txt -->

# Radar lists

Radar supports explicitly blocking and allowing attempts based on attempt attributes. You can manage these lists via the Radar list management APIs

## Remove an entry from a Radar list

Remove an entry from a Radar list.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request DELETE \
  --url "https://api.workos.com/radar/lists/ip_address/block" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "entry": "198.51.100.42"
    }
BODY
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.radar.remove_list_entry(
  type: "ip_address",
  action: "block",
  entry: "198.51.100.42"
)
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.radar.remove_list_entry(
    type_="ip_address", action="block", entry="198.51.100.42"
)
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.Radar().RemoveListEntry(context.Background(), "ip_address", "block", &workos.RadarRemoveListEntryParams{
		Entry: "198.51.100.42",
	})
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->radar()
    ->removeListEntry(
        type: "ip_address",
        action: "block",
        entry: "198.51.100.42",
    );
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;
import com.workos.radar.RadarApi.RemoveListEntryOptions;

WorkOS workos = new WorkOS("sk_example_123456789");

RemoveListEntryOptions options =
    RemoveListEntryOptions.builder().entry("198.51.100.42").build();

workos.radar.removeListEntry("ip_address", "block", options);
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.Radar.RemoveListEntryAsync("ip_address", "block",
                                        new RadarRemoveListEntryOptions {
                                            Entry = "198.51.100.42",
                                        });
```

```rust language="rust" title="Request" tab="1"
use workos::Client;
use workos::radar::RemoveListEntryParams;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .radar()
        .remove_list_entry(
            "ip_address",
            "block",
            RemoveListEntryParams {
                entry: "198.51.100.42".into(),
                ..Default::default()
            }
        )
        .await?;

    Ok(())
}
```

:::

## Add an entry to a Radar list

Add an entry to a Radar list.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request POST \
  --url "https://api.workos.com/radar/lists/ip_address/block" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "entry": "198.51.100.42"
    }
BODY
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.radar.add_list_entry(
  type: "ip_address",
  action: "block",
  entry: "198.51.100.42"
)
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.radar.add_list_entry(type_="ip_address", action="block", entry="198.51.100.42")
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.Radar().AddListEntry(context.Background(), "ip_address", "block", &workos.RadarAddListEntryParams{
		Entry: "198.51.100.42",
	})
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->radar()
    ->addListEntry(type: "ip_address", action: "block", entry: "198.51.100.42");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;
import com.workos.radar.RadarApi.AddListEntryOptions;

WorkOS workos = new WorkOS("sk_example_123456789");

AddListEntryOptions options =
    AddListEntryOptions.builder().entry("198.51.100.42").build();

workos.radar.addListEntry("ip_address", "block", options);
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.Radar.AddListEntryAsync("ip_address", "block",
                                     new RadarAddListEntryOptions {
                                         Entry = "198.51.100.42",
                                     });
```

```rust language="rust" title="Request" tab="1"
use workos::Client;
use workos::radar::AddListEntryParams;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .radar()
        .add_list_entry(
            "ip_address",
            "block",
            AddListEntryParams {
                entry: "198.51.100.42".into(),
                ..Default::default()
            }
        )
        .await?;

    Ok(())
}
```

:::

### DELETE /radar/lists/{type}/{action}

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entry` | string | Yes | The value of the entry |

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | "ip_address" \| "domain" \| "email" \| ... | Yes | The type of the Radar list |
| `action` | "block" \| "allow" | Yes | The action of the Radar list |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `empty` | empty | Returns an empty response on success. |

### POST /radar/lists/{type}/{action}

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entry` | string | Yes | The value of the entry |

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | "ip_address" \| "domain" \| "email" \| ... | Yes | The type of the Radar list |
| `action` | "block" \| "allow" | Yes | The action of the Radar list |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `message` | string | A message indicating the entry already exists. |