Set integration as primary

POST
/v1/integrations/{integrationId}/set-primary

Authorization

Authorization<token>

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

In: header

Path Parameters

integrationIdRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

_idstring

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

_environmentIdRequiredstring

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

_organizationIdRequiredstring

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

nameRequiredstring

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

identifierRequiredstring

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

providerIdRequiredstring

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

channelRequiredstring

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

Value in: "in_app" | "email" | "sms" | "chat" | "push"
credentialsRequiredobject

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

activeRequiredboolean

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

deletedRequiredboolean

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

deletedAtstring

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

deletedBystring

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

primaryRequiredboolean

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

conditionsarray<object>

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

export interface Response {
  /**
   * The unique identifier of the integration record in the database. This is automatically generated.
   */
  _id?: string;
  /**
   * The unique identifier for the environment associated with this integration. This links to the Environment collection.
   */
  _environmentId: string;
  /**
   * The unique identifier for the organization that owns this integration. This links to the Organization collection.
   */
  _organizationId: string;
  /**
   * The name of the integration, which is used to identify it in the user interface.
   */
  name: string;
  /**
   * A unique string identifier for the integration, often used for API calls or internal references.
   */
  identifier: string;
  /**
   * The identifier for the provider of the integration (e.g., "mailgun", "twilio").
   */
  providerId: string;
  /**
   * The channel type for the integration, which defines how the integration communicates (e.g., email, SMS).
   */
  channel: "in_app" | "email" | "sms" | "chat" | "push";
  /**
   * The credentials required for the integration to function, including API keys and other sensitive information.
   */
  credentials: CredentialsDto;
  /**
   * Indicates whether the integration is currently active. An active integration will process events and messages.
   */
  active: boolean;
  /**
   * Indicates whether the integration has been marked as deleted (soft delete).
   */
  deleted: boolean;
  /**
   * The timestamp indicating when the integration was deleted. This is set when the integration is soft deleted.
   */
  deletedAt?: string;
  /**
   * The identifier of the user who performed the deletion of this integration. Useful for audit trails.
   */
  deletedBy?: string;
  /**
   * Indicates whether this integration is marked as primary. A primary integration is often the default choice for processing.
   */
  primary: boolean;
  /**
   * An array of conditions associated with the integration that may influence its behavior or processing logic.
   */
  conditions?: StepFilterDto[];
}
export interface CredentialsDto {
  apiKey?: string;
  user?: string;
  secretKey?: string;
  domain?: string;
  password?: string;
  host?: string;
  port?: string;
  secure?: boolean;
  region?: string;
  accountSid?: string;
  messageProfileId?: string;
  token?: string;
  from?: string;
  senderName?: string;
  projectName?: string;
  applicationId?: string;
  clientId?: string;
  requireTls?: boolean;
  ignoreTls?: boolean;
  tlsOptions?: {};
  baseUrl?: string;
  webhookUrl?: string;
  redirectUrl?: string;
  hmac?: boolean;
  serviceAccount?: string;
  ipPoolName?: string;
  apiKeyRequestHeader?: string;
  secretKeyRequestHeader?: string;
  idPath?: string;
  datePath?: string;
  apiToken?: string;
  authenticateByToken?: boolean;
  authenticationTokenKey?: string;
  instanceId?: string;
  alertUid?: string;
  title?: string;
  imageUrl?: string;
  state?: string;
  externalLink?: string;
  channelId?: string;
  phoneNumberIdentification?: string;
  accessKey?: string;
}
export interface StepFilterDto {
  isNegated: boolean;
  type: "BOOLEAN" | "TEXT" | "DATE" | "NUMBER" | "STATEMENT" | "LIST" | "MULTI_LIST" | "GROUP";
  value: "AND" | "OR";
  children: FieldFilterPartDto[];
}
export interface FieldFilterPartDto {
  field: string;
  value: string;
  operator:
    | "LARGER"
    | "SMALLER"
    | "LARGER_EQUAL"
    | "SMALLER_EQUAL"
    | "EQUAL"
    | "NOT_EQUAL"
    | "ALL_IN"
    | "ANY_IN"
    | "NOT_IN"
    | "BETWEEN"
    | "NOT_BETWEEN"
    | "LIKE"
    | "NOT_LIKE"
    | "IN";
  on: "subscriber" | "payload";
}
 
curl -X POST "https://api.novu.co/v1/integrations/string/set-primary" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>"
{
  "_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"
        }
      ]
    }
  ]
}