v1

latestOpenAPI 3.1.02026-07-24700259.3 KB
API KEYS

Edit an API key

Edit an existing API key

post/api_keys/edit

Request body

idstring required

The ID of the existing API key you wish to edit.

descriptionstring

A comment or description of your new API key

custom_ratelimitboolean

If true, a custom rate limit will be enabled for this user, and defined by the <code>custom_ratelimit_value</code> and <code>custom_ratelimit_period</code>.

custom_ratelimit_valueinteger

If passed, defines the limit of emails this user can send in the period specified in <code>custom_ratelimit_period</code>.<br><br><strong>Note:</strong> Only stores this value if <code>custom_ratelimit</code> is true.

custom_ratelimit_periodstring

If passed, defines the period for which this user will be limited to the number of emails specified in <code>custom_ratelimit_value</code>.<br><br><strong>Syntax:</strong> "<n> [hour[s]|day[s]|week[s]|month[s]] [hh:mm:ss]".<br><br><strong>Examples: </strong> "0:30:00", "1 hour", "2 days", "3 months", "4 months 5:00:00".<br><br><strong>Note:</strong> Only stores this value if <code>custom_ratelimit</code> is true.

ip_poolinteger

If passed, any emails sent with this API key will use dedicated IP's in this IP Pool, This value can be found on the <code>/v3/dedicated_ips/view</code> endpoint.

feedback_enabledboolean

If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings.

feedback_htmlstring

The HTML content to insert into the custom feedback email body via the unsubscribe footer.<br><br><strong>System Variables (Only available here):</strong><ul><li>Unsubscribe URL = %%UNSUBSCRIBE%% </li><li>Email address = %%EMAIL%%</li></ul>

feedback_textstring

The text content to insert into the custom feedback email body via the unsubscribe footer.<br><br><strong>System Variables (Only available here):</strong><ul><li>Unsubscribe URL = %%UNSUBSCRIBE%% </li><li>Email address = %%EMAIL%%</li></ul>

open_tracking_enabledboolean

If true, open tracking will be enabled for this API key.

click_tracking_enabledboolean

If true, click tracking will be enabled for this API key.

archive_enabledboolean

If true, archiving (available on paid plans) will be enabled for this API key.

audit_emailstring

If passed, this email will be BCC'd on all emails sent by this API key.

bounce_notificationsstring

If passed, will control how bounce notifications are handled. Must be one of [from, drop, or a valid email address]. [from] will return the email to sender, [drop] will discard the event, and the inclusion of an email address will send the event on to this account.

statusstring

The initial status of the API key, one of ['allowed', 'blocked', 'sandbox'].

endpointsstring[]

An array of endpoints that this API key will be allowed to use.<br /><br />Any additional endpoints passed must be a subset of the endpoints allowed by the API key making this call.<br /><br />A full list of endpoints can be found in the app under <code>Sending->API Keys->Permissions</code> or programatically via the API <a target="blank" href="https://api.smtp2go.com/v3/api/index">here</a>.<br /><br />We also accept wildcard patterns, for example to allow access to all email endpoints you can pass <code>["/email/*"]</code>.<br /><br />To allow access to every endpoint simply pass <code>"endpoints": ["*"]</code>

subaccount_idstring

If you wish to make this API call on behalf of a subaccount then include its unique ID here.

Example request

{
  "id": "api-00000000000000000000000000000000",
  "description": "test api key",
  "custom_ratelimit_period": "0:30:00",
  "ip_pool": 1234,
  "feedback_html": "test_html",
  "feedback_text": "test_text"
}

Response

Successfully edited API key

request_idstring required

Example response

{
  "data": [
    {
      "request_id": "aa253464-0bd0-467a-b24b-6159dcd7be60",
      "data": {
        "api_key": "api-000000000000********************",
        "username": "api-000000000000",
        "custom_rate_limit": true,
        "custom_ratelimit_value": 123,
        "custom_ratelimit_period": "0:30:00",
        "default_ratelimit_period": "unlimited",
        "ippool": 1234
      }
    }
  ],
  "request_id": "4b661d88-6b2d-11eb-8bb3-f23c92bb31d2"
}