Skip to main content
POST
/
providers
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});

const provider = await client.providers.create({ provider: 'provider' });

console.log(provider.id);
{
  "id": "<string>",
  "title": "<string>",
  "provider": "<string>",
  "settings": {},
  "created": 123,
  "alias": "<string>",
  "updated": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for creating a new provider configuration.

provider
string
required

The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a known Courier provider — see the catalog endpoint for valid keys.

Maximum string length: 128
title
string

Optional display title. Omit to use "Default Configuration".

alias
string

Optional alias for this configuration.

settings
object

Provider-specific settings (snake_case keys). Defaults to an empty object when omitted. Use the catalog endpoint to discover required fields for a given provider — omitting a required field returns a 400 validation error.

Response

A configured provider in the workspace.

id
string
required

A unique identifier for the provider configuration.

title
string
required

Display title. Defaults to "Default Configuration" when not explicitly set.

provider
string
required

The provider key (e.g. "sendgrid", "twilio", "slack").

settings
object
required

Provider-specific settings (snake_case keys on the wire).

created
integer
required

Unix timestamp (ms) of when the provider was created.

alias
string

Optional alias for this configuration.

updated
integer | null

Unix timestamp (ms) of when the provider was last updated.