# The organization's outbound allow-list

> GET /v1/network/egress-allowlist. The platform's default allow-list plus the organization's approved requests that apply to all of its rentals (source organization), with the egress mode…

Source: https://legion.ambient.xyz/docs/api/network/get-egress-allowlist

`GET https://api.legion.ambient.xyz/v1/network/egress-allowlist`

Authenticate with an API key: `Authorization: Bearer $LEGION_API_KEY`.

The platform's default allow-list plus the organization's approved requests that apply to all
of its rentals (`source` `organization`), with the egress mode new rentals of the organization
start in and, while enforcement of new rentals is on, the date rentals in `audit` start enforcing. The platform's list prevents abuse; it does not stop
data leaving through the sites on it. Since it also carries the organization's own mode
(`org_egress_mode`) and who set it (`org_egress_mode_set_by`), what the owners' switch
(`updateOrgEgressMode`) shows. Needs `rentals.manage`.

## Responses

### 200

The allow-list.

- `mode`, EgressMode, required: `audit`: everything public is reachable; what the allow-list would block is recorded. `enforce`: only the allow-list is reachable. `open`: no allow-list (set by Legion for an organization, with a recorded reason). Private networks and email port 25 are blocked in every mode.
- `entries`, array of EgressEntry, required: Sorted by kind, then pattern, then source.
  - `kind`, EgressKind, required: `domain`: a host name (`example.com`) or `*.example.com` for every subdomain, never a public suffix. Lowercase, with internationalized names in their `xn--` form. `cidr`: an IPv4 range in canonical form (`203.0.113.0/24`), never inside private or reserved space.
  - `pattern`, string, required
  - `ports`, EgressPorts, required: TCP ports, at most 8.
  - `source`, string, required: Who granted the destination.
  - `category`, EgressCategory: What the destination is for.
  - `expires_at`, string (date-time): When an approval ends. Absent for the platform's defaults and for approvals without an expiry.
- `pending_requests`, integer: How many egress requests are waiting for review that would add to this list (the organization's, and for a rental also the rental's).
- `enforce_cutover_at`, string (date-time): When rentals that run in `audit` switch to `enforce` (decision D2). Present only while the platform's enforcement of new rentals is on and the date is set; a rental whose `mode` is `audit` shows it as the dated notice.
- `org_egress_mode`, OrgEgressMode: The organization's own egress mode: `enforce` when its new rentals are held to the allow-list, `inherit` when they start in the platform's default. On `getEgressAllowlist` and `updateOrgEgressMode` only, never on a rental's network.
- `org_egress_mode_set_by`, OrgEgressModeSetBy: Who set `org_egress_mode`: `owner` (an owner, with `updateOrgEgressMode`) or `admin` (Legion staff; an owner cannot change it). Absent while the mode is `inherit`.

Example:

```json
{
  "mode": "audit",
  "entries": [
    {
      "kind": "domain",
      "pattern": "string",
      "ports": [
        1
      ],
      "source": "platform",
      "category": "code",
      "expires_at": "2026-10-15T12:00:00Z"
    }
  ],
  "pending_requests": 0,
  "enforce_cutover_at": "2026-10-15T12:00:00Z",
  "org_egress_mode": "inherit",
  "org_egress_mode_set_by": "owner"
}
```

### 401

Missing, unknown, expired or revoked credentials.

### 403

The caller lacks the permission this operation requires (`forbidden`),
or signed in without having joined an organization yet
(`no_organization`; `getOnboarding` and the invitation and
organization operations under it work), or could not sign in
(`email_unverified`, `account_conflict`, and `domain_not_allowed`). `not_invited` is no longer returned to
session tokens.

`access_not_approved`: a signed-in person who is not approved
for the beta yet. Every operation that takes a credential answers it to
them, except `getMe` and `joinMyWaitlist`; the problem carries
`access` (`waitlisted` or `not_requested`, and the email). Approved
means a member of an organization, holding a pending invitation, or Legion; an API key always belongs to a member.

`oauth_token_mcp_only`: the caller sent an OAuth access token (`lgo_`), which is accepted
only by `mcpMessage` and the tool calls it dispatches. Every other operation answers it, whatever
the token's scope. Use an API key or the Legion web app.

`org_suspended`: the caller's organization is suspended. Every operation that takes a
credential answers it, by session or API key, except `getMe` (which shows `org.suspended_at` and
`org.suspension_reason`) and the support operations under `/v1/support/`.

`terms_not_accepted`: an approved caller who has not accepted
the current version of the Terms of Use and the Acceptable Use Policy. Every operation that takes a credential answers it, except `getMe`,
`acceptLegalDocuments`, `joinMyWaitlist` and the wind-down operations
(`listRentals`, `stopRental`, `deleteRental`, `listHosts`,
`updateListing` with `listed` false, `removeHost`); the problem
carries `legal`. An API key acts for the person who created it, so it
is refused until that person accepts. Terminal
operations also return
`session_required` (called with an API key) and `step_up_required`
(neither a sign-in nor a step-up challenge within the step-up window).

### 500

An unexpected server error. Safe to retry.

## Errors

- 403 [`no_organization`](https://legion.ambient.xyz/docs/errors#no_organization)

## Example request

```sh
curl -s "https://api.legion.ambient.xyz/v1/network/egress-allowlist" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
