---
title: "Patch an API key"
method: PATCH
path: "/api_keys/edit"
tags: ["API KEYS"]
---

# Patch an API key

`PATCH /api_keys/edit`

Patch an existing API key ignoring missing properties

## Request body

- object
  - `id` string, required — The ID of the existing API key you wish to edit.
  - `description` string — A comment or description of your new API key
  - `custom_ratelimit` boolean — 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_value` integer — 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_period` string — 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_pool` integer — 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_enabled` boolean — If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings.
  - `feedback_html` string — 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_text` string — 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_enabled` boolean — If true, open tracking will be enabled for this API key.
  - `click_tracking_enabled` boolean — If true, click tracking will be enabled for this API key.
  - `archive_enabled` boolean — If true, archiving (available on paid plans) will be enabled for this API key.
  - `audit_email` string — If passed, this email will be BCC'd on all emails sent by this API key.
  - `bounce_notifications` string — 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.
  - `status` string — The initial status of the API key, one of ['allowed', 'blocked', 'sandbox'].
  - `endpoints` string[] — 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/&ast;"]</code>.<br /><br />To allow access to every endpoint simply pass <code>"endpoints": ["&ast;"]</code>
  - `subaccount_id` string — If you wish to make this API call on behalf of a subaccount then include its unique ID here.

## Response `200`

Successfully patched API key

- object
  - `data` object[], required — An array of API key results
    - `request_id` string, required
    - `data` object, required
      - `api_key` string — The API key used to query the API (masked)
      - `username` string — A shortened version of the API key which can be used to correlate data with some other API calls that also feature <code>username</code>.
      - `description` string — A comment or description of the API key.
      - `custom_rate_limit` boolean — If enabled will use the values of <code>custom_ratelimit_value</code> and <code>custom_ratelimit_period</code> for rate limiting.
      - `custom_ratelimit_value` integer — If passed, defines the limit of emails this API key can send in the period specified in <code>custom_ratelimit_period</code>.
      - `custom_ratelimit_period` string — 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.
      - `default_ratelimit_value` string — The default limit of emails this API key can send in the period specified in <code>default_ratelimit_period</code>. <strong>Note:</strong> Used if <code>custom_ratelimit</code> is false.
      - `default_ratelimit_period` string — The default period for which this API key will be limited to the number of emails specified in <code>default_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> Used if <code>custom_ratelimit</code> is false.
      - `ippool` integer
      - `feedback_enabled` boolean — If true, custom feedback via the unsubscribe footer will be enabled and defined by the below settings.
      - `feedback_html` string — The HTML content to insert into the custom feedback email body via the unsubscribe footer. Default: blank <br><br><strong>System Variables (Only available here):</strong><ul><li>Unsubscribe URL = %%UNSUBSCRIBE%% </li><li>Email address = %%EMAIL%%</li></ul>
      - `feedback_text` string — The text content to insert into the custom feedback email body via the unsubscribe footer. Default: blank<br><br><strong>System Variables (Only available here):</strong><ul><li>Unsubscribe URL = %%UNSUBSCRIBE%% </li><li>Email address = %%EMAIL%%</li></ul>
      - `open_tracking_enabled` boolean — If true, open tracking will be enabled for this API key.
      - `click_tracking_enabled` boolean — If true, click tracking will be enabled for this API key.
      - `archive_enabled` boolean — If true, archiving (available on paid plans) will be enabled for this API key.
      - `audit_email` string — If passed, this email will be BCC'd on all emails sent by this API key.
      - `bounce_notifications` string — 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.
      - `status` string — The initial status of the API key, one of ['allowed', 'blocked', 'sandbox'].
      - `endpoints` unknown[] — An array of endpoints that this API key will be allowed to use.
        - unknown
  - `request_id` string, required

## Other responses

- `400` — 400

---

[API](https://skmtc.net/smtp2go/apis/smtp2go-api-v3-0-4.md) · [All operations](https://skmtc.net/smtp2go/apis/smtp2go-api-v3-0-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smtp2go/smtp2go-api-v3-0-4/revisions/1ba6b25eebb9/schema)
