# Update a callback URI

> **PATCH** `https://api.us.nylas.com/v3/applications/redirect-uris/{id}`

Source: https://developer.nylas.com/docs/reference/api/applications/update_callback_uri/

Updates the specified callback URI.

If you don't define the `platform`, Nylas doesn't modify the existing settings.

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 |
|------|------|----------|-------------|
| `id` | string | Yes |  |

## Request body

Content-Type: application/json

- **Web or Desktop**
- **JS**
- **iOS**
- **Android**

## Responses

### 200 - Returns callback URI

- `request_id` (string) - ID of the request
- `data` (any)
  - **Web or Desktop**
  - **JS**
  - **iOS**
  - **Android**

### 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/applications/redirect-uris/<CALLBACK_URI_ID>' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --header 'Content-Type: application/json'
  --data '{
    "url": "<UPDATED_CALLBACK_URI>"
  }'
```

### Node.js SDK

```javascript
import Nylas from "nylas";

const nylas = new Nylas({
  apiKey: "<NYLAS_API_KEY>",
  apiUri: "<NYLAS_API_URI>",
});

const updated = await nylas.applications.redirectUris.update({
  redirectUriId: "<CALLBACK_URI_ID>",
  requestBody: {
    url: "<UPDATED_CALLBACK_URI>",
  },
});

console.log("Redirect URI updated:", updated);

```

### Python SDK

```python
from nylas import Client

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

redirect_uri = nylas.applications.redirect_uris.update(
    redirect_uri_id="<REDIRECT_URI_ID>",
    request_body={
        "url": "https://example.com/oauth/exchange",
        "platform": "web",
    },
)

print("Updated redirect URI:", redirect_uri)

```

### Java SDK

```java
import com.nylas.NylasClient;
import com.nylas.models.NylasApiError;
import com.nylas.models.NylasSdkTimeoutError;
import com.nylas.models.RedirectUri;
import com.nylas.models.Response;
import com.nylas.models.UpdateRedirectUriRequest;

public class UpdateRedirectUri {
  public static void main(String[] args) throws NylasSdkTimeoutError, NylasApiError {
    NylasClient nylas = new NylasClient.Builder("<NYLAS_API_KEY>").build();

    UpdateRedirectUriRequest requestBody = new UpdateRedirectUriRequest.Builder()
        .url("<UPDATED_CALLBACK_URI>")
        .build();

    Response<RedirectUri> updated = nylas.applications().redirectUris()
        .update("<CALLBACK_URI_ID>", requestBody);

    System.out.println("Redirect URI updated: " + updated.getData());
  }
}

```

### Kotlin SDK

```kotlin
import com.nylas.NylasClient
import com.nylas.models.UpdateRedirectUriRequest

fun main() {
  val nylas = NylasClient.Builder("<NYLAS_API_KEY>").build()

  val requestBody = UpdateRedirectUriRequest.Builder()
      .url("<UPDATED_CALLBACK_URI>")
      .build()

  val updated = nylas.applications().redirectUris().update("<CALLBACK_URI_ID>", requestBody)

  println("Redirect URI updated: ${updated.data}")
}

```
