SendGrid integration
In short
Send email and manage marketing contacts. Connect it on the Integrations page; your app then calls SendGrid through Sapilon without ever holding a Twilio credential.
Lets your app send transactional email (plain or from dynamic templates) through SendGrid, list templates, and add or search marketing contacts.
Use a restricted API key with only what the app needs.
Connecting
On the Integrations page choose Connect on SendGrid and fill in:
- Restricted API key — SendGrid → Settings → API Keys → Create API Key → Restricted access. Grant Mail Send (full), Template Engine (read), Marketing (full) if needed, and User Account (read) so Sapilon can check the key.
Sapilon checks the key with the provider before it saves it, and stores it encrypted; it is never shown again.
- Send only from a sender or domain you verified in SendGrid.
What your app can do
Only these requests are available; anything else is refused.
POST /v3/mail/sendGET /v3/templatesGET /v3/templates/*PUT /v3/marketing/contactsPOST /v3/marketing/contacts/search
How the agent uses it
Use integrations.request('sendgrid', …); paths are relative to https://api.sendgrid.com.
POST /v3/mail/send— answers 202 with no body. Example:{ method: 'POST', path: '/v3/mail/send', body: { personalizations: [{ to: [{ email: 'sara@acme.com' }] }], from: { email: 'hello@acme.com' }, subject: 'Welcome', content: [{ type: 'text/plain', value: 'Hi Sara' }] } }. With a dynamic template:template_id: 'd-123'anddynamic_template_datain the personalization, nocontent.GET /v3/templates— Example:{ method: 'GET', path: '/v3/templates', query: { generations: 'dynamic', page_size: '50' } }.GET /v3/templates/{id}— one template.PUT /v3/marketing/contacts— add or update contacts (asynchronous). Example:{ method: 'PUT', path: '/v3/marketing/contacts', body: { list_ids: ['l1'], contacts: [{ email: 'sara@acme.com', first_name: 'Sara' }] } }.POST /v3/marketing/contacts/search— Example:body: { query: "email LIKE 'sara%'" }.
More from Twilio: https://www.twilio.com/docs/sendgrid/api-reference