Generate chat OAuth URL

Generate an OAuth URL for chat integrations like Slack and MS Teams. This URL allows subscribers to authorize the integration, enabling the system to send messages through their chat workspace. The generated URL expires after 5 minutes.

POST
/v1/integrations/chat/oauth

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
subscriberIdstring

The subscriber ID to link the channel connection to. For Slack: Required for incoming webhook endpoints, optional for workspace connections. For MS Teams: Optional. Admin consent is tenant-wide and can be associated with a subscriber for organizational purposes.

integrationIdentifierRequiredstring

Integration identifier

connectionIdentifierstring

Identifier of the channel connection that will be created

contextobject
scopearray<string>

Slack only: OAuth scopes to request during authorization. These define the permissions your Slack integration will have. If not specified, default scopes will be used: chat:write, chat:write.public, channels:read, groups:read, users:read, users:read.email. MS Teams: This parameter is ignored. MS Teams uses admin consent with pre-configured permissions in Azure AD. Note: The generated OAuth URL expires after 5 minutes.

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

Created

urlRequiredstring

The OAuth authorization URL for the chat provider. For Slack: https://slack.com/oauth/v2/authorize?... For MS Teams: https://login.microsoftonline.com/.../adminconsent?... This URL should be presented to the user to authorize the integration. Expires after 5 minutes.

export interface Response {
  /**
   * The OAuth authorization URL for the chat provider. For Slack: https://slack.com/oauth/v2/authorize?... For MS Teams: https://login.microsoftonline.com/.../adminconsent?... This URL should be presented to the user to authorize the integration. Expires after 5 minutes.
   */
  url: string;
}
 
curl -X POST "https://api.novu.co/v1/integrations/chat/oauth" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "subscriberId": "subscriber-123",
    "integrationIdentifier": "string",
    "connectionIdentifier": "string",
    "context": {
      "property1": "org-acme",
      "property2": "org-acme"
    },
    "scope": [
      "chat:write",
      "chat:write.public",
      "channels:read",
      "groups:read",
      "users:read",
      "users:read.email",
      "incoming-webhook"
    ]
  }'
{
  "url": "https://slack.com/oauth/v2/authorize?state=..."
}

On this page

No Headings
Edit this page on GitHub