Turn an email type on or off

Overview

Stop or resume sending a kind of email.

Use this if you handle a notification yourself, or don't want it sent.

You'll need the type.

The type is toggled.

Prerequisites

  • A bearer token. See Authentication.
  • The account's id (company_id), with the email templates section turned on.
  • The email type, from List email types.

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

POST /api/v1/account/white-label/email-templates/toggle

Authentication

Partner or Account token

  • company_id must be inside your own account tree. A Partner token can use any account under the partner; an Account token only its own account.
  • An account outside your tree, or one that doesn't exist, is rejected with 422.
  • The email templates section must be turned on for the account's partner (email_templates_enabled in Get branding). When it's off, every email template call for that account returns 403 with The email template section is disabled for this account.
  • Types managed centrally by the platform return 403 (This template is managed centrally and cannot be edited here.).

Rate limit

This endpoint has no rate limit.

Request parameters

None.

Request body

FieldTypeRequiredDescription
company_idintegerYesThe account. Must exist and be inside your account tree.
typestringYesThe email type, from List email types.
is_enabledbooleanYestrue to send this type, false to stop sending it.

Request payload

{
  "company_id": 5994,
  "type": "review_response_reply",
  "is_enabled": false
}

Response body

The payload is inside data.

FieldTypeDescription
statusstringsuccess.
messagestringTemplate updated.

Response payload

{
  "data": {
    "status": "success",
    "message": "Template updated."
  }
}

Examples

Success payload

See Response payload.

Error payload

403 Email templates section is off

{
  "message": "The email template section is disabled for this account.",
  "status": "error",
  "errors": []
}

403 Type managed centrally

{
  "message": "This template is managed centrally and cannot be edited here.",
  "status": "error",
  "errors": []
}

422 is_enabled is missing

{
  "message": "The is enabled field is required.",
  "errors": {
    "is_enabled": [
      "The is enabled field is required."
    ]
  }
}

422 Account outside your tree

{
  "message": "The selected company id does not belong to your company hierarchy.",
  "errors": {
    "company_id": [
      "The selected company id does not belong to your company hierarchy."
    ]
  }
}
StatusMeaning
200Saved.
401The token is missing, expired or invalid.
403The email templates section is off for this account, or the type is managed centrally.
422company_id, type or is_enabled is missing or invalid, or the account is outside your tree.
500Unexpected server error.

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/account/white-label/email-templates/toggle" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"company_id": 5994, "type": "review_response_reply", "is_enabled": false}'

Did this page help you?