# Update communication options (/docs/apis/management/options/PatchCommunicationOptions)

`PATCH /options/communication`

Applies a partial update to the email and SMS delivery configuration. Only fields included in the request are updated.

Base URL: `https://{tenant}.{region}.monocloud.com/api`, where `{tenant}`, `{region}` (one of us, eu, in) come from your tenant. Authentication: send your Management API key in the `X-API-KEY` header.

## Request body

JSON, required. The request payload used to update the communication options.

- `email` (PatchCommunicationEmailOptionsRequest) Configuration options for email delivery.
  - `provider` (string) The email provider used for sending messages. One of: `monocloud`, `send_grid`.
  - `send_grid` (PatchCommunicationEmailSendGridOptionsRequest) Configuration options for SendGrid email delivery.
    - `api_key` (string) SendGrid API key used to authenticate requests to the SendGrid service.
    - `from_email` (string, email) The email address used as the sender for outgoing emails.
    - `from_name` (string) The display name used as the sender for outgoing emails.
- `sms` (PatchCommunicationSmsOptionsRequest) Configuration options for SMS delivery.
  - `provider` (string) The SMS provider used for sending messages. One of: `monocloud`, `twilio`.
  - `twilio` (PatchCommunicationSmsTwilioOptionsRequest) Configuration options for Twilio SMS delivery.
    - `sid` (string) The Twilio Account SID.
    - `auth_token` (string) The Twilio Auth Token associated with the account.
    - `messaging_sid` (string) The Twilio Messaging Service SID used to send SMS messages.
    - `from` (string) The sender phone number or alphanumeric sender ID used for SMS messages.

## Response body

`200`, JSON. The communication options were updated successfully

Returns `CommunicationOptions`.

- `email` (CommunicationEmailOptions, required) Configuration options for email delivery.
  - `send_grid` (CommunicationEmailSendGridOptions) Configuration options for SendGrid email delivery.
    - `api_key` (string, required) SendGrid API key used to authenticate requests to the SendGrid service.
    - `from_email` (string, required) The email address used as the sender for outgoing emails.
    - `from_name` (string) The display name used as the sender for outgoing emails.
  - `provider` (string, required) The email provider used for sending messages. One of: `monocloud`, `send_grid`.
  - `default_from_email` (string, required) The tenant-specific sender email address.
- `sms` (CommunicationSmsOptions, required) Configuration options for SMS delivery.
  - `twilio` (CommunicationSmsTwilioOptions) Configuration options for Twilio SMS delivery.
    - `sid` (string, required) The Twilio Account SID.
    - `auth_token` (string, required) The Twilio Auth Token associated with the account.
    - `messaging_sid` (string) The Twilio Messaging Service SID used to send SMS messages.
    - `from` (string) The sender phone number or alphanumeric sender ID used for SMS messages.
  - `provider` (string, required) The SMS provider used for sending messages. One of: `monocloud`, `twilio`.

## Errors

- `400` Bad Request
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
- `401` Unauthorized
- `402` Payment Required
  Same body as `400`.
- `403` Forbidden
- `404` Not Found
  Same body as `400`.
- `422` Unprocessable Entity
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
  - `errors` (Record<string, string[]>, required) A key-value map of validation errors, where each key represents a request field and the value contains one or more messages describing why the request could not be processed.

## Example (MonoCloud .NET SDK)

```csharp
using MonoCloud.Management;
using MonoCloud.Management.Models;
using MonoCloud.Management.Core.Base;

var apiClient = new MonoCloudManagementClient(new MonoCloudConfig("<your-domain>", "[[API-Key]]"));


var requestBody = new PatchCommunicationOptionsRequest
  {
    Email = new PatchCommunicationEmailOptionsRequest
    {
      Provider = EmailProviders.Monocloud,
      SendGrid = new PatchCommunicationEmailSendGridOptionsRequest
      {
        ApiKey = "KJFdlswierur458dfhkJHFwkoepOURFuasd",
        FromEmail = "support@acme.com",
        FromName = "Acme Support",
      },
    },
    Sms = new PatchCommunicationSmsOptionsRequest
    {
      Provider = SmsProviders.Monocloud,
      Twilio = new PatchCommunicationSmsTwilioOptionsRequest
      {
        Sid = "lakshGHIur984573",
        AuthToken = "867dsfujgFTe6724356tgfds",
        MessagingSid = "867dsfujgFTe6724356tgfds",
        From = "ACME",
      },
    },
  };


var result = await apiClient.Options.PatchCommunicationOptionsAsync(requestBody);
```

## Example (MonoCloud Javascript SDK)

```javascript
import { MonoCloudManagementClient } from '@monocloud/management';

const apiClient = MonoCloudManagementClient.init({ domain: '<your-domain>', apiKey: '[[API-Key]]' });

const requestBody = {
  email: {
    provider: 'monocloud',
    send_grid: {
      api_key: 'KJFdlswierur458dfhkJHFwkoepOURFuasd',
      from_email: 'support@acme.com',
      from_name: 'Acme Support'
    }
  },
  sms: {
    provider: 'monocloud',
    twilio: {
      sid: 'lakshGHIur984573',
      auth_token: '867dsfujgFTe6724356tgfds',
      messaging_sid: '867dsfujgFTe6724356tgfds',
      from: 'ACME'
    }
  }
};

const result = apiClient.options.patchCommunicationOptions(requestBody);
```