> ## Documentation Index
> Fetch the complete documentation index at: https://invoca-5bd45748-mintlify-8d5425ca.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Networks

> Read and update your Invoca network's configuration and users, including branding, feature flags, and Super User accounts, via the Network Integration API.

Network users are replicated to and retrieved from the Invoca Marketing Automation Platform using this API.

The network interface is fully idempotent, and the create and update commands both expect the full set of users each time. For instance, if on one POST two users, [user1@invoca.com](mailto:user1@invoca.com) and [user2@invoca.com](mailto:user2@invoca.com) are specified, but on the next POST, only [user1@invoca.com](mailto:user1@invoca.com) is specified, then as a result of that second post, [user2@invoca.com](mailto:user2@invoca.com) will be deleted. For this reason, POST and PUT requests are identical in their effect, although they return 201 and 200 codes respectively for ease of integration.

## Parameters

| Parameter                                           | Type                                                            | Description                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                                                | string                                                          | Network name (read only).                                                                                                                                                                                                                                                                                                                 |
| **users**                                           | JSON array of hashes                                            | 0 or more users for the organization. Each must have first 5 fields below.                                                                                                                                                                                                                                                                |
| id\_from\_network                                   | string                                                          | The network id for this User.                                                                                                                                                                                                                                                                                                             |
| email\_settings                                     | JSON array of hashes                                            | Each hash has two required fields: `email_address` (string in RFC 2822 addr-spec format — the user's email address, unique for this user) and `use_for_notifications` (boolean used to indicate if notifications should be sent to the email address). A user must have at least one email address where `use_for_notifications` is true. |
| first\_name                                         | string (Required)                                               | The user's first name.                                                                                                                                                                                                                                                                                                                    |
| last\_name                                          | string (Required)                                               | The user's last name.                                                                                                                                                                                                                                                                                                                     |
| contact\_phone\_number                              | string in ITU E.164 format or 10-digit US form (no punctuation) | The user's phone number.                                                                                                                                                                                                                                                                                                                  |
| oauth\_refresh\_token                               | string                                                          | Not used. Reserved.                                                                                                                                                                                                                                                                                                                       |
| role                                                | One of: Super (default), Manager, Member, Observer              | This user's role in this organization. (A user may have different roles in different organizations.)                                                                                                                                                                                                                                      |
| notify\_on\_budgets                                 | boolean, optional, defaults to false                            |                                                                                                                                                                                                                                                                                                                                           |
| notify\_on\_campaign\_applications                  | boolean, optional, defaults to false                            |                                                                                                                                                                                                                                                                                                                                           |
| notify\_on\_campaign\_expirations                   | boolean, optional, defaults to false                            |                                                                                                                                                                                                                                                                                                                                           |
| notify\_on\_creative\_duplication\_requests         | boolean, optional, defaults to false                            |                                                                                                                                                                                                                                                                                                                                           |
| notify\_on\_network\_announcements                  | boolean, optional, defaults to false                            |                                                                                                                                                                                                                                                                                                                                           |
| notify\_on\_performance\_notifications              | Deprecated, always returns false                                |                                                                                                                                                                                                                                                                                                                                           |
| notify\_on\_monthly\_campaign\_performance\_reports | Deprecated, always returns false                                |                                                                                                                                                                                                                                                                                                                                           |
| notify\_on\_weekly\_campaign\_performance\_reports  | Deprecated, always returns false                                |                                                                                                                                                                                                                                                                                                                                           |
| notify\_on\_call\_activities                        | boolean, optional, defaults to false                            |                                                                                                                                                                                                                                                                                                                                           |
| can\_login\_via\_platform                           | boolean (read-only)                                             | Indicates if user can directly login with username and password. If false, the user is managed via SSO.                                                                                                                                                                                                                                   |

**Endpoint:**

`https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/network.json`

***

## GET Network and Users

Get the network and its users.

### Example

Read network and its users.

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/network.json`

**Format:** application/json

**Response Code:** 200

**Response Body:**

```json theme={null}
{
  "name": "Invoca",
  "users": [
    {
      "id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
      "email_settings": [
        { "email_address": "chris@nfltix.com", "use_for_notifications": true }
      ],
      "first_name": "Chris",
      "last_name": "Dean",
      "phone_number": "800-437-7950",
      "role": "Manager",
      "oauth_refresh_token": "556588585858585858585858858",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_performance_notifications": false,
      "notify_on_monthly_campaign_performance_reports": false,
      "notify_on_weekly_campaign_performance_reports": false,
      "notify_on_call_activities": true,
      "can_login_via_platform": false
    },
    {
      "id_from_network": "694940505055cFUyYnFHyiYA42TrpM",
      "email_address": "jim@nfltix.com",
      "first_name": "Jim",
      "last_name": "Williams",
      "phone_number": "800-437-7950",
      "role": "Observer",
      "oauth_refresh_token": "556588585858585858585858858",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_performance_notifications": false,
      "notify_on_monthly_campaign_performance_reports": false,
      "notify_on_weekly_campaign_performance_reports": false,
      "notify_on_call_activities": true,
      "can_login_via_platform": false
    }
  ]
}
```

***

## POST Network Users

Create network users.

### Example

Create network users.

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/network.json`

**Format:** application/json

**Request Body:**

```json theme={null}
{
  "users": [
    {
      "id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
      "email_settings": [
        { "email_address": "chris@nfltix.com", "use_for_notifications": true }
      ],
      "first_name": "Chris",
      "last_name": "Dean",
      "phone_number": "8004377950",
      "role": "Manager",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_call_activities": true
    },
    {
      "id_from_network": "694940505055cFUyYnFHyiYA42TrpM",
      "email_address": "jim@nfltix.com",
      "first_name": "Jim",
      "last_name": "Williams",
      "phone_number": "8004377950",
      "role": "Observer",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_call_activities": true
    }
  ]
}
```

**Response Code:** 201

***

## PUT Network Users

Update network users.

### Examples

#### Update with Invalid Email Address

Update a network and its user with an invalid email address.

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/network.json`

**Format:** application/json

**Request Body:**

```json theme={null}
{
  "users": [
    {
      "id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
      "email_settings": [
        { "email_address": "chris@domain.com", "use_for_notifications": true }
      ],
      "first_name": "Chris",
      "last_name": "Dean",
      "phone_number": "8004377950",
      "role": "Manager",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_call_activities": true
    }
  ]
}
```

**Response Code:** 403

**Response Body:**

```json theme={null}
{
  "errors": {
    "users": [
      {
        "email_settings": [
          { "email_address": ["is invalid"] }
        ]
      }
    ]
  }
}
```

***

#### Delete Network Users

Delete network users by putting an empty user array.

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/network.json`

**Format:** application/json

**Request Body:**

```json theme={null}
{
  "users": []
}
```
