> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoca.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Networks

export const MethodTag = ({method = "GET", path, label, colors = {}}) => {
  const presets = {
    get: {
      label: "GET",
      light: {
        bg: "#DCFCE7",
        text: "#15803D"
      },
      dark: {
        bg: "rgba(34,197,94,0.16)",
        text: "#4ADE80"
      }
    },
    post: {
      label: "POST",
      light: {
        bg: "#DBEAFE",
        text: "#1D4ED8"
      },
      dark: {
        bg: "rgba(59,130,246,0.16)",
        text: "#60A5FA"
      }
    },
    put: {
      label: "PUT",
      light: {
        bg: "#FEF3C7",
        text: "#B45309"
      },
      dark: {
        bg: "rgba(245,158,11,0.16)",
        text: "#FBBF24"
      }
    },
    patch: {
      label: "PATCH",
      light: {
        bg: "#F3E8FF",
        text: "#7E22CE"
      },
      dark: {
        bg: "rgba(168,85,247,0.16)",
        text: "#C084FC"
      }
    },
    delete: {
      label: "DEL",
      light: {
        bg: "#FEE2E2",
        text: "#B91C1C"
      },
      dark: {
        bg: "rgba(239,68,68,0.16)",
        text: "#F87171"
      }
    }
  };
  const fallback = {
    label: String(method).toUpperCase(),
    light: {
      bg: "#F3F4F6",
      text: "#374151"
    },
    dark: {
      bg: "rgba(156,163,175,0.16)",
      text: "#D1D5DB"
    }
  };
  const preset = presets[String(method).toLowerCase()] || fallback;
  const light = {
    ...preset.light,
    ...colors.light || ({})
  };
  const dark = {
    ...preset.dark,
    ...colors.dark || ({})
  };
  const css = `
    .invoca-method-tag {
      display: inline-block;
      padding: 1px 8px;
      margin-right: 8px;
      border-radius: 8px;
      font-size: 10px;
      line-height: 18px;
      font-weight: 700;
      letter-spacing: 0.4px;
      text-transform: uppercase;
      vertical-align: middle;
      background: var(--imt-bg);
      color: var(--imt-fg);
    }
    .invoca-method-path {
      font-size: 13px;
    }
    [data-component-part="accordion-icon"]:has(.invoca-method-tag) {
      width: auto;
      height: auto;
      flex-shrink: 0;
    }
    [data-component-part="accordion-icon"] .invoca-method-tag {
      margin-right: 0;
    }
    [data-component-part="accordion-button"]:has(.invoca-method-tag) {
      flex-wrap: wrap;
      row-gap: 6px;
    }
    [data-component-part="accordion-button"]:has(.invoca-method-tag) [data-component-part="accordion-icon"] {
      flex: 1 1 0;
      min-width: 0;
      overflow-wrap: anywhere;
    }
    [data-component-part="accordion-button"]:has(.invoca-method-tag) [data-component-part="accordion-title-container"] {
      flex: 0 0 calc(100% - 8px);
      padding-left: 20px;
    }
    [data-component-part="accordion-button"]:has(.invoca-method-tag) [data-component-part="accordion-title"] {
      font-size: 12px;
    }
    .dark .invoca-method-tag,
    [data-theme="dark"] .invoca-method-tag {
      background: var(--imt-bg-dark);
      color: var(--imt-fg-dark);
    }
  `;
  const vars = {
    "--imt-bg": light.bg,
    "--imt-fg": light.text,
    "--imt-bg-dark": dark.bg,
    "--imt-fg-dark": dark.text
  };
  return <span>
      <style>{css}</style>
      <span className="invoca-method-tag" style={vars}>
        {label || preset.label}
      </span>
      {path ? <code className="invoca-method-path">{path}</code> : null}
    </span>;
};

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%40invoca.com) and [user2@invoca.com](mailto:user2%40invoca.com) are specified, but on the next POST, only [user1@invoca.com](mailto:user1%40invoca.com) is specified, then as a result of that second post, [user2@invoca.com](mailto:user2%40invoca.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

<table className="parameters docutils align-default"><thead><tr className="row-odd"><th className="head"><p>Property</p></th><th className="head"><p>Type</p></th><th className="head"><p>Value</p></th></tr></thead><tbody><tr className="row-even"><td><p>name</p></td><td><p>string</p></td><td><p>Network name (read only).</p></td></tr><tr className="row-odd"><td><p><strong>users</strong></p></td><td><p>JSON array of hashes</p></td><td><p>0 or more users for the organization. Each must have first 5 fields below.</p></td></tr><tr className="row-even"><td><p>id\_from\_network</p></td><td><p>string</p></td><td><p>The network id for this User.</p></td></tr><tr className="row-odd"><td><p>email\_settings</p></td><td><p>JSON array of hashes</p></td><td><p>Each hash has two required fields:</p><p><code className="docutils literal notranslate"><span className="pre">email\_address</span></code>: string in RFC 2822 addr-spec format. The user’s email address. Unique for this user.</p><p><code className="docutils literal notranslate"><span className="pre">use\_for\_notifications</span></code>: boolean used to indicate if notifications should be sent to the email address.</p><p>A user must have at least one email address where <code className="docutils literal notranslate"><span className="pre">use\_for\_notifications</span></code> is true.</p></td></tr><tr className="row-even"><td><p>first\_name</p></td><td><p>string (Required)</p></td><td><p>The user’s first name.</p></td></tr><tr className="row-odd"><td><p>last\_name</p></td><td><p>string (Required)</p></td><td><p>The user’s last name.</p></td></tr><tr className="row-even"><td><p>contact\_phone\_number</p></td><td><p>string in ITU E.164 format or 10-digit US form (no punctuation)</p></td><td><p>The user’s phone number.</p></td></tr><tr className="row-odd"><td><p>oauth\_refresh\_token</p></td><td><p>string</p></td><td><p>Not used. Reserved.</p></td></tr><tr className="row-even"><td><p>role</p></td><td><p>One of: Super (default), Manager, Member, Observer</p></td><td><p>This user’s role in this organization. (A user may have different roles in different organizations)</p></td></tr><tr className="row-odd"><td><p>notify\_on\_budgets</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-even"><td><p>notify\_on\_campaign\_applications</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-odd"><td><p>notify\_on\_campaign\_expirations</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-even"><td><p>notify\_on\_creative\_duplication\_requests</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-odd"><td><p>notify\_on\_network\_announcements</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-even"><td><p>notify\_on\_performance\_notifications</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-odd"><td><p>notify\_on\_monthly\_campaign\_performance\_reports</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-even"><td><p>notify\_on\_weekly\_campaign\_performance\_reports</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-odd"><td><p>notify\_on\_call\_activities</p></td><td><p>boolean, optional, defaults to false</p></td><td /></tr><tr className="row-even"><td><p>can\_login\_via\_platform</p></td><td><p>boolean (read-only)</p></td><td><p>Indicates if user can directly login with username and password. If false, the user is managed via SSO.</p></td></tr></tbody></table>

Endpoint:

`https://invoca.net/api/2019-05-01/<network_id>/network.json`

<AccordionGroup>
  <Accordion title="Get Network and its Users" icon={<MethodTag method="get" path="/<network_id>/network"/>}>
    #### Examples

    Read network and its users

    Endpoint:

    `https://invoca.net/api/2019-05-01/<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": true,
          "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": true,
          "notify_on_weekly_campaign_performance_reports": false,
          "notify_on_call_activities": true,
          "can_login_via_platform": false
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="Create Network Users" icon={<MethodTag method="post" path="/<network_id>/network"/>}>
    #### Examples

    Create network users

    Endpoint:

    `https://invoca.net/api/2019-05-01/<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_performance_notifications": false,
          "notify_on_monthly_campaign_performance_reports": true,
          "notify_on_weekly_campaign_performance_reports": false,
          "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_performance_notifications": false,
          "notify_on_monthly_campaign_performance_reports": true,
          "notify_on_weekly_campaign_performance_reports": false,
          "notify_on_call_activities": true
        }
      ]
    }
    ```

    Response Code: 201
  </Accordion>

  <Accordion title="Update Network Users" icon={<MethodTag method="put" path="/<network_id>/network"/>}>
    #### Examples

    Update a network and its user with invalid email address

    Endpoint:

    `https://invoca.net/api/2019-05-01/<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_performance_notifications": false,
          "notify_on_monthly_campaign_performance_reports": true,
          "notify_on_weekly_campaign_performance_reports": false,
          "notify_on_call_activities": true
        }
      ]
    }
    ```

    Response Code: 403

    Response Body:

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

    ***

    Delete network users by putting an empty user hash

    Endpoint:

    `https://invoca.net/api/2019-05-01/<network_id>/network.json`

    Format: application/json

    Request Body:

    ```json theme={null}
    {
      "users": [
      ]
    }
    ```
  </Accordion>
</AccordionGroup>
