POST
/
v1
/
integrations
/
{integrationId}
/
set-primary
import { Novu } from "@novu/api";

const novu = new Novu({
  secretKey: "YOUR_SECRET_KEY_HERE",
});

async function run() {
  const result = await novu.integrations.setAsPrimary("<id>");

  // Handle the result
  console.log(result);
}

run();
{
  "_id": "<string>",
  "_environmentId": "<string>",
  "_organizationId": "<string>",
  "name": "<string>",
  "identifier": "<string>",
  "providerId": "<string>",
  "channel": "in_app",
  "credentials": {
    "apiKey": "<string>",
    "user": "<string>",
    "secretKey": "<string>",
    "domain": "<string>",
    "password": "<string>",
    "host": "<string>",
    "port": "<string>",
    "secure": true,
    "region": "<string>",
    "accountSid": "<string>",
    "messageProfileId": "<string>",
    "token": "<string>",
    "from": "<string>",
    "senderName": "<string>",
    "projectName": "<string>",
    "applicationId": "<string>",
    "clientId": "<string>",
    "requireTls": true,
    "ignoreTls": true,
    "tlsOptions": {},
    "baseUrl": "<string>",
    "webhookUrl": "<string>",
    "redirectUrl": "<string>",
    "hmac": true,
    "serviceAccount": "<string>",
    "ipPoolName": "<string>",
    "apiKeyRequestHeader": "<string>",
    "secretKeyRequestHeader": "<string>",
    "idPath": "<string>",
    "datePath": "<string>",
    "apiToken": "<string>",
    "authenticateByToken": true,
    "authenticationTokenKey": "<string>",
    "instanceId": "<string>",
    "alertUid": "<string>",
    "title": "<string>",
    "imageUrl": "<string>",
    "state": "<string>",
    "externalLink": "<string>",
    "channelId": "<string>",
    "phoneNumberIdentification": "<string>",
    "accessKey": "<string>"
  },
  "active": true,
  "deleted": true,
  "deletedAt": "<string>",
  "deletedBy": "<string>",
  "primary": true,
  "conditions": [
    {
      "isNegated": true,
      "type": "BOOLEAN",
      "value": "AND",
      "children": [
        {
          "field": "<string>",
          "value": "<string>",
          "operator": "LARGER",
          "on": "subscriber"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

integrationId
string
required

Response

200
application/json
OK
_environmentId
string
required

The unique identifier for the environment associated with this integration. This links to the Environment collection.

_organizationId
string
required

The unique identifier for the organization that owns this integration. This links to the Organization collection.

name
string
required

The name of the integration, which is used to identify it in the user interface.

identifier
string
required

A unique string identifier for the integration, often used for API calls or internal references.

providerId
string
required

The identifier for the provider of the integration (e.g., "mailgun", "twilio").

channel
enum<string>
required

The channel type for the integration, which defines how the integration communicates (e.g., email, SMS).

Available options:
in_app,
email,
sms,
chat,
push
credentials
object
required

The credentials required for the integration to function, including API keys and other sensitive information.

active
boolean
required

Indicates whether the integration is currently active. An active integration will process events and messages.

deleted
boolean
required

Indicates whether the integration has been marked as deleted (soft delete).

primary
boolean
required

Indicates whether this integration is marked as primary. A primary integration is often the default choice for processing.

_id
string

The unique identifier of the integration record in the database. This is automatically generated.

deletedAt
string

The timestamp indicating when the integration was deleted. This is set when the integration is soft deleted.

deletedBy
string

The identifier of the user who performed the deletion of this integration. Useful for audit trails.

conditions
object[]

An array of conditions associated with the integration that may influence its behavior or processing logic.