# Update a connector

> **PATCH** `https://api.us.nylas.com/v3/connectors/{provider}`

Source: https://developer.nylas.com/docs/reference/api/connectors-integrations/update_connector_by_provider/

Update the connector for the specified provider.

When you make a `PATCH` request, Nylas replaces all data in the nested object with the information
included in your request. For more information, see
[Updating objects](/docs/reference/api/#updating-objects).

**Authentication:** NYLAS_API_KEY

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `provider` | string | Yes |  |

## Request body

Content-Type: application/json

- `settings` (object) - Oauth provider credentials and settings
- `scope` (array) - Oauth "scope" parameter
- `active_credential_id` (string) - (Optional) The ID of the "default" credential record of this Connector. This credential will be used as a default for communication with the provider.

## Responses

### 200 - Returns the connector object (previously called an integration) for the provider you specify.

- `request_id` (string) - ID of the request
- `data` (object)
  - `name` (string) **(required)** - The name of the connector.
  - `provider` (string) **(required)** - Provider type
  - `settings` (object) - Optional settings from provider
  - `scope` (array) - (Not used for Zoom connectors.) Optional default scopes for the connector. For Zoom, configure scopes directly on your Zoom OAuth app. See [Zoom granular scopes](https://developers.zoom.us/docs/integrations/oauth-scopes-granular/).
  - `active_credential_id` (string) - The ID of the "default" credential record of this Connector. This credential will be used as a default for communication with the provider.

### 400 - Bad Request

- `request_id` (string) **(required)** - ID of the request
- `error` (object) **(required)** - Error object
  - `type` (string) - Type of error
  - `message` (string) - Informative error message
  - `provider_error` (object) - (OPTIONAL) informative error message from provider's side

### 401 - Not Authenticated

- `request_id` (string) **(required)** - ID of the request
- `error` (object) **(required)** - Error object
  - `type` (string) - Type of error
  - `message` (string) - Informative error message
  - `provider_error` (object) - (OPTIONAL) informative error message from provider's side

### 404 - Not Found

- `request_id` (string) **(required)** - ID of the request
- `error` (object) **(required)** - Error object
  - `type` (string) - Type of error
  - `message` (string) - Informative error message
  - `provider_error` (object) - (OPTIONAL) informative error message from provider's side

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.us.nylas.com/v3/connectors/<PROVIDER>' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --data '{
    "name": "google"
  }'
```

### Python SDK

```python
from nylas import Client

nylas = Client(
    "<NYLAS_API_KEY>",
    "<NYLAS_API_URI>",
)

connector = nylas.connectors.update(
    provider="google",
    request_body={
        "name": "google"
    }
)

print("Connector:", connector)

```

### Ruby SDK

```ruby
require 'nylas'

nylas = Nylas::Client.new(
    api_key: "<NYLAS_API_KEY>"
)

request_body = {
  scope: [
    'https://www.googleapis.com/auth/contacts'
  ]
}

connector = nylas.connectors.update(provider: "google", request_body: request_body)

puts connector

```

### Java SDK

```java
import com.nylas.NylasClient;
import com.nylas.models.*;

import java.util.ArrayList;
import java.util.List;

public class ListDraft {
    public static void main(String[] args) throws 
    NylasSdkTimeoutError, NylasApiError {

        NylasClient nylas = 
        new NylasClient.Builder("<NYLAS_API_KEY>").build();

        List<String> scope = new ArrayList<>();
        scope.add("https://www.googleapis.com/auth/contacts");

        GoogleConnectorSettings settings = new GoogleConnectorSettings();

        UpdateConnectorRequest.Google request = new UpdateConnectorRequest.Google.Builder()
            .settings(settings)
            .scope(scope)
            .build();

        nylas.connectors().update(AuthProvider.GOOGLE, request);
    }
}

```

### Kotlin SDK

```kotlin
import com.nylas.NylasClient
import com.nylas.models.AuthProvider
import com.nylas.models.GoogleConnectorSettings
import com.nylas.models.UpdateConnectorRequest

fun main(args: Array<String>) {

    val nylas: NylasClient = NylasClient(
        apiKey = "<NYLAS_API_KEY>"
    )

    val settings : GoogleConnectorSettings = 
    GoogleConnectorSettings()

    val request = 
    UpdateConnectorRequest.Google(settings)

    val connector = 
    nylas.connectors().update(AuthProvider.GOOGLE, 
    request)
    println(connector)
}

```
