Email Messages

Retrieve a list of email messages

Retrieve a list of email messages.

Request
Security:
query Parameters
limit
integer [ 0 .. 1000 ]

The collection items limit.

offset
integer >= 0

The collection items offset.

q
string

The partial search of the text fields.

sort
Array of strings

The collection items sort field and order (prefix with "-" for descending sort).

filter
string

The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200

A list of email messages was retrieved successfully.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

get/email-messages
Request samples
curl -i -X GET \
  'https://api-sandbox.rebilly.com/organizations/unknown/email-messages?limit=1000&offset=0&q=string&sort=string&filter=string' \
  -H 'Organization-Id: 4f6cf35x-2c4y-483z-a0a9-158621f77a21' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
[
  • {
    }
]

Create an email message

Create an email message.

Request
Security:
header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Email message resource.

status
string
Default: "draft"

The email message's status.

Enum: "draft" "outbox" "sending" "sent" "failed"
object

The email message's metadata.

property name*
string
credentialHash
string

SMTP or any Email Service Provider credential identifier string.

from
required
string <email> <= 254 characters

The email message's sender address.

to
required
Array of strings <email> non-empty

The email message's recipients address list.

cc
Array of strings <email>

The email message's CC address list.

bcc
Array of strings <email>

The email message's BCC address list.

subject
required
string <= 998 characters

The email message's subject.

text
required
string

The email message's text body.

html
required
string

The email message's html body.

Array of objects

The email message's attachemnts.

Array
resourceType
required
string

The attachment's resource type.

resourceId
required
string <= 50 characters

The attachment's resource identifier string.

Responses
201

Email message was created.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

422

Invalid data was sent.

post/email-messages
Request samples
application/json
{
  • "status": "draft",
  • "metadata": {
    },
  • "credentialHash": "b120c2ca-6c2b-4690-9dff-3b0d87852dc7",
  • "from": "from-example@rebilly.com",
  • "to": [
    ],
  • "cc": [
    ],
  • "bcc": [
    ],
  • "subject": "Welcome dear customer!",
  • "text": "Email message text body",
  • "html": "<p>Email message html body</p>",
  • "attachments": [
    ]
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "draft",
  • "metadata": {
    },
  • "credentialHash": "b120c2ca-6c2b-4690-9dff-3b0d87852dc7",
  • "from": "from-example@rebilly.com",
  • "to": [
    ],
  • "cc": [
    ],
  • "bcc": [
    ],
  • "subject": "Welcome dear customer!",
  • "text": "Email message text body",
  • "html": "<p>Email message html body</p>",
  • "attachments": [
    ],
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}

Retrieve an email message

Retrieve an email message.

Request
Security:
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200

Email message with specified identifier was retrieved successfully.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

get/email-messages/{id}
Request samples
curl -i -X GET \
  https://api-sandbox.rebilly.com/organizations/unknown/email-messages/:id \
  -H 'Organization-Id: 4f6cf35x-2c4y-483z-a0a9-158621f77a21' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "draft",
  • "metadata": {
    },
  • "credentialHash": "b120c2ca-6c2b-4690-9dff-3b0d87852dc7",
  • "from": "from-example@rebilly.com",
  • "to": [
    ],
  • "cc": [
    ],
  • "bcc": [
    ],
  • "subject": "Welcome dear customer!",
  • "text": "Email message text body",
  • "html": "<p>Email message html body</p>",
  • "attachments": [
    ],
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}

Delete an email message

Delete an email message.

Request
Security:
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
204

Email message was deleted.

409

Conflict.

delete/email-messages/{id}
Request samples
curl -i -X DELETE \
  https://api-sandbox.rebilly.com/organizations/unknown/email-messages/:id \
  -H 'Organization-Id: 4f6cf35x-2c4y-483z-a0a9-158621f77a21' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "status": 400,
  • "title": "string",
  • "detail": "string",
  • "error": "string"
}

Send an email message

Send an email message.

Request
Security:
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Email message status.

status
required
string

The email message's status.

Value: "outbox"
Responses
200

Email message was accepted.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

409

Conflict.

422

Invalid data was sent.

patch/email-messages/{id}
Request samples
application/json
{
  • "status": "outbox"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "draft",
  • "metadata": {
    },
  • "credentialHash": "b120c2ca-6c2b-4690-9dff-3b0d87852dc7",
  • "from": "from-example@rebilly.com",
  • "to": [
    ],
  • "cc": [
    ],
  • "bcc": [
    ],
  • "subject": "Welcome dear customer!",
  • "text": "Email message text body",
  • "html": "<p>Email message html body</p>",
  • "attachments": [
    ],
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}