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 brand = await client.brands.update('brand_id', { name: 'name' });
console.log(brand.id);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
brand = client.brands.update(
brand_id="brand_id",
name="name",
)
print(brand.id)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
brand, err := client.Brands.Update(
context.TODO(),
"brand_id",
courier.BrandUpdateParams{
Name: "name",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", brand.ID)
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.brands.Brand;
import com.courier.models.brands.BrandUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
BrandUpdateParams params = BrandUpdateParams.builder()
.brandId("brand_id")
.name("name")
.build();
Brand brand = client.brands().update(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
brand = courier.brands.update("brand_id", name: "name")
puts(brand)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Courier\Client;
use Courier\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');
try {
$brand = $client->brands->update(
'brand_id',
name: 'name',
settings: [
'colors' => ['primary' => 'primary', 'secondary' => 'secondary'],
'email' => [
'footer' => ['content' => 'content', 'inheritDefault' => true],
'head' => ['inheritDefault' => true, 'content' => 'content'],
'header' => [
'logo' => ['href' => 'href', 'image' => 'image'],
'barColor' => 'barColor',
'inheritDefault' => true,
],
'templateOverride' => [
'enabled' => true,
'backgroundColor' => 'backgroundColor',
'blocksBackgroundColor' => 'blocksBackgroundColor',
'footer' => 'footer',
'head' => 'head',
'header' => 'header',
'width' => 'width',
'mjml' => [
'enabled' => true,
'backgroundColor' => 'backgroundColor',
'blocksBackgroundColor' => 'blocksBackgroundColor',
'footer' => 'footer',
'head' => 'head',
'header' => 'header',
'width' => 'width',
],
'footerBackgroundColor' => 'footerBackgroundColor',
'footerFullWidth' => true,
],
],
'inapp' => [
'colors' => ['primary' => 'primary', 'secondary' => 'secondary'],
'icons' => ['bell' => 'bell', 'message' => 'message'],
'widgetBackground' => [
'bottomColor' => 'bottomColor', 'topColor' => 'topColor'
],
'borderRadius' => 'borderRadius',
'disableMessageIcon' => true,
'fontFamily' => 'fontFamily',
'placement' => 'top',
],
],
snippets: ['items' => [['name' => 'name', 'value' => 'value']]],
);
var_dump($brand);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Brands;
CourierClient client = new();
BrandUpdateParams parameters = new()
{
BrandID = "brand_id",
Name = "name",
};
var brand = await client.Brands.Update(parameters);
Console.WriteLine(brand);courier brands update \
--api-key 'My API Key' \
--brand-id brand_id \
--name namecurl --request PUT \
--url https://api.courier.com/brands/{brand_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"settings": {
"colors": {
"primary": "<string>",
"secondary": "<string>"
},
"email": {
"templateOverride": {
"enabled": true,
"mjml": {
"enabled": true,
"backgroundColor": "<string>",
"blocksBackgroundColor": "<string>",
"footer": "<string>",
"head": "<string>",
"header": "<string>",
"width": "<string>"
},
"backgroundColor": "<string>",
"blocksBackgroundColor": "<string>",
"footer": "<string>",
"head": "<string>",
"header": "<string>",
"width": "<string>",
"footerBackgroundColor": "<string>",
"footerFullWidth": true
},
"head": {
"inheritDefault": true,
"content": "<string>"
},
"footer": {
"content": "<string>",
"inheritDefault": true
},
"header": {
"logo": {
"href": "<string>",
"image": "<string>"
},
"inheritDefault": true,
"barColor": "<string>"
}
},
"inapp": {
"widgetBackground": {
"topColor": "<string>",
"bottomColor": "<string>"
},
"colors": {
"primary": "<string>",
"secondary": "<string>"
},
"icons": {
"bell": "<string>",
"message": "<string>"
},
"borderRadius": "<string>",
"disableMessageIcon": true,
"fontFamily": "<string>"
}
},
"snippets": {
"items": [
{
"name": "<string>",
"value": "<string>"
}
]
}
}
'{
"id": "bnd_01kx4mrd0pfzw8wt7pn7p2fzag",
"name": "Default Brand",
"published": 1,
"created": 1,
"updated": 1,
"settings": {
"colors": {
"primary": "string",
"secondary": "string"
},
"email": {
"templateOverride": {
"backgroundColor": "string",
"blocksBackgroundColor": "string",
"enabled": true,
"footer": "string",
"head": "string",
"header": "string",
"width": "string",
"mjml": {
"backgroundColor": "string",
"blocksBackgroundColor": "string",
"enabled": true,
"footer": "string",
"head": "string",
"header": "string",
"width": "string"
},
"footerBackgroundColor": "string",
"footerFullWidth": true
},
"head": {
"inheritDefault": true,
"content": "string"
},
"footer": {
"content": "string",
"inheritDefault": true
},
"header": {
"inheritDefault": true,
"barColor": "string",
"logo": {
"href": "https://example.com",
"image": "string"
}
}
},
"inapp": {
"borderRadius": "string",
"disableMessageIcon": true,
"fontFamily": "string",
"placement": "top",
"widgetBackground": {
"topColor": "string",
"bottomColor": "string"
},
"colors": {
"primary": "string",
"secondary": "string"
},
"icons": {
"bell": "string",
"message": "Example message text"
}
}
},
"snippets": {
"items": [
{
"name": "Default Brand",
"value": "string"
}
]
},
"version": "string"
}Brands
Replace a brand
Replace an existing brand with the supplied values.
PUT
/
brands
/
{brand_id}
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 brand = await client.brands.update('brand_id', { name: 'name' });
console.log(brand.id);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
brand = client.brands.update(
brand_id="brand_id",
name="name",
)
print(brand.id)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
brand, err := client.Brands.Update(
context.TODO(),
"brand_id",
courier.BrandUpdateParams{
Name: "name",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", brand.ID)
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.brands.Brand;
import com.courier.models.brands.BrandUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
BrandUpdateParams params = BrandUpdateParams.builder()
.brandId("brand_id")
.name("name")
.build();
Brand brand = client.brands().update(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
brand = courier.brands.update("brand_id", name: "name")
puts(brand)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Courier\Client;
use Courier\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');
try {
$brand = $client->brands->update(
'brand_id',
name: 'name',
settings: [
'colors' => ['primary' => 'primary', 'secondary' => 'secondary'],
'email' => [
'footer' => ['content' => 'content', 'inheritDefault' => true],
'head' => ['inheritDefault' => true, 'content' => 'content'],
'header' => [
'logo' => ['href' => 'href', 'image' => 'image'],
'barColor' => 'barColor',
'inheritDefault' => true,
],
'templateOverride' => [
'enabled' => true,
'backgroundColor' => 'backgroundColor',
'blocksBackgroundColor' => 'blocksBackgroundColor',
'footer' => 'footer',
'head' => 'head',
'header' => 'header',
'width' => 'width',
'mjml' => [
'enabled' => true,
'backgroundColor' => 'backgroundColor',
'blocksBackgroundColor' => 'blocksBackgroundColor',
'footer' => 'footer',
'head' => 'head',
'header' => 'header',
'width' => 'width',
],
'footerBackgroundColor' => 'footerBackgroundColor',
'footerFullWidth' => true,
],
],
'inapp' => [
'colors' => ['primary' => 'primary', 'secondary' => 'secondary'],
'icons' => ['bell' => 'bell', 'message' => 'message'],
'widgetBackground' => [
'bottomColor' => 'bottomColor', 'topColor' => 'topColor'
],
'borderRadius' => 'borderRadius',
'disableMessageIcon' => true,
'fontFamily' => 'fontFamily',
'placement' => 'top',
],
],
snippets: ['items' => [['name' => 'name', 'value' => 'value']]],
);
var_dump($brand);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Brands;
CourierClient client = new();
BrandUpdateParams parameters = new()
{
BrandID = "brand_id",
Name = "name",
};
var brand = await client.Brands.Update(parameters);
Console.WriteLine(brand);courier brands update \
--api-key 'My API Key' \
--brand-id brand_id \
--name namecurl --request PUT \
--url https://api.courier.com/brands/{brand_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"settings": {
"colors": {
"primary": "<string>",
"secondary": "<string>"
},
"email": {
"templateOverride": {
"enabled": true,
"mjml": {
"enabled": true,
"backgroundColor": "<string>",
"blocksBackgroundColor": "<string>",
"footer": "<string>",
"head": "<string>",
"header": "<string>",
"width": "<string>"
},
"backgroundColor": "<string>",
"blocksBackgroundColor": "<string>",
"footer": "<string>",
"head": "<string>",
"header": "<string>",
"width": "<string>",
"footerBackgroundColor": "<string>",
"footerFullWidth": true
},
"head": {
"inheritDefault": true,
"content": "<string>"
},
"footer": {
"content": "<string>",
"inheritDefault": true
},
"header": {
"logo": {
"href": "<string>",
"image": "<string>"
},
"inheritDefault": true,
"barColor": "<string>"
}
},
"inapp": {
"widgetBackground": {
"topColor": "<string>",
"bottomColor": "<string>"
},
"colors": {
"primary": "<string>",
"secondary": "<string>"
},
"icons": {
"bell": "<string>",
"message": "<string>"
},
"borderRadius": "<string>",
"disableMessageIcon": true,
"fontFamily": "<string>"
}
},
"snippets": {
"items": [
{
"name": "<string>",
"value": "<string>"
}
]
}
}
'{
"id": "bnd_01kx4mrd0pfzw8wt7pn7p2fzag",
"name": "Default Brand",
"published": 1,
"created": 1,
"updated": 1,
"settings": {
"colors": {
"primary": "string",
"secondary": "string"
},
"email": {
"templateOverride": {
"backgroundColor": "string",
"blocksBackgroundColor": "string",
"enabled": true,
"footer": "string",
"head": "string",
"header": "string",
"width": "string",
"mjml": {
"backgroundColor": "string",
"blocksBackgroundColor": "string",
"enabled": true,
"footer": "string",
"head": "string",
"header": "string",
"width": "string"
},
"footerBackgroundColor": "string",
"footerFullWidth": true
},
"head": {
"inheritDefault": true,
"content": "string"
},
"footer": {
"content": "string",
"inheritDefault": true
},
"header": {
"inheritDefault": true,
"barColor": "string",
"logo": {
"href": "https://example.com",
"image": "string"
}
}
},
"inapp": {
"borderRadius": "string",
"disableMessageIcon": true,
"fontFamily": "string",
"placement": "top",
"widgetBackground": {
"topColor": "string",
"bottomColor": "string"
},
"colors": {
"primary": "string",
"secondary": "string"
},
"icons": {
"bell": "string",
"message": "Example message text"
}
}
},
"snippets": {
"items": [
{
"name": "Default Brand",
"value": "string"
}
]
},
"version": "string"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
A unique identifier associated with the brand you wish to update.
Body
application/json
⌘I