Loading...
Skip to main content

Create or Replace a Tenant

URL: https://api.courier.com/tenants/:tenant_id

Method: PUT

Path Parameters:

tenant_idstringrequired

Id of the tenant to be returned.

Body:

namestringrequired
Name of the tenant.
parent_tenant_idstring
Tenant's parent id (if any).
default_preferencesobject
Defines the preferences used for the tenant when the user hasn't specified their own.
+ Show fields
propertiesobject
Arbitrary properties accessible to a template.
user_profileobject
A user profile object merged with user profile on send.
brand_idstring
Brand to be used for the account when one is not specified by the send call.

Response Body

A copy of the created account.

idstring
Id of the tenant.
namestring
Name of the tenant.
parent_tenant_idstring?
Tenant's parent id (if any).
default_preferencesobject?
Defines the preferences used for the account when the user hasn't specified their own.
propertiesobject?
Arbitrary properties accessible to a template.
user_profileobject?
A user profile object merged with user profile on send.
brand_idstring
Brand to be used for the account when one is not specified by the send call.

Example:

// PUT https://api.courier.com/tenants/ACME

// BODY
{
name: "ACME Inc",
brand_id: "acme_brand",
properties: {
ceo: "Person",
},
default_preferences: {
items: [{
id: "my-topic",
status: "OPTED_IN"
}]
},
user_profile: {
locale: "en-US",
"slack": {
"access_token": "xoxb-bunch-o-letters",
}
}
}

// Response Body
{
id: "ACME",
name: "ACME Inc",
brand_id: "acme_brand",
properties: {
ceo: "Person",
},
default_preferences: {
items: [{
id: "my-topic",
status: "OPTED_IN",
type: "subscription_topic"
}]
},
user_profile: {
locale: "en-US",
"slack": {
"access_token": "xoxb-bunch-o-letters",
}
}
}