> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/sms/integrations/set-default.md).

# Set an integration as default

Make an SMS integration the default that Cloud picks for you on campaigns, trigger actions and tests.

**Where:** SMS → Integrations → an integration → **Actions** → **Set as default** · `/projects/<project>/sms/integrations/<integrationId>/edit`

## Before you start

* The integration is saved and **enabled**: **Set as default** is greyed out on a disabled integration and on the one that is already the default.
* You need `sms:manage` on SMS integrations.
* The default is per environment and is only a pre-selection: campaigns and trigger actions always name their own integration, and the server never falls back to the default.

## Steps

1. Open the integration, here `Twilio (Acme support line)`, and open **Actions**.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-26c6c38dbe92e53985963f23819dda0a216b4c02%2Fdisable-1.png?alt=media" alt="The Actions menu of the Twilio integration: Set as default, Disable, See Twilio documentation, See SDK documentation, See API documentation, Delete"><figcaption><p>The Actions menu.</p></figcaption></figure>
2. Press **Set as default**.

## Result

The integration page shows the **DEFAULT** badge, and in the list the **DEFAULT** badge moves to its row. New campaigns, trigger actions and template tests now pick it for you. Campaigns created earlier keep the integration they were created with.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-12872e3cb92d4a32f5aed5be80dff667edac1ec3%2Fset-default-2.png?alt=media" alt="SMS Service Integrations list: Twilio (Acme support line) now carries the DEFAULT badge, Test Me none"><figcaption><p>Twilio is the default now.</p></figcaption></figure>

## Change or remove it later

* Set another integration as default the same way; there is always one default per environment while integrations exist.
* The default cannot be disabled or deleted while other integrations exist in the environment (`CM-ERRORS-INTEGRATIONS-021`) — set another one as default first.

## Do it from code

The SDK sends the integration id only in the address, but the gateway also reads it from the body; pass it a second time as `Id` until this is fixed.

```ts
const id = 'int_6owP11oF9ZZAt9szkqy99S'; // Test Me (Fake)
await norbix.hub.notifications.setSmsIntegrationAsDefault({ id, Id: id } as any);
const { defaultIntegrationId } = await norbix.hub.notifications.getSmsIntegrations();
console.log(defaultIntegrationId); // int_6owP11oF9ZZAt9szkqy99S
```

```sh
norbix raw -X PUT /v2/notifications/sms/integrations/int_6owP11oF9ZZAt9szkqy99S/default -b '{"id":"int_6owP11oF9ZZAt9szkqy99S"}'
```

The client setup is on the [SMS page](/codemash/cloud/sms.md#use-it-from-code). API: [Set Sms Integration As Default](/codemash/api-reference/notifications/sms/set-sms-integration-as-default.md)
