# Replace the organization's outbound allowlist extension. Requires an organization admin and a grant from a platform administrator. Patterns must name public hosts: `example.com`, `*.example.com`, or an `https://example.com/path/` prefix.

Source: <https://everruns.com/docs/api/operations/set_org_egress_allowlist/>

PUT

/v1/orgs/{org}/egress-allowlist

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/orgs/example/egress-allowlist';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"patterns":["example"]}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request PUT \
  --url https://app.everruns.com/api/v1/orgs/example/egress-allowlist \
  --header 'Content-Type: application/json' \
  --data '{ "patterns": [ "example" ] }'
```

* Production APIapp.everruns.com/api/v1/orgs/{org}/egress-allowlist

## Parameters

### Path Parameters

**org**

required

string

Prefixed public identifier

## Request Bodyrequired

Media typeapplication/json

Body of `PUT /v1/orgs/{org}/egress-allowlist`.

object

**patterns**

required

The full list of host patterns; replaces the stored list. Blank entries are ignored and duplicates collapsed.

Array\<string>

##### Examplegenerated

```json
{
  "patterns": [
    "example"
  ]
}
```

## Responses

### 200

Success

Media typeapplication/json

An organization’s egress allowlist extension.

object

**can\_edit**

required

Whether the caller may edit the patterns (an organization admin; the edit also needs `granted`).

boolean

**can\_grant**

required

Whether the caller may grant or revoke (a platform administrator).

boolean

**granted**

required

Whether a platform administrator allowed this organization to extend the deployment’s outbound allowlist. Patterns are enforced only while this is true.

boolean

**max\_patterns**

required

Most patterns one organization may add.

integer

**mode**

required

The deployment’s egress policy: `open`, `curated-writes`, or `curated-all`. Extensions only matter in a curated mode.

string

**open**

required

Whether a platform administrator granted this organization open egress: its agents reach any public host the deny list allows, for reads and writes, whatever the deployment’s curated policy.

boolean

**patterns**

required

Host patterns this organization adds to the allowlist: `example.com`, `*.example.com`, or an `https://example.com/path/` prefix.

Array\<string>

##### Example

```json
{
  "mode": "curated-writes"
}
```

### 400

Invalid pattern or too many patterns

### 403

Not an organization admin, or the organization is not granted

### 404

Organization not found