Skip to main content
SendGrid logo

Overview

Add SendGrid to any ModuleX agent or workflow. SendGrid transactional + marketing email integration via the SendGrid v3 REST API. Pure HTTP, no SDK dep.
Categories: Marketing & Advertising · Marketing & Email · Email · Automation · Auth: API Key · Actions: 15

Authentication

API Key Authentication

Authenticate using your SendGrid API key. Create one in Settings > API Keys.

Required Credentials

FieldDescriptionRequiredFormat
SendGrid API KeyYour SendGrid API key for API authenticationYesSG.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Available Actions

Parameters

to_email
string
required
Recipient email address
from_email
string
required
Sender email address (must be verified)
subject
string
required
Email subject line
content
string
required
Email body content (plain text or HTML)
content_type
string
Content type (‘text/plain’ or ‘text/html’) (Default: text/plain)
from_name
string
Sender display name
to_name
string
Recipient display name
reply_to_email
string
Reply-to email address
cc_emails
array
CC email addresses
bcc_emails
array
BCC email addresses

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "To"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject"
    },
    "message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Id"
    }
  },
  "required": [
    "success"
  ],
  "title": "SendEmailOutput",
  "type": "object"
}

Parameters

to_emails
array
required
List of recipient email addresses
from_email
string
required
Sender email address (must be verified)
subject
string
required
Email subject line
content
string
required
Email body content (plain text or HTML)
content_type
string
Content type (‘text/plain’ or ‘text/html’) (Default: text/plain)
from_name
string
Sender display name

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "recipient_count": {
      "default": 0,
      "title": "Recipient Count",
      "type": "integer"
    },
    "recipients": {
      "items": {
        "type": "string"
      },
      "title": "Recipients",
      "type": "array"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject"
    },
    "message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Id"
    }
  },
  "required": [
    "success"
  ],
  "title": "SendEmailMultipleRecipientsOutput",
  "type": "object"
}

Parameters

email
string
required
Contact email address
first_name
string
Contact’s first name
last_name
string
Contact’s last name
address_line_1
string
First line of address
address_line_2
string
Second line of address
city
string
Contact’s city
state_province_region
string
State, province, or region
postal_code
string
ZIP or postal code
country
string
Contact’s country
alternate_emails
array
Additional email addresses
list_ids
array
List IDs to add the contact to
custom_fields
object
Custom field values

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "job_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Job Id"
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Email"
    }
  },
  "required": [
    "success"
  ],
  "title": "AddOrUpdateContactOutput",
  "type": "object"
}

Parameters

query
string
required
SGQL query (e.g. “email LIKE ‘test%’” or “first_name=‘John’“)

Response

{
  "$defs": {
    "ContactSummary": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Email"
        },
        "first_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "First Name"
        },
        "last_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Name"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        }
      },
      "title": "ContactSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "contacts": {
      "items": {
        "$ref": "#/$defs/ContactSummary"
      },
      "title": "Contacts",
      "type": "array"
    },
    "count": {
      "default": 0,
      "title": "Count",
      "type": "integer"
    },
    "contact_count": {
      "default": 0,
      "title": "Contact Count",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "SearchContactsOutput",
  "type": "object"
}

Parameters

name
string
required
Name for the new list (max 100 characters)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Id"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "contact_count": {
      "default": 0,
      "title": "Contact Count",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "CreateContactListOutput",
  "type": "object"
}

Parameters

page_size
integer
Number of lists to return (max 1000) (Default: 100)

Response

{
  "$defs": {
    "ListSummary": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "contact_count": {
          "default": 0,
          "title": "Contact Count",
          "type": "integer"
        }
      },
      "title": "ListSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "lists": {
      "items": {
        "$ref": "#/$defs/ListSummary"
      },
      "title": "Lists",
      "type": "array"
    },
    "count": {
      "default": 0,
      "title": "Count",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetContactListsOutput",
  "type": "object"
}

Parameters

list_id
string
required
ID of the list
contact_ids
array
required
Contact IDs to remove

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "list_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "List Id"
    },
    "contacts_removed": {
      "default": 0,
      "title": "Contacts Removed",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "RemoveContactFromListOutput",
  "type": "object"
}

Parameters

contact_ids
array
Contact IDs to delete
delete_all
boolean
Delete every contact (use with caution) (Default: false)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "job_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Job Id"
    },
    "deleted_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Deleted Count"
    }
  },
  "required": [
    "success"
  ],
  "title": "DeleteContactsOutput",
  "type": "object"
}

Parameters

recipient_emails
array
required
Email addresses to suppress

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "suppressed_emails": {
      "items": {
        "type": "string"
      },
      "title": "Suppressed Emails",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "AddEmailToGlobalSuppressionOutput",
  "type": "object"
}

Parameters

email
string
required
Email address to remove

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Email"
    }
  },
  "required": [
    "success"
  ],
  "title": "DeleteGlobalSuppressionOutput",
  "type": "object"
}

Parameters

start_time
integer
Start time as Unix timestamp
end_time
integer
End time as Unix timestamp
limit
integer
Maximum number of results (Default: 100)

Response

{
  "$defs": {
    "SuppressionRow": {
      "additionalProperties": false,
      "properties": {
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Email"
        },
        "created": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Reason"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Status"
        }
      },
      "title": "SuppressionRow",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "suppressions": {
      "items": {
        "$ref": "#/$defs/SuppressionRow"
      },
      "title": "Suppressions",
      "type": "array"
    },
    "count": {
      "default": 0,
      "title": "Count",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListGlobalSuppressionsOutput",
  "type": "object"
}

Parameters

start_time
integer
Start time as Unix timestamp
end_time
integer
End time as Unix timestamp

Response

{
  "$defs": {
    "SuppressionRow": {
      "additionalProperties": false,
      "properties": {
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Email"
        },
        "created": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Reason"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Status"
        }
      },
      "title": "SuppressionRow",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "bounces": {
      "items": {
        "$ref": "#/$defs/SuppressionRow"
      },
      "title": "Bounces",
      "type": "array"
    },
    "count": {
      "default": 0,
      "title": "Count",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetAllBouncesOutput",
  "type": "object"
}

Parameters

emails
array
Email addresses to remove from bounce
delete_all
boolean
Delete every bounce (use with caution) (Default: false)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "deleted_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Deleted Count"
    }
  },
  "required": [
    "success"
  ],
  "title": "DeleteBouncesOutput",
  "type": "object"
}

Parameters

start_time
integer
Start time as Unix timestamp
end_time
integer
End time as Unix timestamp
limit
integer
Maximum number of results (Default: 100)

Response

{
  "$defs": {
    "SuppressionRow": {
      "additionalProperties": false,
      "properties": {
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Email"
        },
        "created": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Reason"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Status"
        }
      },
      "title": "SuppressionRow",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "blocks": {
      "items": {
        "$ref": "#/$defs/SuppressionRow"
      },
      "title": "Blocks",
      "type": "array"
    },
    "count": {
      "default": 0,
      "title": "Count",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListBlocksOutput",
  "type": "object"
}

Parameters

emails
array
Email addresses to remove from block
delete_all
boolean
Delete every block (use with caution) (Default: false)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "deleted_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Deleted Count"
    }
  },
  "required": [
    "success"
  ],
  "title": "DeleteBlocksOutput",
  "type": "object"
}

Limits & Quotas

  • 30s timeout on every request.
  • get_contact_lists.page_size is clamped at 1000 (SendGrid max).
  • Mutating actions wrap everything in try/except → success=False envelope (exa-style); HTTP timeouts surface as a distinct error message.

Klaviyo

AgentMail

Customer.io