/message_types

Use this resource to view and create new Message Types. Message Types are a way to add metadata to Email Messages and Email Templates. The Message Type will be stored with every recipient. If the Message does not have a Message Type, the Message Template’s Message Type will be used, if it exists. A GovDelivery Communication Cloud admin can use this metadata to build Segments that contain Subscribers that received a Transactional Email with a particular Message Type.

A Message Type has two fields: code and label. The code is used as a unique identifier and the label is used as human readable description.

{
  "code": "salutations",
  "label": "Greetings and Salutations"
}
Secured By: Authentication Token
Description:

Lists your Message Types

Responses with more than 50 records will be paginated to 50 records per response, unless otherwise specified.

Headers

Name Required Type Description
X-AUTH-TOKEN * string

An authentication token provided to you by GovDelivery.

Status

Headers

Name Type Description
Link string

Appropriate pagination link relations. Can include “first”, “last”, “prev”, and “next” relations.

Example

< /message_types?page=1>; rel="first",
< /message_types?page=2>; rel="prev",
< /message_types?page=4>; rel="next",
< /message_types?page=5>; rel="last"

Body

Format: application/json

Example
[
  {
    "code": "salutations",
    "label": "Greetings and Salutations",
    "_links": {
      "self": "/message_types/21768"
    }
  }
]
Schema
Array of objects that may include:
Name Type Description
code string

The unique identifier

Example

salutations
label string

Human readable description.

Example

Greetings and Salutations
_links object

An object that defines links to related objects.

Properties

{
  "self": {
    "description": "Relative URI of the object",
    "type": "string",
    "example": "/message_types/10040"
  }
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Message_Types",
  "description": "Create a new message_type to have TMS add metadata to recipients",
  "type": "array",
  "items": {
    "title": "Message_Type",
    "type": "object",
    "properties": {
      "code": {
        "description": "The unique identifier",
        "type": "string",
        "example": "salutations"
      },
      "label": {
        "description": "Human readable description.",
        "type": "string",
        "example": "Greetings and Salutations"
      },
      "_links": {
        "title": "Relational Links",
        "description": "An object that defines links to related objects.",
        "type": "object",
        "properties": {
          "self": {
            "description": "Relative URI of the object",
            "type": "string",
            "example": "/message_types/10040"
          }
        }
      }
    }
  }
}

Body

Format: application/json

Example
{
  "error": "Invalid authentication token"
}
Secured By: Authentication Token
Description:

Create a new message_type to attach to email message recipients.

Headers

Name Required Type Description
X-AUTH-TOKEN * string

An authentication token provided to you by GovDelivery.

Body

Format: application/json

Example
{
  "code": "salutations",
  "label": "Greetings and Salutations"
}
Schema
Object that may include:
Name Required Type Description
code * string

The unique identifier

Example

salutations
label * string

Human readable description

Example

Greetings and Salutations
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "/message_types",
  "description": "Create a new message_type to attach to email message recipients.\n",
  "type": "object",
  "properties": {
    "code": {
      "description": "The unique identifier\n",
      "type": "string",
      "example": "salutations"
    },
    "label": {
      "description": "Human readable description\n",
      "type": "string",
      "example": "Greetings and Salutations"
    }
  },
  "required": [
    "code",
    "label"
  ]
}
Form Parameters
Name Required Type Description
code * string

The unique identifier

Example

salutations
label * string

Human readable description

Example

Greetings and Salutations

Status

Body

Format: application/json

Example
{
  "code": "salutations",
  "label": "Greetings and Salutations",
  "_links": {
    "self": "/message_type/21768"
  }
}
Description

Unprocessable Entity

Body

Format: application/json

Example
{
  "code": "something_else",
  "label": "Greetings and Salutations",
  "errors":{
    "code":[
      "can't be changed"
    ]
  }
}

Body

Format: application/json

Example
{
  "error": "Invalid authentication token"
}