Account

This endpoint lets you retreive information regarding your SparkPost account and set account options.

Using Postman

If you use Postman you can click the following button to import the SparkPost API as a collection:

Run in Postman

Account Properties

Property Type Description
company_name string Account holder company name
country_code string Account holder 2-letter country code
anniversary_date string ISO date of billing anniversary
created string ISO date account was created
updated string ISO date account details were last updated
status string Account status. Possible values: active, suspended, terminated
status_updated string ISO date status was last updated
status_reason_category string Category for some account statuses, e.g. ‘NONPAYMENT’. Empty string by default
service_level string Account service level. Possible values: priority, standard, premium, enterprise, regulated
subscription object Current subscription details. See Subscription Properties
pending_subscription object Pending subscription details representing an upgrade or downgrade.
options object Account-level tracking settings. See Options Properties
usage object Account quota usage details. Specify ‘include=usage’ in query string to include usage info. See Usage Properties
support object Support entitlement details. See Support Properties

Subscription Properties

Property Type Description
code string The account’s plan code
name string The account’s plan name
effective_date string ISO date of when this subscription has been or will be effective
self_serve boolean true if the subscription is managed through the UI
type string Type of subscription. Values include aws and manual.

Options Properties

Property Type Description
smtp_tracking_default boolean Account-level default for SMTP engagement tracking
rest_tracking_default boolean Account-level default for REST API engagement tracking
transactional_unsub boolean Set to true to include List-Unsubscribe header for all transactional messages by default
transactional_default boolean Set to true to send messages as transactional by default
initial_open_pixel_tracking boolean Account-level default for Initial Open tracking
click_tracking boolean Set to false to turn off click tracking (overrides smtp_tracking_default and rest_tracking_default)

Usage Properties

Property Type Description
timestamp string ISO date usage data was retrieved
day object Daily usage report. See Daily/Monthly Usage Properties
month object Monthly usage report. See Daily/Monthly Usage Properties

Daily/Monthly Usage Properties

Property Type Description
used number Total messages sent in this period
limit number Total allowance for this period
start string ISO date when this period started
end string ISO date when this period ends

Support Properties

Property Type Description
phone boolean Whether account is entitled to phone support
online boolean Whether account is entitled to online support

Get Account

Retrieve account information

GET/api/v1/account{?include}
URI Parameters
include

Additional parts of account details to include. The only valid value is currently usage.

Example: usage

Examples

Request

GET /api/v1/account?include=usage

Response (HTTP status code: 200)

{
  "results": {
    "company_name": "Example Inc",
    "country_code": "US",
    "anniversary_date": "2017-01-11T08:00:00.000Z",
    "created": "2017-01-11T08:00:00.000Z",
    "updated": "2017-02-11T08:00:00.000Z",
    "status": "active",
    "status_updated": "2018-12-21T13:21:41.442Z",
    "status_reason_category": "",
    "subscription": {
      "code": "150K-0817",
      "name": "150K",
      "plan_volume": 150000,
      "self_serve": "true",
      "type": "manual"
    },
    "support": {
      "online": true,
      "phone": false
    },
    "pending_subscription": {
      "code": "2.5M-0817",
      "name": "2.5M",
      "effective_date": "2017-04-11T00:00:00.000Z"
    },
    "options": {
      "smtp_tracking_default": false
    },
    "usage": {
      "timestamp": "2016-03-17T05:19:00.932Z",
      "day": {
        "used": 22003,
        "limit": 50000,
        "start": "2016-03-16T05:30:00.932Z",
        "end": "2016-03-17T05:30:00.932Z"
      },
      "month": {
        "used": 122596,
        "limit": 1500000,
        "start": "2018-03-11T08:00:00.000Z",
        "end": "2016-04-11T08:00:00.000Z"
      }
    }
  }
}

Update

Update account information

PUT/api/v1/account

Update your SparkPost account information and account-level options.

Request Body Attributes

Field Type Required Description
company_name string no Company name
options object no Account-level options.

Options Properties

Property Type Description
smtp_tracking_default boolean Set to true to turn on SMTP engagement tracking by default
rest_tracking_default boolean Set to false to turn off REST API engagement tracking by default
transactional_unsub boolean Set to true to include List-Unsubscribe header for all transactional messages by default
transactional_default boolean Set to true to send messages as transactional by default
initial_open_pixel_tracking boolean Set to false to exclude the initial open tracking pixel from top of emails
click_tracking boolean Set to false to turn off click tracking (overrides smtp_tracking_default and rest_tracking_default)

Examples

Request

PUT /api/v1/account

{
  "company_name": "SparkPost",
  "options": {
    "smtp_tracking_default": true
  }
}

Response (HTTP status code: 200)

{
  "results": {
    "message": "Account has been updated"
  }
}

Response (HTTP status code: 400)

{
  "errors": [
    {
      "message": "Incorrect type, expected boolean",
      "param": "smtp_tracking_default",
      "value": "bad value"
    }
  ]
}

Response (HTTP status code: 500)

{
  "errors": [
    {
      "message": "Cannot update Account"
    }
  ]
}