Skip to content

Reference

SendGrid

Connect SendGrid to Alter Vault for secure API access

Use SendGrid credentials to make authenticated API calls through Alter Vault without exposing API keys in code.

PropertyValue
Provider IDsendgrid
CategoryCommunication
Credential TypeBearer Token

Log in to the SendGrid Dashboard

Log in to the SendGrid Dashboard at app.sendgrid.com.

Go to Settings → API Keys

Go to Settings → API Keys at app.sendgrid.com/settings/api_keys.

Create an API Key

Click ‘Create API Key’ and set permissions.

Copy your API key

Copy the generated API key (it won’t be shown again).

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add SendGrid

Go to Managed Secrets > Add Provider > SendGrid.

Enter credentials

Paste your API Key into the credential field.

Save

Click Save. You’ll receive a grant_id to use with the SDK.

response = await alter_app.request(
HttpMethod.POST,
"https://api.sendgrid.com/v3/mail/send",
grant_id="YOUR_GRANT_ID",
json={
"personalizations": [{"to": [{"email": "recipient@example.com"}]}],
"from": {"email": "sender@YOUR_VERIFIED_DOMAIN"},
"subject": "Hello",
"content": [{"type": "text/plain", "value": "Hello from Alter"}],
},
)

Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.

Operation IDFamiliesMethodProvider path
POST_mail-batchsendPOST/mail/batch
POST_mail-sendsendPOST/mail/send
POST_validations-emailsendPOST/validations/email
POST_whitelabel-dns-emailsendPOST/whitelabel/dns/email
PUT_user-emailadmin, sendPUT/user/email
DELETE-designdeleteDELETE/designs/{id}
DELETE_access_settings-whitelist-rule_idadmin, deleteDELETE/access_settings/whitelist/{rule_id}
DELETE_alerts-alert_iddeleteDELETE/alerts/{alert_id}
DELETE_api_keys-api_key_idadmin, deleteDELETE/api_keys/{api_key_id}
DELETE_asm-groups-group_idadmin, deleteDELETE/asm/groups/{group_id}
DELETE_asm-groups-group_id-suppressions-emailadmin, deleteDELETE/asm/groups/{group_id}/suppressions/{email}
DELETE_asm-suppressions-global-emaildeleteDELETE/asm/suppressions/global/{email}
DELETE_campaigns-campaign_iddeleteDELETE/campaigns/{campaign_id}
DELETE_campaigns-campaign_id-schedulesdeleteDELETE/campaigns/{campaign_id}/schedules
DELETE_contactdb-custom_fields-custom_field_iddeleteDELETE/contactdb/custom_fields/{custom_field_id}
DELETE_contactdb-lists-list_iddeleteDELETE/contactdb/lists/{list_id}
DELETE_contactdb-lists-list_id-recipients-recipient_iddeleteDELETE/contactdb/lists/{list_id}/recipients/{recipient_id}
DELETE_contactdb-recipients-recipient_iddeleteDELETE/contactdb/recipients/{recipient_id}
DELETE_contactdb-segments-segment_iddeleteDELETE/contactdb/segments/{segment_id}
DELETE_ips-pools-pool_namedeleteDELETE/ips/pools/{pool_name}
DELETE_ips-pools-pool_name-ips-ipdeleteDELETE/ips/pools/{pool_name}/ips/{ip}
PATCH_mail_settings-address_whitelistadmin, writePATCH/mail_settings/address_whitelist
PATCH_mail_settings-footeradmin, writePATCH/mail_settings/footer
PATCH_mail_settings-forward_bounceadmin, writePATCH/mail_settings/forward_bounce
PATCH_user-scheduled_sends-batch_idadmin, writePATCH/user/scheduled_sends/{batch_id}
POST_v3-teammates-pending-token-resendadmin, writePOST/teammates/pending/{token}/resend
PATCH_contactdb-lists-list_idwritePATCH/contactdb/lists/{list_id}
PATCH_contactdb-segments-segment_idwritePATCH/contactdb/segments/{segment_id}
PATCH_marketing-singlesends-idwritePATCH/marketing/singlesends/{id}
PATCH_v3-senders-sender_idwritePATCH/senders/{sender_id}
PATCH_verified_senders-idwritePATCH/verified_senders/{id}
POST-sendgrid-pre-built-designwritePOST/designs/pre-builts/{id}
POST_contactdb-lists-list_id-recipientswritePOST/contactdb/lists/{list_id}/recipients
POST_contactdb-lists-list_id-recipients-recipient_idwritePOST/contactdb/lists/{list_id}/recipients/{recipient_id}
GET-sendgrid-pre-built-designreadGET/designs/pre-builts/{id}
GET-v3-messages-msg_idreadGET/messages/{msg_id}
GET_asm-suppressions-emailreadGET/asm/suppressions/{email}
GET_asm-suppressions-global-emailreadGET/asm/suppressions/global/{email}
GET_contactdb-custom_fields-custom_field_idreadGET/contactdb/custom_fields/{custom_field_id}
GET_contactdb-lists-list_idreadGET/contactdb/lists/{list_id}

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.