API Keys
Your application, mail client, or website can all use API (Application Programming Interface) keys to authenticate access to SendGrid services. You can revoke an API key at any time without having to change your username and password, and an API key can be scoped to perform a limited number of actions.
There are 3 different types of API keys:
- Full Access
Allows the API key to accessGET
,PATCH
,PUT
,DELETE
andPOST
endpoints for all parts of your account, excluding billing and Email Address Validation. - Restricted Access
Customizes levels of access for all parts of your account, excluding billing and Email Address Validation. - Billing Access
Allows the API key to access billing endpoints for the account.
You must create your first API key using the Twilio SendGrid App. Once you have a key with permissions to manage other keys, you can use the endpoints documented as part of this API.
Update API key name
Twilio SendGrid API keys are 69 characters long. We are unable to make exceptions for third-party infrastructure that is unable to support a key of 69 characters.
PATCH /v3/api_keys/{api_key_id}
Base url: https://api.sendgrid.com
This endpoint allows you to update the name of an existing API Key.
You must pass this endpoint a JSON request body with a name
property, which will be used to rename the key associated with the api_key_id
passed in the URL.
Authentication
- API Key
Headers
Request Body
The new name of the API Key.
{
"name": "A New Hope"
}
Path Parameters
Responses
The ID of your API Key.
The name of your API Key.
{
"api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA",
"name": "Mail Send"
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
Need some help?
We all do sometimes. Get help now from the Twilio SendGrid Support Team.
Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.