# syncNetwork

This method enables network monitoring so you can poll connection events — accepted requests, new connections, and incoming connection requests — without diffing the connection list yourself.

This method enables **network monitoring** for your account so you can [poll the network](/sdks/poll-network) for connection events as they happen. Run it once per account.

> Instead of repeatedly retrieving connections and pending requests and comparing the results, `syncNetwork` watches the account's network in the background and captures every change. Only changes that happen **after** it is enabled are captured — existing connections and pending invitations are used as a silent baseline and never emitted.

```typescript
try {
  const workflow = await linkedapi.syncNetwork.execute();

  const { errors } = await linkedapi.syncNetwork.result(workflow.workflowId);

  // The list of possible execution errors is below
  if (errors && errors.length > 0) {
    console.warn('Workflow completed with execution errors:');
    errors.forEach(error => {
      console.warn(` - Type: ${error.type}, Message: ${error.message}`);
    });
  } else {
    console.log('Network monitoring enabled.');
  }
} catch (e) {
  // A list of all critical errors can be found here:
  // https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
  if (e instanceof LinkedApiError) {
    console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
  } else {
    console.error('An unexpected, non-API error occurred:', e);
  }
}
```

```python
from linkedapi import LinkedApiError

try:
    workflow = linkedapi.sync_network.execute()

    result = linkedapi.sync_network.result(workflow.workflow_id)
    errors = result.errors

    # The list of possible execution errors is below
    if errors:
        print("Workflow completed with execution errors:")
        for error in errors:
            print(f" - Type: {error.type}, Message: {error.message}")
    else:
        print("Network monitoring enabled.")
except LinkedApiError as e:
    # A list of all critical errors can be found here:
    # https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
    print(f"Critical Error - Type: {e.type}, Message: {e.message}")
except Exception as error:
    print("An unexpected, non-API error occurred:", error)
```

## Params

This method takes no parameters.

## Data

The method doesn't return any data.
