provider API Keys POST
/api_keys @utdk/sendgrid
/api_keys Create API keys
**This endpoint allows you to create a new API Key for the user.**
To create your initial SendGrid API Key, you should [use the SendGrid App](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
> There is a limit of 100 API Keys on your account.
A JSON request body containing a `name` property is required when making requests to this endpoint. If the number of maximum keys, 100, is reached, a `403` status will be returned.
Though the `name` field is required, it does not need to be unique. A unique API key ID will be generated for each key you create and returned in the response body.
It is not necessary to pass a `scopes` field to the API when creating a key, but you should be aware that omitting the `scopes` field from your request will create a key with "Full Access" permissions by default.
See the [API Key Permissions List](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization) for all available scopes. An API key's scopes can be updated after creation using the "Update API keys" endpoint.
- on-behalf-of header
- string
Try it
Authentication
Configure credentials for Email Activity (beta)
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import sendgrid from '@utdk/sendgrid';
await sendgrid.createApiKeys({
"on-behalf-of": "The subuser's username. This header generates the API call as if the subuser account was making the call."
})