Skip to content

SendGrid

Pre-requisites

  • Administrator

Getting your Sendgrid API Key

  1. You'll now be asked for your SendGrid API key. Navigate to https://app.sendgrid.com/settings/api_keys.

  2. Click on Create API Key. Sendgrid create api key

  3. Enter an API Key Name, select Restricted Access and Select User Account Read Access. Click Create and View. Sendgrid create api key details Sendgrid create api key details 2

  4. Copy the API Key and store it somewhere safe for entering into the Truto interface later. Sendgrid create api key

  5. Because Sendgrid doesn't have the necessary user interface to grant the teammates.read scope to the API Key, we'll have to do that using their API. So generate a similar API token that you did just now but with Full Access to modify the API Key we generated in the previous steps. Sendgrid create api key full access

  6. Then make a note of the API Key ID you generated in step 7. Sendgrid create api key id

  7. Run the following cURL command to modify the scopes of the API Key,

bash
curl --location --request PUT 'https://api.sendgrid.com/v3/api_keys/<truto_demo_api_key_id>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <full_access_api_token>' \
--data '{
    "name": "Truto Demo",
    "scopes": ["teammates.read"]
}'

In the command above, truto_demo_api_key_id is the ID of the API Key generated in step 7, full_access_api_token is the API Key with Full Access.