# `FireblocksSdk.Api.NetworkConnection`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L1)

Fireblocks Network Connections API.

Covers two resource families within the "Network connections" tag:

* **Network Connections** (`/v1/network_connections`) — peer-to-peer connections
  between Fireblocks workspaces.
* **Network IDs** (`/v1/network_ids`) — local and remote discoverable network
  identifiers used to establish those connections.

Routing policies (passed as plain `map()` values) support three destination
schemes:
* `%{"scheme" => "CUSTOM", "dstType" => "VAULT"|"EXCHANGE"|"FIAT_ACCOUNT", "dstId" => id}`
* `%{"scheme" => "DEFAULT"}` — available for network-connection policies only
* `%{"scheme" => "NONE"}`

# `check_third_party_routing`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L142)

```elixir
@spec check_third_party_routing(String.t(), String.t()) :: map()
```

Validates whether future transactions on a given connection are routed to the
displayed recipient or to a third party.

- `connection_id`: The ID of the network connection.
- `asset_type`: The destination asset type to check (e.g. `"ETH"`).

# `create_network_connection`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L85)

```elixir
@spec create_network_connection(
  keyword(),
  String.t()
) :: map()
```

Creates a new network connection.

Initiates a connection between the local workspace's network ID and a remote
network ID. Subject to Flexible Routing Schemes. When custom routing is chosen
but no destination is specified it defaults to `dstId=0, dstType=VAULT`.

- `idempotency_key`: Optional idempotency key (`X-Idempotency-Key` header).

Options:
* `:localNetworkId` (`t:String.t/0`) - Required. Network ID of the profile initiating the connection

* `:remoteNetworkId` (`t:String.t/0`) - Required. Network ID the profile is connecting to

* `:routingPolicy` (`t:map/0`) - Map of asset-group → routing destination (`CustomRoutingDest`, `DefaultNetworkRoutingDest`, or `NoneNetworkRoutingDest`)

# `create_network_id`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L184)

```elixir
@spec create_network_id(
  keyword(),
  String.t()
) :: map()
```

Creates a new Network ID.

- `idempotency_key`: Optional idempotency key (`X-Idempotency-Key` header).

Options:
* `:name` (`t:String.t/0`) - Required. Display name for the new network ID

* `:routingPolicy` (`t:map/0`) - Map of asset-group → routing destination. Supports `CustomRoutingDest` or `NoneNetworkRoutingDest` only (no `DEFAULT` scheme)

# `delete_network_connection`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L107)

```elixir
@spec delete_network_connection(String.t()) :: map()
```

Deletes an existing network connection by its ID.

- `connection_id`: The ID of the network connection to delete.

# `delete_network_id`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L253)

```elixir
@spec delete_network_id(String.t()) :: map()
```

Deletes a network ID by its ID.

- `network_id`: The ID of the network to delete.

# `get_network_connection`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L97)

```elixir
@spec get_network_connection(String.t()) :: map()
```

Returns a single network connection by its ID.

- `connection_id`: The ID of the network connection.

# `get_network_connections`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L51)

```elixir
@spec get_network_connections() :: list()
```

Returns all network connections.

Subject to Flexible Routing Schemes. Each connection includes a routing policy
that controls how outgoing transactions are dispatched — `None`, `Custom`, or
`Default`.

# `get_network_id`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L243)

```elixir
@spec get_network_id(String.t()) :: map()
```

Returns a specific network ID by its ID.

- `network_id`: The ID of the network to retrieve.

# `get_network_ids`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L159)

> This function is deprecated. Use search_network_ids/1 instead. See Fireblocks swagger spec for details..

```elixir
@spec get_network_ids() :: list()
```

Returns all local and discoverable remote network IDs.

> #### Deprecated {: .warning}
> This endpoint is deprecated. Use `search_network_ids/1` instead.

# `get_routing_policy_asset_groups`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L197)

```elixir
@spec get_routing_policy_asset_groups() :: list()
```

Returns all enabled routing policy asset groups for the workspace.

Asset groups are the keys used in routing policy maps (e.g. `"ETH"`,
`"BTC"`, `"ERC20"`).

# `search_network_ids`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L231)

```elixir
@spec search_network_ids(keyword()) :: map()
```

Returns both local and discoverable remote network IDs with optional filtering.

This is the preferred replacement for the deprecated `get_network_ids/0`.

Options:
* `:search` (`t:String.t/0`) - Filter results by displayName or networkId (minimum 1 character)

* `:excludeSelf` (`t:boolean/0`) - When `true`, excludes your own workspace's network IDs from results

* `:onlySelf` (`t:boolean/0`) - When `true`, returns only your own workspace's network IDs

* `:excludeConnected` (`t:boolean/0`) - When `true`, excludes network IDs that already have an active connection

* `:pageCursor` (`t:String.t/0`) - Cursor for the next page of results

* `:pageSize` (`t:non_neg_integer/0`) - Number of records per page (1–50, default 50)

# `set_network_id_discoverability`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L299)

```elixir
@spec set_network_id_discoverability(
  String.t(),
  keyword()
) :: map()
```

Updates the discoverability setting of a network ID.

When `isDiscoverable` is `true`, other workspaces can find and connect to this
network ID. When `false`, it is hidden from remote searches.

- `network_id`: The ID of the network to update.

Options:
* `:isDiscoverable` (`t:boolean/0`) - Required. Whether this network ID should be visible and discoverable by other workspaces

# `set_network_id_name`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L321)

```elixir
@spec set_network_id_name(
  String.t(),
  keyword()
) :: map()
```

Updates the display name of a specified network ID.

- `network_id`: The ID of the network to rename.

Options:
* `:name` (`t:String.t/0`) - Required. New display name for the network ID

# `set_network_id_routing_policy`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L274)

```elixir
@spec set_network_id_routing_policy(
  String.t(),
  keyword()
) :: map()
```

Updates the routing policy of a specified network ID.

- `network_id`: The ID of the network to update.

Options:
* `:routingPolicy` (`t:map/0`) - Required. New routing policy — map of asset-group → routing destination. Supports `CustomRoutingDest` or `NoneNetworkRoutingDest` only

# `set_routing_policy`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.1/lib/fireblocks_sdk/api/network_connection.ex#L128)

```elixir
@spec set_routing_policy(
  String.t(),
  keyword()
) :: map()
```

Updates the routing policy of an existing network connection.

- `connection_id`: The ID of the network connection to update.

Options:
* `:routingPolicy` (`t:map/0`) - Required. New routing policy — map of asset-group → routing destination (`CustomRoutingDest`, `DefaultNetworkRoutingDest`, or `NoneNetworkRoutingDest`)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
