Teammates 7 endpoints

POST /teammates

This endpoint allows you to invite a Teammate to your account via email.

You can set a Teammate’s initial permissions using the scopes array in the request body. Teammate’s will receive a minimum set of scopes from Twilio SendGrid that are necessary for the Teammate to function.

Note: A teammate invite will expire after 7 days, but you may resend the invitation at any time to reset the expiration date.

operationId: Teammates_inviteTeammate

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema TeammatesInviteTeammateRequest
Property Type Required
email string required
scopes array required
is_admin boolean required

Responses

201
400
POST /teammates
GET /teammates/pending

This endpoint allows you to retrieve a list of all pending Teammate invitations.

Each teammate invitation is valid for 7 days. Users may resend the invitation to refresh the expiration date.

operationId: Teammates_getAllPending

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
GET /teammates/pending
DELETE /teammates/pending/{token}

This endpoint allows you to delete a pending teammate invite.

operationId: Teammates_deletePendingTeammate

Parameters

Name In Required Type Description
token path required string

The token for the invite you want to delete.

on-behalf-of header optional string

Responses

204
404
DELETE /teammates/pending/{token}
POST /teammates/pending/{token}/resend

This endpoint allows you to resend a Teammate invitation.

Teammate invitations will expire after 7 days. Resending an invitation will reset the expiration date.

operationId: Teammates_resendTeammateInvite

Parameters

Name In Required Type Description
token path required string

The token for the invite that you want to resend.

on-behalf-of header optional string

Responses

200
404
POST /teammates/pending/{token}/resend
DELETE /teammates/{username}

This endpoint allows you to delete a teammate.

Only the parent user or an admin teammate can delete another teammate.

operationId: Teammates_removeTeammate

Parameters

Name In Required Type Description
username path required string

The username of the teammate that you want to retrieve.

on-behalf-of header optional string

Responses

204
404
DELETE /teammates/{username}
GET /teammates/{username}

This endpoint allows you to retrieve a specific Teammate by username.

You can retrieve the username’s for each of your Teammates using the “Retrieve all Teammates” endpoint.

operationId: Teammates_getByUsername

Parameters

Name In Required Type Description
username path required string

The username of the teammate that you want to retrieve.

on-behalf-of header optional string

Responses

200
GET /teammates/{username}
PATCH /teammates/{username}

This endpoint allows you to update a teammate’s permissions.

To turn a teammate into an admin, the request body should contain an is_admin set to true. Otherwise, set is_admin to false and pass in all the scopes that a teammate should have.

Only the parent user or other admin teammates can update another teammate’s permissions.

Admin users can only update permissions.

operationId: Teammates_updatePermissions

Parameters

Name In Required Type Description
username path required string

The username of the teammate that you want to retrieve.

on-behalf-of header optional string

Request Body

application/json
schema TeammatesUpdatePermissionsRequest
Property Type Required
scopes array required
is_admin boolean required

Responses

200
400
404
PATCH /teammates/{username}

Transactionaltemplates 6 endpoints

GET /templates

This endpoint allows you to retrieve all transactional templates.

operationId: GET_templates

Parameters

Name In Required Type Description
generations query optional string

Comma-delimited list specifying which generations of templates to return. Options are legacy, dynamic or legacy,dynamic.

page_size query required number

The number of templates to be returned in each page of results

page_token query optional string

A token corresponding to a specific page of results, as provided by metadata

on-behalf-of header optional string

Responses

200
400
GET /templates
POST /templates

This endpoint allows you to create a transactional template.

operationId: POST_templates

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema PostTemplatesRequest
Property Type Required
name string required
generation string optional

Responses

201
POST /templates
DELETE /templates/{template_id}

This endpoint allows you to delete a transactional template.

operationId: TransactionalTemplates_deleteTemplate

Parameters

Name In Required Type Description
template_id path required string
on-behalf-of header optional string

Responses

204
DELETE /templates/{template_id}
GET /templates/{template_id}

This endpoint allows you to retrieve a single transactional template.

operationId: TransactionalTemplates_getSingleTemplate

Parameters

Name In Required Type Description
template_id path required string
on-behalf-of header optional string

Responses

200
GET /templates/{template_id}
PATCH /templates/{template_id}

This endpoint allows you to edit the name of a transactional template.

To edit the template itself, create a new transactional template version.

operationId: TransactionalTemplates_editTemplateName

Parameters

Name In Required Type Description
template_id path required string
on-behalf-of header optional string

Request Body

application/json
schema TransactionalTemplatesEditTemplateNameRequest
Property Type Required
name string optional

Responses

200
PATCH /templates/{template_id}
POST /templates/{template_id}

This endpoint allows you to duplicate a transactional template.

operationId: TransactionalTemplates_duplicateTemplate

Parameters

Name In Required Type Description
template_id path required string
on-behalf-of header optional string

Request Body

application/json
schema TransactionalTemplatesDuplicateTemplateRequest
Property Type Required
name string optional

Responses

201
POST /templates/{template_id}

Transactionaltemplatesversions 5 endpoints

POST /templates/{template_id}/versions

This endpoint allows you to create a new version of a template.

operationId: TransactionalTemplatesVersions_createNewVersion

Parameters

Name In Required Type Description
template_id path required string
on-behalf-of header optional string

Request Body

application/json
schema transactional_template_version_create
Property Type Required
name string required
active integer optional
editor string optional
subject string required
test_data string optional
html_content string optional
plain_content string optional
generate_plain_content boolean optional

Responses

201
POST /templates/{template_id}/versions
DELETE /templates/{template_id}/versions/{version_id}

This endpoint allows you to delete a transactional template version.

operationId: TransactionalTemplatesVersions_deleteTemplateVersion

Parameters

Name In Required Type Description
template_id path required string

The ID of the original template

version_id path required string

The ID of the template version

on-behalf-of header optional string

Responses

204
DELETE /templates/{template_id}/versions/{version_id}
GET /templates/{template_id}/versions/{version_id}

This endpoint allows you to retrieve a specific version of a template.

operationId: TransactionalTemplatesVersions_getSpecificVersion

Parameters

Name In Required Type Description
template_id path required string

The ID of the original template

version_id path required string

The ID of the template version

on-behalf-of header optional string

Responses

200
GET /templates/{template_id}/versions/{version_id}
PATCH /templates/{template_id}/versions/{version_id}

This endpoint allows you to edit the content of your template version.

operationId: TransactionalTemplatesVersions_editContent

Parameters

Name In Required Type Description
template_id path required string

The ID of the original template

version_id path required string

The ID of the template version

on-behalf-of header optional string

Request Body

application/json
schema transactional_template_version_create
Property Type Required
name string required
active integer optional
editor string optional
subject string required
test_data string optional
html_content string optional
plain_content string optional
generate_plain_content boolean optional

Responses

200
PATCH /templates/{template_id}/versions/{version_id}
POST /templates/{template_id}/versions/{version_id}/activate

This endpoint allows you to activate a version of one of your templates.

operationId: TransactionalTemplatesVersions_activateVersion

Parameters

Name In Required Type Description
template_id path required string

The ID of the original template

version_id path required string

The ID of the template version

on-behalf-of header optional string

Responses

200
POST /templates/{template_id}/versions/{version_id}/activate

Usersapi 9 endpoints

GET /user/account

This endpoint allows you to retrieve your user account details.

Your user’s account information includes the user’s account type and reputation.

operationId: UsersApi_getUserAccountInformation

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
GET /user/account
GET /user/credits

This endpoint allows you to retrieve the current credit balance for your account.

Each account has a credit balance, which is a base number of emails it can send before receiving per-email charges. For more information about credits and billing, see Billing and Plan details information.

operationId: UsersApi_getCreditBalance

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
GET /user/credits
GET /user/email

This endpoint allows you to retrieve the email address currently on file for your account.

operationId: UsersApi_getAccountEmailAddress

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
GET /user/email
PUT /user/email

This endpoint allows you to update the email address currently on file for your account.

operationId: UsersApi_updateEmail

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema UsersApiUpdateEmailRequest
Property Type Required
email string optional

Responses

200
PUT /user/email
PUT /user/password

This endpoint allows you to update your password.

operationId: UsersApi_updatePassword

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema UsersApiUpdatePasswordRequest
Property Type Required
new_password string required
old_password string required

Responses

200
PUT /user/password
GET /user/profile
operationId: UsersApi_getUserProfile

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
GET /user/profile
PATCH /user/profile

This endpoint allows you to update your current profile details.

Any one or more of the parameters can be updated via the PATCH /user/profile endpoint. You must include at least one when you PATCH.

operationId: UsersApi_updateUserProfile

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema user_profile
Property Type Required
zip string optional
city string optional
phone string optional
state string optional
address string optional
company string optional
country string optional
website string optional
address2 string optional
last_name string optional
first_name string optional

Responses

200
401
PATCH /user/profile
GET /user/username

This endpoint allows you to retrieve your current account username.

operationId: UsersApi_getUsername

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
GET /user/username
PUT /user/username

This endpoint allows you to update the username for your account.

operationId: UsersApi_updateUsername

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema UsersApiUpdateUsernameRequest
Property Type Required
username string optional

Responses

200
PUT /user/username

Webhooks 7 endpoints

GET /user/webhooks/event/settings

This endpoint allows you to retrieve your current event webhook settings.

If an event type is marked as true, then the event webhook will include information about that event.

SendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.

Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.

operationId: Webhooks_getEventSettings

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
GET /user/webhooks/event/settings
PATCH /user/webhooks/event/settings

This endpoint allows you to update your current event webhook settings.

If an event type is marked as true, then the event webhook will include information about that event.

SendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.

Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.

operationId: Webhooks_updateEventNotificationSettings

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema event-webhook-update-oauth-request
Property Type Required
url string required
open boolean required
click boolean required
bounce boolean required
dropped boolean required
enabled boolean required
deferred boolean required
delivered boolean required
processed boolean required
spam_report boolean required
unsubscribe boolean required
oauth_client_id string optional
oauth_token_url string optional
group_resubscribe boolean required
group_unsubscribe boolean required
oauth_client_secret string optional

Responses

200
PATCH /user/webhooks/event/settings
GET /user/webhooks/event/settings/signed

This endpoint allows you to retrieve your signed webhook’s public key.

Once you have enabled signing of the Event Webhook, you will need the public key provided to verify the signatures on requests coming from Twilio SendGrid. You can retrieve the public key from this endpoint at any time.

For more information about cryptographically signing the Event Webhook, see Getting Started with the Event Webhook Security Features.

operationId: Webhooks_getSignedWebhookPublicKey

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
GET /user/webhooks/event/settings/signed
PATCH /user/webhooks/event/settings/signed

This endpoint allows you to enable or disable signing of the Event Webhook.

This endpoint takes a single boolean request parameter, enabled. You may either enable or disable signing of the Event Webhook using this endpoint. Once enabled, you can retrieve your public key using the /webhooks/event/settings/signed endpoint.

For more information about cryptographically signing the Event Webhook, see Getting Started with the Event Webhook Security Features.

operationId: Webhooks_enableSignedWebhook

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema WebhooksEnableSignedWebhookRequest
Property Type Required
enabled boolean required

Responses

200
400
401
500
PATCH /user/webhooks/event/settings/signed
POST /user/webhooks/event/test

This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.

SendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.

Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.

Tip: Retry logic for this endpoint differs from other endpoints, which use a rolling 24-hour retry.

If your web server does not return a 2xx response type, we will retry a POST request until we receive a 2xx response or the maximum time of 10 minutes has expired.

operationId: Webhooks_testEventNotificationSettings

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema WebhooksTestEventNotificationSettingsRequest
Property Type Required
url string optional
oauth_client_id string optional
oauth_token_url string optional
oauth_client_secret string optional

Responses

204
POST /user/webhooks/event/test
GET /user/webhooks/parse/settings

This endpoint allows you to retrieve all of your current inbound parse settings.

operationId: Webhooks_getParseSettings

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

200
401
403
404
500
GET /user/webhooks/parse/settings
GET /user/webhooks/parse/stats

This endpoint allows you to retrieve the statistics for your Parse Webhook useage.

SendGrid’s Inbound Parse Webhook allows you to parse the contents and attachments of incomming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 30MB in size, including all attachments.

There are a number of pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the Library Index.

operationId: Webhooks_getParseStats

Parameters

Name In Required Type Description
limit query optional string

The number of statistics to return on each page.

offset query optional string

The number of statistics to skip.

aggregated_by query optional string

How you would like the statistics to by grouped.

start_date query required string

The starting date of the statistics you want to retrieve. Must be in the format YYYY-MM-DD

end_date query optional string

The end date of the statistics you want to retrieve. Must be in the format YYYY-MM-DD

on-behalf-of header optional string

Responses

200
GET /user/webhooks/parse/stats