diff --git a/openapi3/issue594_test.go b/openapi3/issue594_test.go new file mode 100644 index 000000000..b36b73bbc --- /dev/null +++ b/openapi3/issue594_test.go @@ -0,0 +1,31 @@ +package openapi3_test + +import ( + "net/url" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/getkin/kin-openapi/openapi3" +) + +func TestIssue594(t *testing.T) { + uri, err := url.Parse("https://raw.githubusercontent.com/sendgrid/sendgrid-oai/c3aaa432b769faa47285166aca17c7ed2ea71787/oai_v3_stoplight.json") + require.NoError(t, err) + + sl := openapi3.NewLoader() + var doc *openapi3.T + if false { + doc, err = sl.LoadFromURI(uri) + } else { + doc, err = sl.LoadFromFile("testdata/oai_v3_stoplight.json") + } + require.NoError(t, err) + + doc.Info.Version = "1.2.3" + doc.Paths["/marketing/contacts/search/emails"].Post = nil + doc.Components.Schemas["full-segment"].Value.Example = nil + + err = doc.Validate(sl.Context) + require.NoError(t, err) +} diff --git a/openapi3/testdata/oai_v3_stoplight.json b/openapi3/testdata/oai_v3_stoplight.json new file mode 100644 index 000000000..9d871c2bb --- /dev/null +++ b/openapi3/testdata/oai_v3_stoplight.json @@ -0,0 +1,48136 @@ +{ + "components": { + "parameters": { + "trait_authorizationHeader_Authorization": { + "in": "header", + "name": "Authorization", + "required": true, + "schema": { + "default": "Bearer <>", + "type": "string" + } + }, + "trait_automationQueryParams_group_by": { + "description": "Automations can have multiple steps. Including `step_id` as a `group_by` metric allows further granularity of stats.", + "explode": false, + "in": "query", + "name": "group_by", + "schema": { + "items": { + "enum": [ + "step_id" + ], + "type": "string" + }, + "type": "array" + }, + "style": "form" + }, + "trait_automationQueryParams_step_ids": { + "description": "Comma-separated list of `step_ids` that you want the link stats for.", + "explode": false, + "in": "query", + "name": "step_ids", + "schema": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, + "style": "form" + }, + "trait_baseParams_aggregated_by": { + "description": "Dictates how the stats are time-sliced. Currently, `\"total\"` and `\"day\"` are supported.", + "in": "query", + "name": "aggregated_by", + "schema": { + "default": "total", + "enum": [ + "day", + "total" + ], + "type": "string" + } + }, + "trait_baseParams_end_date": { + "description": "Format: `YYYY-MM-DD`.If this parameter is included, the stats' end date is included in the search.", + "in": "query", + "name": "end_date", + "schema": { + "default": "2021-12-31", + "format": "date", + "type": "string" + } + }, + "trait_baseParams_start_date": { + "description": "Format: `YYYY-MM-DD`. If this parameter is included, the stats' start date is included in the search.", + "in": "query", + "name": "start_date", + "schema": { + "default": "2021-01-01", + "format": "date", + "type": "string" + } + }, + "trait_baseParams_timezone": { + "description": "[IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones) string representing the timezone in which the stats are to be presented, e.g., \"America/Chicago\".", + "in": "query", + "name": "timezone", + "schema": { + "default": "UTC", + "type": "string" + } + }, + "trait_designsQueryStrings_page_size": { + "description": "number of results to return", + "in": "query", + "name": "page_size", + "schema": { + "default": 100, + "minimum": 0, + "type": "integer" + } + }, + "trait_designsQueryStrings_page_token": { + "description": "token corresponding to a specific page of results, as provided by metadata", + "in": "query", + "name": "page_token", + "schema": { + "type": "string" + } + }, + "trait_designsQueryStrings_summary": { + "description": "set to false to return all fields", + "in": "query", + "name": "summary", + "schema": { + "default": true, + "type": "boolean" + } + }, + "trait_onBehalfOfSubuser_on-behalf-of": { + "in": "header", + "name": "on-behalf-of", + "schema": { + "default": "The subuser's username. This header generates the API call as if the subuser account was making the call.", + "type": "string" + } + }, + "trait_pagination_page_size": { + "description": "The number of elements you want returned on each page.", + "in": "query", + "name": "page_size", + "schema": { + "default": 50, + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + "trait_pagination_page_token": { + "description": "The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page.", + "in": "query", + "name": "page_token", + "schema": { + "type": "string" + } + }, + "trait_singlesendQueryParams2_ab_phase_id": { + "in": "query", + "name": "ab_phase_id", + "schema": { + "enum": [ + "test", + "send" + ], + "type": "string" + } + }, + "trait_singlesendQueryParams2_ab_variation_id": { + "in": "query", + "name": "ab_variation_id", + "schema": { + "format": "uuid", + "type": "string" + } + }, + "trait_singlesendQueryParams2_group_by": { + "description": "A/B Single Sends have multiple variation IDs and phase IDs. Including these additional fields allows further granularity of stats by these fields.", + "explode": false, + "in": "query", + "name": "group_by", + "schema": { + "items": { + "enum": [ + "ab_variation", + "ab_phase" + ], + "type": "string" + }, + "type": "array" + }, + "style": "form" + }, + "trait_singlesendQueryParams_group_by": { + "description": "A/B Single Sends have multiple variation IDs and phase IDs. Including these additional fields allows further granularity of stats by these fields.", + "explode": false, + "in": "query", + "name": "group_by", + "schema": { + "items": { + "enum": [ + "ab_variation", + "ab_phase" + ], + "type": "string" + }, + "type": "array" + }, + "style": "form" + }, + "trait_statsAdvancedQueryStringsLimitOffset_aggregated_by": { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "in": "query", + "name": "aggregated_by", + "required": false, + "schema": { + "enum": [ + "day", + "week", + "month" + ], + "type": "string" + } + }, + "trait_statsAdvancedQueryStringsLimitOffset_end_date": { + "description": "The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "type": "string" + } + }, + "trait_statsAdvancedQueryStringsLimitOffset_limit": { + "description": "The number of results to return.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "type": "integer" + } + }, + "trait_statsAdvancedQueryStringsLimitOffset_offset": { + "description": "The point in the list to begin retrieving results.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "type": "integer" + } + }, + "trait_statsAdvancedQueryStringsLimitOffset_start_date": { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "schema": { + "type": "string" + } + }, + "trait_statsAdvancedStatsBaseQueryStrings_aggregated_by": { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "in": "query", + "name": "aggregated_by", + "required": false, + "schema": { + "enum": [ + "day", + "week", + "month" + ], + "type": "string" + } + }, + "trait_statsAdvancedStatsBaseQueryStrings_end_date": { + "description": "The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "type": "string" + } + }, + "trait_statsAdvancedStatsBaseQueryStrings_start_date": { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "DELETE_contactdb-lists-list_idBody": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + } + }, + "create-integration-request": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/create-integration-request" + } + } + } + }, + "design-duplicate-input": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/design-duplicate-input" + } + } + } + }, + "monitor": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/monitor" + } + } + } + }, + "parse-setting": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/parse-setting" + } + } + } + }, + "segment_write_v2": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/segment_write_v2" + } + } + } + }, + "singlesend_request": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/singlesend_request" + } + } + } + }, + "suppressions-request": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/suppressions-request" + } + } + } + }, + "transactional_template_version_create": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/transactional_template_version_create" + } + } + } + }, + "verified-sender-request-schema": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/verified-sender-request-schema" + } + } + } + } + }, + "responses": { + "trait_apiKeysErrors_400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_apiKeysErrors_403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_apiKeysErrors_404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_cancelScheduledSendsErrors_400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "help": { + "type": "object" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "id": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "trait_errorResponse_400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_errors_400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + }, + "trait_errors_404": { + "description": "" + }, + "trait_errors_500": { + "description": "" + }, + "trait_globalErrors_401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_globalErrors_403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_globalErrors_404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_globalErrors_500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "trait_mailSendErrors_400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_mailSendErrors_413": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "trait_makoErrorResponse_400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "description": "The ID associated with the error.", + "type": "string" + }, + "field": { + "description": "The field that generated the error.", + "nullable": true, + "type": "string" + }, + "message": { + "description": "The error message.", + "type": "string" + }, + "parameter": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "trait_makoErrorResponse_401": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "description": "The ID associated with the error.", + "type": "string" + }, + "field": { + "description": "The field that generated the error.", + "nullable": true, + "type": "string" + }, + "message": { + "description": "The error message.", + "type": "string" + }, + "parameter": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "trait_makoErrorResponse_403": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "description": "The ID associated with the error.", + "type": "string" + }, + "field": { + "description": "The field that generated the error.", + "nullable": true, + "type": "string" + }, + "message": { + "description": "The error message.", + "type": "string" + }, + "parameter": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "trait_makoErrorResponse_404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "description": "The ID associated with the error.", + "type": "string" + }, + "field": { + "description": "The field that generated the error.", + "nullable": true, + "type": "string" + }, + "message": { + "description": "The error message.", + "type": "string" + }, + "parameter": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "trait_makoErrorResponse_500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "description": "The ID associated with the error.", + "type": "string" + }, + "field": { + "description": "The field that generated the error.", + "nullable": true, + "type": "string" + }, + "message": { + "description": "The error message.", + "type": "string" + }, + "parameter": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "trait_pagination_200": { + "content": { + "application/json": { + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "trait_singleSignOnErrorsTrait_400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sso-error-response" + } + } + }, + "description": "" + }, + "trait_singleSignOnErrorsTrait_401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sso-error-response" + } + } + }, + "description": "" + }, + "trait_singleSignOnErrorsTrait_403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sso-error-response" + } + } + }, + "description": "" + }, + "trait_singleSignOnErrorsTrait_429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sso-error-response" + } + } + }, + "description": "" + }, + "trait_singleSignOnErrorsTrait_500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sso-error-response" + } + } + }, + "description": "" + } + }, + "schemas": { + "TNE-senderID": { + "allOf": [ + { + "properties": { + "id": { + "description": "The unique identifier of the sender.", + "type": "integer" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/senders-id-request-body" + }, + { + "properties": { + "created_at": { + "description": "The time the sender identity was created.", + "type": "integer" + }, + "locked": { + "description": "A sender identity is locked when it is associated with a campaign in the Draft, Scheduled, or In Progress state. You can't update or delete a locked sender identity.", + "type": "boolean" + }, + "updated_at": { + "description": "The time the sender identity was last updated.", + "type": "integer" + }, + "verified": { + "description": "Only verified sender identities can be used to send email.", + "properties": { + "reason": { + "description": "The reason for a verification failure, or null if verification succeeeded or has yet to take place.", + "nullable": true, + "type": "string" + }, + "status": { + "description": "Whether the sender identity has been verified. Only verified sender identities can be used to send email.", + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + } + ], + "title": "Sender ID Response Body", + "x-stoplight": { + "id": "TNE-senderID", + "name": "Sender ID Response Body", + "public": true + } + }, + "_metadata": { + "properties": { + "count": { + "minimum": 0, + "type": "integer" + }, + "next": { + "format": "uri", + "type": "string" + }, + "prev": { + "format": "uri", + "type": "string" + }, + "self": { + "format": "uri", + "type": "string" + } + }, + "title": "_metadata", + "type": "object", + "x-stoplight": { + "id": "_metadata", + "name": "_metadata", + "public": true + } + }, + "abbv-message": { + "example": { + "clicks_count": 2, + "from_email": "from@test.com", + "last_event_time": "2017-10-13T18:56:21Z", + "msg_id": "abc123", + "opens_count": 1, + "status": "processed", + "subject": "anim Duis sint veniam", + "to_email": "test@test.com" + }, + "properties": { + "clicks_count": { + "type": "integer" + }, + "from_email": { + "type": "string" + }, + "last_event_time": { + "description": "iso 8601 format", + "type": "string" + }, + "msg_id": { + "type": "string" + }, + "opens_count": { + "type": "integer" + }, + "status": { + "enum": [ + "processed", + "delivered", + "not_delivered" + ], + "type": "string" + }, + "subject": { + "type": "string" + }, + "to_email": { + "type": "string" + } + }, + "required": [ + "from_email", + "msg_id", + "subject", + "to_email", + "status", + "opens_count", + "clicks_count", + "last_event_time" + ], + "title": "Abbv. Message", + "type": "object" + }, + "abtest_summary": { + "nullable": true, + "properties": { + "duration": { + "description": "How long the A/B Testing will last", + "type": "string" + }, + "expiration_date": { + "description": "Last day to select an A/B Test Winner", + "nullable": true, + "type": "string" + }, + "test_percentage": { + "description": "What percentage of your recipient will be included in your A/B testing", + "type": "integer" + }, + "type": { + "description": "What differs between the A/B tests", + "enum": [ + "subject", + "content" + ], + "type": "string" + }, + "winner_criteria": { + "description": "How the winner will be decided", + "enum": [ + "open", + "click", + "manual" + ], + "type": "string" + }, + "winner_selected_at": { + "description": "When the winner was selected", + "nullable": true, + "type": "string" + }, + "winning_template_id": { + "description": "Winner of the A/B Test", + "type": "string" + } + }, + "required": [ + "type", + "winner_criteria", + "test_percentage", + "duration", + "winning_template_id", + "winner_selected_at", + "expiration_date" + ], + "title": "abTest_summary", + "type": "object", + "x-stoplight": { + "id": "abtest_summary", + "name": "abTest_summary", + "public": true + } + }, + "advanced_stats_clicks": { + "description": "The individual events and their stats.", + "properties": { + "clicks": { + "description": "The number of links that were clicked in your emails.", + "type": "integer" + }, + "unique_clicks": { + "description": "The number of unique recipients who clicked links in your emails.", + "type": "integer" + } + }, + "title": "Stats: Advanced Stats with Clicks", + "type": "object", + "x-stoplight": { + "id": "advanced_stats_clicks", + "name": "Stats: Advanced Stats with Clicks", + "public": true + } + }, + "advanced_stats_clicks_opens": { + "allOf": [ + { + "$ref": "#/components/schemas/advanced_stats_clicks" + }, + { + "$ref": "#/components/schemas/advanced_stats_opens" + } + ], + "description": "The individual events and their stats.", + "title": "Stats: Advanced Stats with Clicks and Opens", + "x-stoplight": { + "id": "advanced_stats_clicks_opens", + "name": "Stats: Advanced Stats with Clicks and Opens", + "public": true + } + }, + "advanced_stats_mailbox_provider": { + "allOf": [ + { + "$ref": "#/components/schemas/advanced_stats_clicks_opens" + }, + { + "description": "The individual events and their stats.", + "properties": { + "blocks": { + "description": "The number of emails that were not allowed to be delivered by ISPs.", + "type": "integer" + }, + "bounces": { + "description": "The number of emails that bounced instead of being delivered.", + "type": "integer" + }, + "deferred": { + "description": "The number of emails that temporarily could not be delivered.", + "type": "integer" + }, + "delivered": { + "description": "The number of emails SendGrid was able to confirm were actually delivered to a recipient.", + "type": "integer" + }, + "drops": { + "description": "The number of emails that were not delivered due to the recipient email address being on a suppression list.", + "type": "integer" + }, + "processed": { + "description": "Requests from your website, application, or mail client via SMTP Relay or the Web API that SendGrid processed.", + "type": "integer" + }, + "requests": { + "description": "The number of emails that were requested to be delivered.", + "type": "integer" + }, + "spam_reports": { + "description": "The number of recipients who marked your email as spam.", + "type": "integer" + } + }, + "type": "object" + } + ], + "description": "The individual events and their stats.", + "title": "Stats: Advanced Stats for Mailbox Provider", + "x-stoplight": { + "id": "advanced_stats_mailbox_provider", + "name": "Stats: Advanced Stats for Mailbox Provider", + "public": true + } + }, + "advanced_stats_opens": { + "description": "The individual events and their stats.", + "properties": { + "opens": { + "description": "The total number of times your emails were opened by recipients.", + "type": "integer" + }, + "unique_opens": { + "description": "The number of unique recipients who opened your emails.", + "type": "integer" + } + }, + "title": "Stats: Advanced Stats with Opens", + "type": "object", + "x-stoplight": { + "id": "advanced_stats_opens", + "name": "Stats: Advanced Stats with Opens", + "public": true + } + }, + "all_segments_response": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + }, + "contacts_count": { + "description": "Total number of contacts present in the segment", + "type": "integer" + }, + "created_at": { + "description": "ISO8601 timestamp of when the object was created", + "type": "string" + }, + "id": { + "description": "ID assigned to the segment when created.", + "format": "uuid", + "maxLength": 36, + "minLength": 36, + "type": "string" + }, + "name": { + "description": "Name of the segment.", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "next_sample_update": { + "description": "ISO8601 timestamp of when the samples will be next updated", + "type": "string" + }, + "parent_list_ids": { + "description": "The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future", + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, + "query_version": { + "description": "If not set, segment contains a query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2.", + "type": "string" + }, + "sample_updated_at": { + "description": "ISO8601 timestamp of when the samples were last updated", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/segment_status_response" + }, + "updated_at": { + "description": "ISO8601 timestamp of when the object was last updated", + "type": "string" + } + }, + "required": [ + "id", + "name", + "contacts_count", + "created_at", + "updated_at", + "sample_updated_at", + "next_sample_update", + "parent_list_ids", + "query_version", + "status" + ], + "title": "all_segments_response", + "type": "object", + "x-stoplight": { + "id": "all_segments_response", + "name": "all_segments_response", + "public": true + } + }, + "api-error": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "field", + "error_id" + ], + "title": "error", + "type": "object", + "x-stoplight": { + "id": "api-error", + "name": "error", + "public": true + } + }, + "api-errors": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/api-error" + }, + "type": "array" + } + }, + "title": "errors", + "type": "object", + "x-stoplight": { + "id": "api-errors", + "name": "errors", + "public": true + } + }, + "api_key_name_id": { + "example": { + "api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA", + "name": "Mail Send" + }, + "properties": { + "api_key_id": { + "description": "The ID of your API Key. ", + "type": "string" + }, + "name": { + "description": "The name of your API Key.", + "type": "string" + } + }, + "title": "API Key Name and ID", + "type": "object", + "x-stoplight": { + "id": "api_key_name_id", + "name": "API Key Name and ID", + "public": true + } + }, + "api_key_name_id_scopes": { + "allOf": [ + { + "properties": { + "scopes": { + "description": "The permissions this API Key has access to.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/api_key_name_id" + } + ], + "example": { + "api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA", + "name": "Mail Send", + "scopes": [ + "mail.send", + "mail.batch.create", + "mail.batch.read", + "mail.batch.update", + "mail.batch.delete", + "user.scheduled_sends.create", + "user.scheduled_sends.read", + "user.scheduled_sends.update", + "user.scheduled_sends.delete", + "sender_verification_eligible", + "sender_verification_legacy", + "2fa_required" + ] + }, + "title": "API Key Name, ID, and Scopes", + "x-stoplight": { + "id": "api_key_name_id_scopes", + "name": "API Key Name, ID, and Scopes", + "public": true + } + }, + "authentication_domain": { + "example": { + "automatic_security": true, + "custom_spf": false, + "default": true, + "dns": { + "dkim1": { + "data": "s1._domainkey.u7.wl.sendgrid.net", + "host": "s1._domainkey.example.com", + "type": "cname", + "valid": true + }, + "dkim2": { + "data": "s2._domainkey.u7.wl.sendgrid.net", + "host": "s2._domainkey.example.com", + "type": "cname", + "valid": true + }, + "mail_cname": { + "data": "u7.wl.sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 45373692, + "ips": [ + "127.0.0.1" + ], + "legacy": false, + "subdomain": "sub", + "user_id": 66036447, + "username": "jdoe", + "valid": true + }, + "properties": { + "automatic_security": { + "description": "Indicates if this authenticated domain uses automated security.", + "type": "boolean" + }, + "custom_spf": { + "description": "Indicates whether this authenticated domain uses custom SPF.", + "type": "boolean" + }, + "default": { + "description": "Indicates if this is the default authenticated domain.", + "type": "boolean" + }, + "dns": { + "description": "The DNS records used to authenticate the sending domain.", + "properties": { + "dkim1": { + "description": "A DNS record.", + "properties": { + "data": { + "description": "The DNS record.", + "type": "string" + }, + "host": { + "description": "The domain that this DNS record was created for.", + "type": "string" + }, + "type": { + "description": "The type of DNS record.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid DNS record.", + "type": "boolean" + } + }, + "required": [ + "valid", + "type", + "host", + "data" + ], + "type": "object" + }, + "dkim2": { + "description": "A DNS record.", + "properties": { + "data": { + "description": "The DNS record.", + "type": "string" + }, + "host": { + "description": "The domain that this DNS record was created for.", + "type": "string" + }, + "type": { + "description": "The type of DNS record.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid DNS record.", + "type": "boolean" + } + }, + "required": [ + "valid", + "type", + "host", + "data" + ], + "type": "object" + }, + "mail_cname": { + "description": "The CNAME for your sending domain that points to sendgrid.net.", + "properties": { + "data": { + "description": "The CNAME record.", + "type": "string" + }, + "host": { + "description": "The domain that this CNAME is created for.", + "format": "hostname", + "type": "string" + }, + "type": { + "description": "The type of DNS record.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid CNAME.", + "type": "boolean" + } + }, + "required": [ + "valid", + "type", + "host", + "data" + ], + "type": "object" + } + }, + "required": [ + "mail_cname", + "dkim1", + "dkim2" + ], + "type": "object" + }, + "domain": { + "description": "The domain to be authenticated.", + "type": "string" + }, + "id": { + "description": "The ID of the authenticated domain.", + "type": "number" + }, + "ips": { + "description": "The IPs to be included in the custom SPF record for this authenticated domain.", + "items": { + "type": "string" + }, + "type": "array" + }, + "legacy": { + "description": "Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it.", + "type": "boolean" + }, + "subdomain": { + "description": "The subdomain to use for this authenticated domain.", + "type": "string" + }, + "user_id": { + "description": "The ID of the user that this domain is associated with.", + "type": "number" + }, + "username": { + "description": "The username that this domain will be associated with.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid authenticated domain.", + "type": "boolean" + } + }, + "required": [ + "id", + "user_id", + "subdomain", + "domain", + "username", + "ips", + "custom_spf", + "default", + "legacy", + "automatic_security", + "valid", + "dns" + ], + "title": "Domain Authentication - Mandatory Subdomain", + "type": "object", + "x-stoplight": { + "id": "authentication::domain", + "name": "Domain Authentication - Mandatory Subdomain", + "public": true + } + }, + "automations-link-stats-response": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/link-tracking-metadata" + }, + "results": { + "description": "", + "items": { + "properties": { + "clicks": { + "description": "The number of clicks on this particular link.", + "minimum": 1, + "type": "integer" + }, + "step_id": { + "description": "This is the ID of the step if the stats were requested to be grouped by `step_id`.", + "format": "uuid", + "type": "string" + }, + "url": { + "description": "This is the URL of the link clicked. If `{{custom_fields}}` are part of the URL, they will be included.", + "format": "uri", + "type": "string" + }, + "url_location": { + "description": "This is the location of the link clicked in each Automation step. Links are located according to their position within the message; the topmost link has index `0`.", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "url", + "step_id", + "clicks" + ], + "type": "object" + }, + "type": "array" + }, + "total_clicks": { + "type": "integer" + } + }, + "required": [ + "results", + "total_clicks", + "_metadata" + ], + "title": "automations-link-stats-response", + "type": "object", + "x-stoplight": { + "id": "automations-link-stats-response", + "name": "automations-link-stats-response", + "public": true + } + }, + "automations-response": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/metadata" + }, + "results": { + "items": { + "properties": { + "aggregation": { + "default": "total", + "description": "This describes the time unit to which the stat is rolled up. It is based on the `aggregated_by` parameter included in the request. It can be \"total\" or the date (in YYYY-MM-DD format) the stats are for.", + "type": "string" + }, + "id": { + "description": "This is the ID of the Automation you are requesting stats for.", + "format": "uuid", + "type": "string" + }, + "stats": { + "$ref": "#/components/schemas/metrics" + }, + "step_id": { + "default": "all", + "description": "This is the ID of the step if the stats were requested to be grouped by `step_id`.", + "type": "string" + } + }, + "required": [ + "id", + "aggregation", + "step_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "results" + ], + "title": "automations-response", + "type": "object", + "x-stoplight": { + "id": "automations-response", + "name": "automations-response", + "public": true + } + }, + "blocks-response": { + "example": [ + { + "created": 1443651154, + "email": "example@example.com", + "reason": "error dialing remote address: dial tcp 10.57.152.165:25: no route to host", + "status": "4.0.0" + } + ], + "items": { + "properties": { + "created": { + "description": "A Unix timestamp indicating when the email address was added to the blocks list.", + "type": "integer" + }, + "email": { + "description": "The email address that was added to the block list.", + "format": "email", + "type": "string" + }, + "reason": { + "description": "An explanation for the reason of the block.", + "type": "string" + }, + "status": { + "description": "The status of the block.", + "type": "string" + } + }, + "required": [ + "created", + "email", + "reason", + "status" + ], + "type": "object" + }, + "title": "Blocks Response", + "type": "array", + "x-stoplight": { + "id": "blocks-response", + "name": "Blocks Response", + "public": true + } + }, + "bounce_response": { + "example": { + "created": 1250337600, + "email": "example@example.com", + "reason": "550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/answer/6596 o186si2389584ioe.63 - gsmtp ", + "status": "5.1.1" + }, + "properties": { + "created": { + "description": "The unix timestamp for when the bounce record was created at SendGrid.", + "type": "number" + }, + "email": { + "description": "The email address that was added to the bounce list.", + "format": "email", + "type": "string" + }, + "reason": { + "description": "The reason for the bounce. This typically will be a bounce code, an enhanced code, and a description.", + "type": "string" + }, + "status": { + "description": "Enhanced SMTP bounce response", + "type": "string" + } + }, + "title": "Bounce Response", + "type": "object", + "x-stoplight": { + "id": "bounce_response", + "name": "Bounce Response", + "public": true + } + }, + "campaign_request": { + "example": { + "categories": [ + "summer line" + ], + "custom_unsubscribe_url": "", + "html_content": "

Check out our summer line!

", + "id": 986724, + "ip_pool": "marketing", + "list_ids": [ + 110, + 124 + ], + "plain_content": "Check out our summer line!", + "segment_ids": [ + 110 + ], + "sender_id": 124451, + "status": "Draft", + "subject": "New Products for Summer!", + "suppression_group_id": 42, + "title": "May Newsletter" + }, + "properties": { + "categories": { + "description": "The categories you would like associated to this campaign.", + "items": { + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "custom_unsubscribe_url": { + "description": "This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups.", + "nullable": true, + "type": "string" + }, + "editor": { + "description": "The editor used in the UI.", + "enum": [ + "code", + "design" + ], + "type": "string" + }, + "html_content": { + "description": "The HTML of your marketing email.", + "nullable": true, + "type": "string" + }, + "ip_pool": { + "description": "The pool of IPs that you would like to send this email from.", + "nullable": true, + "type": "string" + }, + "list_ids": { + "description": "The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs", + "items": { + "type": "integer" + }, + "nullable": true, + "type": "array" + }, + "plain_content": { + "description": "The plain text content of your emails.", + "nullable": true, + "type": "string" + }, + "segment_ids": { + "description": "The segment IDs that you are sending this list to. You can have both segment IDs and list IDs. Segments are limited to 10 segment IDs.", + "items": { + "type": "integer" + }, + "nullable": true, + "type": "array" + }, + "sender_id": { + "description": "The ID of the \"sender\" identity that you have created. Your recipients will see this as the \"from\" on your marketing emails.", + "nullable": true, + "type": "integer" + }, + "subject": { + "description": "The subject of your campaign that your recipients will see.", + "nullable": true, + "type": "string" + }, + "suppression_group_id": { + "description": "The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type.", + "nullable": true, + "type": "integer" + }, + "title": { + "description": "The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI.", + "type": "string" + } + }, + "required": [ + "title" + ], + "title": "Campaigns Request", + "type": "object", + "x-stoplight": { + "id": "campaign_request", + "name": "Campaigns Request", + "public": true + } + }, + "campaign_response": { + "allOf": [ + { + "$ref": "#/components/schemas/campaign_request" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "status": { + "description": "The status of your campaign.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + ], + "title": "Campaigns Response", + "x-stoplight": { + "id": "campaign_response", + "name": "Campaigns Response", + "public": true + } + }, + "category_stats": { + "example": { + "date": "2015-01-01", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "cat1", + "type": "category" + }, + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "cat2", + "type": "category" + } + ] + }, + "properties": { + "date": { + "description": "The date the statistics were gathered.", + "type": "string" + }, + "stats": { + "items": { + "properties": { + "metrics": { + "properties": { + "blocks": { + "description": "The number of emails that were not allowed to be delivered by ISPs.", + "type": "integer" + }, + "bounce_drops": { + "description": "The number of emails that were dropped because of a bounce.", + "type": "integer" + }, + "bounces": { + "description": "The number of emails that bounced instead of being delivered.", + "type": "integer" + }, + "clicks": { + "description": "The number of links that were clicked.", + "type": "integer" + }, + "deferred": { + "description": "The number of emails that temporarily could not be delivered.", + "type": "integer" + }, + "delivered": { + "description": "The number of emails SendGrid was able to confirm were actually delivered to a recipient.", + "type": "integer" + }, + "invalid_emails": { + "description": "The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid.", + "type": "integer" + }, + "opens": { + "description": "The total number of times your emails were opened by recipients.", + "type": "integer" + }, + "processed": { + "description": "Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed.", + "type": "integer" + }, + "requests": { + "description": "The number of emails that were requested to be delivered.", + "type": "integer" + }, + "spam_report_drops": { + "description": "The number of emails that were dropped due to a recipient previously marking your emails as spam.", + "type": "integer" + }, + "spam_reports": { + "description": "The number of recipients who marked your email as spam.", + "type": "integer" + }, + "unique_clicks": { + "description": "The number of unique recipients who clicked links in your emails.", + "type": "integer" + }, + "unique_opens": { + "description": "The number of unique recipients who opened your emails.", + "type": "integer" + }, + "unsubscribe_drops": { + "description": "The number of emails dropped due to a recipient unsubscribing from your emails.", + "type": "integer" + }, + "unsubscribes": { + "description": "The number of recipients who unsubscribed from your emails.", + "type": "integer" + } + }, + "required": [ + "blocks", + "bounce_drops", + "bounces", + "clicks", + "deferred", + "delivered", + "invalid_emails", + "opens", + "processed", + "requests", + "spam_report_drops", + "spam_reports", + "unique_clicks", + "unique_opens", + "unsubscribe_drops", + "unsubscribes" + ], + "type": "object" + }, + "name": { + "description": "The name of the category.", + "type": "string" + }, + "type": { + "description": "How you are segmenting your statistics.", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "date" + ], + "title": "Stats: Category Stats", + "type": "object", + "x-stoplight": { + "id": "category_stats", + "name": "Stats: Category Stats", + "public": true + } + }, + "cc_bcc_email_object": { + "example": { + "email": "jane_doe@example.com", + "name": "Jane Doe" + }, + "properties": { + "email": { + "description": "The intended recipient's email address.", + "format": "email", + "type": "string" + }, + "name": { + "description": "The intended recipient's name.", + "type": "string" + } + }, + "required": [ + "email" + ], + "title": "CC BCC Email Object", + "type": "object", + "x-stoplight": { + "id": "cc_bcc_email_object", + "name": "CC BCC Email Object", + "public": true + } + }, + "click-tracking": { + "example": { + "enable_text": false, + "enabled": false + }, + "properties": { + "enable_text": { + "description": "Indicates if click tracking is enabled for plain text emails.", + "type": "boolean" + }, + "enabled": { + "description": "Indicates if click tracking is enabled or disabled.", + "type": "boolean" + } + }, + "required": [ + "enable_text", + "enabled" + ], + "title": "Settings: Click Tracking", + "type": "object", + "x-stoplight": { + "id": "click-tracking", + "name": "Settings: Click Tracking", + "public": true + } + }, + "contact-details": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/selfmetadata" + }, + "address_line_1": { + "type": "string" + }, + "address_line_2": { + "type": "string" + }, + "alternate_emails": { + "items": { + "type": "string" + }, + "type": "array" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "created_at": { + "description": "The ISO8601 timestamp when the contact was created.", + "type": "string" + }, + "custom_fields": { + "$ref": "#/components/schemas/custom-fields-by-name" + }, + "email": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "last_name": { + "type": "string" + }, + "list_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "postal_code": { + "type": "string" + }, + "state_province_region": { + "type": "string" + }, + "updated_at": { + "description": "The ISO8601 timestamp when the contact was updated.", + "type": "string" + } + }, + "required": [ + "id", + "list_ids", + "created_at", + "updated_at" + ], + "title": "contact-details", + "type": "object", + "x-stoplight": { + "id": "contact-details", + "name": "contact-details", + "public": true + } + }, + "contact-details2": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/selfmetadata" + }, + "address_line_1": { + "type": "string" + }, + "address_line_2": { + "type": "string" + }, + "alternate_emails": { + "items": { + "format": "email", + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "created_at": { + "format": "date-time", + "type": "string" + }, + "custom_fields": { + "type": "object" + }, + "email": { + "format": "email", + "type": "string" + }, + "facebook": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "format": "uuid", + "maxLength": 36, + "minLength": 36, + "type": "string" + }, + "last_name": { + "type": "string" + }, + "line": { + "type": "string" + }, + "list_ids": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + "phone_number": { + "type": "string" + }, + "postal_code": { + "type": "string" + }, + "segment_ids": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + "state_province_region": { + "type": "string" + }, + "unique_name": { + "type": "string" + }, + "updated_at": { + "format": "date-time", + "type": "string" + }, + "whatsapp": { + "type": "string" + } + }, + "required": [ + "id", + "list_ids", + "created_at", + "updated_at" + ], + "title": "contact-details2", + "type": "object", + "x-stoplight": { + "id": "contact-details2", + "name": "contact-details2", + "public": true + } + }, + "contact-details3": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/selfmetadata" + }, + "address_line_1": { + "type": "string" + }, + "address_line_2": { + "type": "string" + }, + "alternate_emails": { + "items": { + "type": "string" + }, + "type": "array" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "custom_fields": { + "type": "object" + }, + "email": { + "type": "string" + }, + "facebook": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "last_name": { + "type": "string" + }, + "line": { + "type": "string" + }, + "list_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "phone_number": { + "type": "string" + }, + "postal_code": { + "type": "string" + }, + "segment_ids": { + "items": { + "type": "string" + }, + "type": "array" + }, + "state_province_region": { + "type": "string" + }, + "unique_name": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "whatsapp": { + "type": "string" + } + }, + "required": [ + "id", + "list_ids", + "segment_ids", + "created_at", + "updated_at" + ], + "title": "contact-details3", + "type": "object", + "x-stoplight": { + "id": "contact-details3", + "name": "contact-details3", + "public": true + } + }, + "contact-export": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/metadata" + }, + "completed_at": { + "description": "The ISO8601 timestamp when the export was completed.", + "type": "string" + }, + "contact_count": { + "description": "The total number of exported contacts.", + "type": "integer" + }, + "created_at": { + "description": "The ISO8601 timestamp when the export was begun.", + "type": "string" + }, + "expires_at": { + "description": "The ISO8601 timestamp when the exported file on S3 will expire.", + "type": "string" + }, + "id": { + "type": "string" + }, + "message": { + "description": "A human readable message if the status is `failure`.", + "type": "string" + }, + "status": { + "description": "The export job's status. Allowed values: `pending`, `ready`, or `failure`.", + "enum": [ + "pending", + "ready", + "failure" + ], + "type": "string" + }, + "updated_at": { + "description": "The ISO8601 timestamp when the export was updated.", + "type": "string" + }, + "urls": { + "description": "One or more download URLs for the contact file if the status is `ready`.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "id", + "status", + "created_at", + "updated_at", + "expires_at" + ], + "title": "contact-export", + "type": "object", + "x-stoplight": { + "id": "contact-export", + "name": "contact-export", + "public": true + } + }, + "contact-import": { + "properties": { + "finished_at": { + "description": "The ISO8601 timestamp when the job was finished.", + "type": "string" + }, + "id": { + "description": "The job ID.", + "type": "string" + }, + "job_type": { + "description": "The job type. Allowed values: `upsert`, or `delete`.", + "type": "string" + }, + "results": { + "description": "Result map of the import job.", + "properties": { + "created_count": { + "description": "Created contact count from the import.", + "type": "number" + }, + "deleted_count": { + "description": "Count of deleted contacts that resulted in error.", + "type": "number" + }, + "errored_count": { + "description": "Count of imported contacts that resulted in error.", + "type": "number" + }, + "errors_url": { + "description": "The download URL of the file which provides information about any errors.", + "type": "string" + }, + "requested_count": { + "description": "Requested contact count from the import.", + "type": "number" + }, + "updated_count": { + "description": "Updated contact count from the import.", + "type": "number" + } + }, + "type": "object" + }, + "started_at": { + "description": "The ISO8601 timestamp when the job was created.", + "type": "string" + }, + "status": { + "description": "The job state. Allowed values: `pending`, `completed`, `errored`, or `failed`.", + "type": "string" + } + }, + "title": "contact-import", + "type": "object", + "x-stoplight": { + "id": "contact-import", + "name": "contact-import", + "public": true + } + }, + "contact-request": { + "properties": { + "address_line_1": { + "description": "The first line of the address.", + "maxLength": 100, + "type": "string" + }, + "address_line_2": { + "description": "An optional second line for the address.", + "maxLength": 100, + "type": "string" + }, + "alternate_emails": { + "description": "Additional emails associated with the contact.", + "items": { + "maxLength": 254, + "type": "string" + }, + "maxItems": 5, + "minItems": 0, + "type": "array" + }, + "city": { + "description": "The contact's city.", + "maxLength": 60, + "type": "string" + }, + "country": { + "description": "The contact's country. Can be a full name or an abbreviation.", + "maxLength": 50, + "type": "string" + }, + "custom_fields": { + "$ref": "#/components/schemas/custom-fields-by-id" + }, + "email": { + "description": "The contact's primary email. This is required to be a valid email.", + "maxLength": 254, + "type": "string" + }, + "first_name": { + "description": "The contact's personal name.", + "maxLength": 50, + "type": "string" + }, + "last_name": { + "description": "The contact's family name.", + "maxLength": 50, + "type": "string" + }, + "postal_code": { + "description": "The contact's ZIP code or other postal code.", + "type": "string" + }, + "state_province_region": { + "description": "The contact's state, province, or region.", + "maxLength": 50, + "type": "string" + } + }, + "required": [ + "email" + ], + "title": "contact-request", + "type": "object", + "x-stoplight": { + "id": "contact-request", + "name": "contact-request", + "public": true + } + }, + "contact-summary": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/selfmetadata" + }, + "created_at": { + "description": "Unix Epoch Timestamp.", + "type": "number" + }, + "email": { + "description": "Primary email address.", + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "description": "Contact UUID.", + "type": "string" + }, + "last_name": { + "type": "string" + }, + "list_ids": { + "description": "List UUID linked with this contact.", + "items": { + "type": "string" + }, + "type": "array" + }, + "updated_at": { + "description": "Unix Epoch Timestamp.", + "type": "number" + } + }, + "required": [ + "id", + "list_ids", + "created_at", + "updated_at" + ], + "title": "contact-summary", + "type": "object", + "x-stoplight": { + "id": "contact-summary", + "name": "contact-summary", + "public": true + } + }, + "contact_response": { + "example": { + "address_line_1": "street address / P.O. box / CompanyName / c/o", + "address_line_2": "apartment, suite, unit, building, floor etc", + "alternate_emails": [ + "abcd@yahoo.com", + "abcd@hotmail.com" + ], + "city": "Redwood City", + "country": "USA", + "custom_fields": { + "custom_field_name1": "custom_field_value1", + "custom_field_name2": "custom_field_value2" + }, + "email": "abcd@gmail.com", + "first_name": "Ab", + "id": "47d23ab0-d895-4359-a0d1-ffc7a6fc7e70", + "last_name": "Cd", + "postal_code": 94063, + "state_province_region": "CA" + }, + "properties": { + "address_line_1": { + "description": "First line of address of the contact. This is a reserved field.", + "minLength": 0, + "type": "string" + }, + "address_line_2": { + "description": "Second line of address of the contact. This is a reserved field.", + "minLength": 0, + "type": "string" + }, + "alternate_emails": { + "description": "Alternate emails of the contact. This is a reserved field.", + "items": { + "format": "email", + "maxLength": 254, + "minLength": 3, + "type": "string" + }, + "minItems": 0, + "type": "array", + "uniqueItems": true + }, + "city": { + "description": "City associated with the contact. This is a reserved field.", + "minLength": 0, + "pattern": "^[a-zA-Z\\u0080-\\u024F\\s\\/\\-\\)\\(\\`\\.\\\"\\']+$", + "type": "string" + }, + "country": { + "description": "Country associated with the address of the contact. This is a reserved field.", + "minLength": 0, + "type": "string" + }, + "custom_fields": { + "description": "The user may choose to create up to 120 custom fields or none at all. This is not a reserved field.", + "minProperties": 0, + "properties": { + "": { + "type": "string" + }, + "custom_field_name1": { + "minLength": 0, + "type": "string" + }, + "custom_field_name2": { + "minLength": 0, + "type": "string" + } + }, + "type": "object" + }, + "email": { + "description": "Email of the contact. This is a reserved field.", + "format": "email", + "maxLength": 254, + "minLength": 3, + "type": "string" + }, + "first_name": { + "description": "First name of the contact. This is a reserved field.", + "minLength": 1, + "type": "string" + }, + "id": { + "description": "ID assigned to a contact when added to the system.", + "format": "uuid", + "maxLength": 36, + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "last_name": { + "description": "Last name of the contact. This is a reserved field.", + "minLength": 1, + "type": "string" + }, + "list_ids": { + "description": "IDs of all lists the contact is part of", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, + "postal_code": { + "description": "Zipcode associated with the address of the contact. This is a reserved field.", + "type": "integer" + }, + "segment_ids": { + "description": "IDs of all segments the contact is part of", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, + "state_province_region": { + "description": "State associated with the contact. This is a reserved field.", + "minLength": 0, + "type": "string" + } + }, + "required": [ + "id", + "email", + "alternate_emails", + "first_name", + "last_name", + "address_line_1", + "address_line_2", + "city", + "state_province_region", + "postal_code", + "country", + "custom_fields" + ], + "title": "contact_response", + "type": "object", + "x-stoplight": { + "id": "contact_response", + "name": "contact_response", + "public": true + } + }, + "contactdb_custom_field": { + "example": { + "name": "first_name", + "type": "text" + }, + "properties": { + "name": { + "description": "The name of the field", + "type": "string" + }, + "type": { + "description": "The type of the field.", + "enum": [ + "date", + "text", + "number" + ], + "type": "string" + } + }, + "title": "ContactDB Custom field schema.", + "type": "object", + "x-stoplight": { + "id": "contactdb_custom_field", + "name": "ContactDB: Custom Field", + "public": true + } + }, + "contactdb_custom_field_with_id": { + "allOf": [ + { + "$ref": "#/components/schemas/contactdb_custom_field" + }, + { + "properties": { + "id": { + "description": "The ID of the custom field.", + "type": "number" + } + }, + "type": "object" + } + ], + "title": "ContactDB Custom field schema with ID.", + "x-stoplight": { + "id": "contactdb_custom_field_with_id", + "name": "ContactDB: Custom Field with ID", + "public": true + } + }, + "contactdb_custom_field_with_id_value": { + "allOf": [ + { + "$ref": "#/components/schemas/contactdb_custom_field_with_id" + }, + { + "properties": { + "value": { + "description": "The value of this recipient's custom field", + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + ], + "title": "ContactDB Custom field schema.", + "x-stoplight": { + "id": "contactdb_custom_field_with_id_value", + "name": "ContactDB: Custom Field with ID & Value", + "public": true + } + }, + "contactdb_list": { + "example": { + "id": 1, + "name": "listname", + "recipient_count": 0 + }, + "properties": { + "id": { + "description": "The reference ID of your list.", + "type": "integer" + }, + "name": { + "description": "The name of your list. Must be unique against all other list and segment names.", + "type": "string" + }, + "recipient_count": { + "description": "The count of recipients currently in the list.", + "type": "integer" + } + }, + "required": [ + "id", + "name", + "recipient_count" + ], + "title": "ContactDB lists", + "type": "object", + "x-stoplight": { + "id": "contactdb_list", + "name": "ContactDB: List", + "public": true + } + }, + "contactdb_recipient": { + "properties": { + "recipients": { + "items": { + "properties": { + "created_at": { + "description": "The time this record was created in your contactdb, in unixtime.", + "type": "number" + }, + "custom_fields": { + "description": "The custom fields assigned to this recipient and their values.", + "items": { + "$ref": "#/components/schemas/contactdb_custom_field_with_id_value" + }, + "type": "array" + }, + "email": { + "description": "The email address of this recipient. This is a default custom field that SendGrid provides.", + "format": "email", + "type": "string" + }, + "first_name": { + "description": "The first name of this recipient. This is a default custom field that SendGrid provides.", + "nullable": true, + "type": "string" + }, + "id": { + "description": "The ID of this recipient.", + "type": "string" + }, + "last_clicked": { + "description": "The last time this recipient clicked a link from one of your campaigns, in unixtime.", + "nullable": true, + "type": "number" + }, + "last_emailed": { + "description": "The last time this user was emailed by one of your campaigns, in unixtime.", + "nullable": true, + "type": "number" + }, + "last_name": { + "description": "The last name of the recipient.", + "nullable": true, + "type": "string" + }, + "last_opened": { + "description": "The last time this recipient opened an email from you, in unixtime.", + "nullable": true, + "type": "number" + }, + "updated_at": { + "description": "The last update date for this recipient's record.", + "type": "number" + } + }, + "required": [ + "email" + ], + "type": "object" + }, + "type": "array" + } + }, + "title": "ContactDB: Recipient", + "type": "object", + "x-stoplight": { + "id": "contactdb_recipient", + "name": "ContactDB: Recipient", + "public": true + } + }, + "contactdb_recipient_count": { + "example": { + "recipient_count": 1234 + }, + "properties": { + "recipient_count": { + "description": "The count of recipients.", + "type": "number" + } + }, + "required": [ + "recipient_count" + ], + "title": "ContactDB: Recipient Count", + "type": "object", + "x-stoplight": { + "id": "contactdb_recipient_count", + "name": "ContactDB: Recipient Count", + "public": true + } + }, + "contactdb_recipient_response": { + "example": { + "error_count": 1, + "error_indices": [ + 2 + ], + "errors": [ + { + "error_indices": [ + 2 + ], + "message": "Invalid email." + } + ], + "new_count": 2, + "persisted_recipients": [ + "YUBh", + "bWlsbGVyQG1pbGxlci50ZXN0" + ], + "updated_count": 0 + }, + "properties": { + "error_count": { + "default": 0, + "description": "The number of errors found while adding recipients.", + "type": "number" + }, + "error_indices": { + "default": [], + "description": "The indices of the recipient(s) sent that caused the error. ", + "items": { + "type": "number" + }, + "type": "array" + }, + "errors": { + "items": { + "properties": { + "error_indices": { + "items": { + "type": "number" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "new_count": { + "default": 0, + "description": "The count of new recipients added to the contactdb.", + "type": "number" + }, + "persisted_recipients": { + "default": [], + "description": "The recipient IDs of the recipients that already existed from this request.", + "items": { + "type": "string" + }, + "type": "array" + }, + "updated_count": { + "default": 0, + "description": "The recipients who were updated from this request.", + "type": "number" + } + }, + "required": [ + "error_count", + "new_count", + "persisted_recipients", + "updated_count" + ], + "title": "ContactDB: Recipient response", + "type": "object", + "x-stoplight": { + "id": "contactdb_recipient_response", + "name": "ContactDB: Recipient response", + "public": true + } + }, + "contactdb_segments": { + "example": { + "conditions": [ + { + "and_or": "", + "field": "last_name", + "operator": "eq", + "value": "Miller" + }, + { + "and_or": "and", + "field": "last_clicked", + "operator": "gt", + "value": "01/02/2015" + }, + { + "and_or": "or", + "field": "clicks.campaign_identifier", + "operator": "eq", + "value": "513" + } + ], + "list_id": 4, + "name": "Last Name Miller", + "recipient_count": 1234 + }, + "properties": { + "conditions": { + "description": "The conditions for a recipient to be included in this segment.", + "items": { + "$ref": "#/components/schemas/contactdb_segments_conditions" + }, + "type": "array" + }, + "list_id": { + "description": "The list id from which to make this segment. Not including this ID will mean your segment is created from the main contactdb rather than a list.", + "type": "integer" + }, + "name": { + "description": "The name of this segment.", + "type": "string" + }, + "recipient_count": { + "description": "The count of recipients in this list. This is not included on creation of segments.", + "type": "number" + } + }, + "required": [ + "name", + "conditions" + ], + "title": "Create a Segment request", + "type": "object", + "x-stoplight": { + "id": "contactdb_segments", + "name": "ContactDB: Segments", + "public": true + } + }, + "contactdb_segments_conditions": { + "properties": { + "and_or": { + "enum": [ + "and", + "or", + "" + ], + "type": "string" + }, + "field": { + "type": "string" + }, + "operator": { + "enum": [ + "eq", + "ne", + "lt", + "gt", + "contains" + ], + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "field", + "value", + "operator" + ], + "title": "ContactDB: Segments: Conditions", + "type": "object", + "x-stoplight": { + "id": "contactdb_segments_conditions", + "name": "ContactDB: Segments: Conditions", + "public": true + } + }, + "contactdb_segments_with_id": { + "allOf": [ + { + "properties": { + "id": { + "description": "The ID of the segment.", + "type": "number" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + { + "$ref": "#/components/schemas/contactdb_segments" + } + ], + "title": "ContactDB:: Segments with ID", + "x-stoplight": { + "id": "contactdb_segments_with_id", + "name": "ContactDB:: Segments with ID", + "public": true + } + }, + "contacts": { + "properties": { + "address": { + "type": "string" + }, + "address2": { + "type": "object" + }, + "city": { + "type": "string" + }, + "company": { + "type": "string" + }, + "country": { + "type": "string" + }, + "email": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "last_name": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + }, + "title": "Contacts", + "type": "object", + "x-stoplight": { + "id": "contacts", + "name": "Contacts", + "public": true + } + }, + "create-integration-request": { + "properties": { + "completed_integration": { + "description": "Indicates if the integration is complete.", + "type": "boolean" + }, + "enabled": { + "description": "Indicates if the integration is enabled.", + "type": "boolean" + }, + "entity_id": { + "description": "An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI.", + "type": "string" + }, + "name": { + "description": "The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid)", + "type": "string" + }, + "signin_url": { + "description": "The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI.", + "type": "string" + }, + "signout_url": { + "description": "This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out.", + "type": "string" + } + }, + "required": [ + "name", + "enabled", + "signin_url", + "signout_url", + "entity_id" + ], + "title": "Create Integration Request", + "type": "object", + "x-stoplight": { + "id": "create-integration-request", + "name": "Create Integration Request", + "public": true + } + }, + "credentials": { + "example": { + "address": "1234 example street", + "address2": null, + "city": "Denver", + "company": "Company name", + "country": "US", + "email": "example@example.com", + "first_name": "Example", + "last_name": "User", + "phone": "(555) 555-5555", + "state": "CO", + "zip": "55555" + }, + "properties": { + "permissions": { + "properties": { + "api": { + "type": "string" + }, + "mail": { + "type": "string" + }, + "web": { + "type": "string" + } + }, + "type": "object" + }, + "username": { + "type": "string" + } + }, + "title": "Credentials", + "type": "object", + "x-stoplight": { + "id": "credentials", + "name": "Credentials", + "public": true + } + }, + "custom-fields-by-id": { + "example": { + "e2": "Coffee is a beverage that puts one to sleep when not drank.", + "w1": "2002-10-02T15:00:00Z", + "w33": 9.5 + }, + "title": "custom-fields-by-id", + "type": "object", + "x-stoplight": { + "id": "custom-fields-by-id", + "name": "custom-fields-by-id", + "public": true + } + }, + "custom-fields-by-name": { + "example": { + "birthday": "2002-10-02T15:00:00Z", + "favoriteQuote": "Coffee is a beverage that puts one to sleep when not drank.", + "shoe_size": 9.5 + }, + "title": "custom-fields-by-name", + "type": "object", + "x-stoplight": { + "id": "custom-fields-by-name", + "name": "custom-fields-by-name", + "public": true + } + }, + "custom_field_definitions_response": { + "example": { + "field_type": "Date", + "id": "a1_D", + "name": "custom_field_name" + }, + "properties": { + "field_type": { + "enum": [ + "Text", + "Number", + "Date" + ], + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "id", + "name", + "field_type" + ], + "title": "custom_field_definitions_response", + "type": "object", + "x-stoplight": { + "id": "custom_field_definitions_response", + "name": "custom_field_definitions_response", + "public": true + } + }, + "design-common-fields": { + "allOf": [ + { + "$ref": "#/components/schemas/design-duplicate-input" + }, + { + "properties": { + "categories": { + "description": "The list of categories applied to the design", + "items": { + "maxLength": 255, + "type": "string" + }, + "maxItems": 10, + "type": "array", + "uniqueItems": true + }, + "generate_plain_content": { + "default": true, + "description": "If true, plain_content is always generated from html_content. If false, plain_content is not altered.", + "type": "boolean" + }, + "subject": { + "description": "Subject of the Design.", + "maxLength": 5000, + "type": "string" + } + }, + "type": "object" + } + ], + "title": "Design Common Fields", + "x-stoplight": { + "id": "design-common-fields", + "name": "Design Common Fields", + "public": true + } + }, + "design-duplicate-input": { + "example": { + "editor": "design", + "name": "Ahoy, Cake or Pie Cafe!" + }, + "properties": { + "editor": { + "description": "The editor used in the UI.", + "enum": [ + "code", + "design" + ], + "type": "string" + }, + "name": { + "default": "Duplicate: ", + "description": "The name of the new design.", + "type": "string" + } + }, + "title": "Design Duplicate Design Input", + "type": "object", + "x-stoplight": { + "id": "design-duplicate-input", + "name": "Design Duplicate Design Input", + "public": true + } + }, + "design-input": { + "allOf": [ + { + "$ref": "#/components/schemas/design-duplicate-input" + }, + { + "$ref": "#/components/schemas/design-common-fields" + }, + { + "properties": { + "html_content": { + "description": "The HTML content of the Design.", + "maxLength": 1048576, + "type": "string" + }, + "plain_content": { + "default": "", + "description": "Plain text content of the Design.", + "maxLength": 1048576, + "type": "string" + } + }, + "required": [ + "html_content" + ], + "type": "object" + } + ], + "example": { + "editor": "design", + "html_content": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n
\n \n \n \n
\n

\n
\n \n \n \n \n \n
Ahoy, World!

{{Sender_Name}}

{{Sender_Address}}, {{Sender_City}}, {{Sender_State}} {{Sender_Zip}}

Unsubscribe - Unsubscribe Preferences

\n \n
\n
\n
\n
\n
\n \n ", + "name": "Ahoy, World!", + "plain_content": "Ahoy, World!\n\n{{Sender_Name}}\n\n{{Sender_Address}} , {{Sender_City}} , {{Sender_State}} {{Sender_Zip}}\n\nUnsubscribe ( {{{unsubscribe}}} ) - Unsubscribe Preferences ( {{{unsubscribe_preferences}}} )", + "subject": "Getting Started" + }, + "title": "Design Input", + "x-stoplight": { + "id": "design-input", + "name": "Design Input", + "public": true + } + }, + "design-output": { + "allOf": [ + { + "$ref": "#/components/schemas/design-output-summary" + }, + { + "$ref": "#/components/schemas/design-input" + } + ], + "title": "Design Output", + "x-stoplight": { + "id": "design-output", + "name": "Design Output", + "public": true + } + }, + "design-output-summary": { + "allOf": [ + { + "properties": { + "created_at": { + "description": "Datetime that Design was created.", + "format": "ISO 8601 date-time", + "type": "string" + }, + "id": { + "description": "ID of the Design.", + "format": "uuid", + "type": "string" + }, + "thumbnail_url": { + "description": "A Thumbnail preview of the template's html content.", + "type": "string" + }, + "updated_at": { + "description": "Datetime that Design was last updated.", + "format": "ISO 8601 date-time", + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/design-duplicate-input" + }, + { + "$ref": "#/components/schemas/design-common-fields" + } + ], + "example": { + "_metadata": { + "count": 3, + "self": "https://api.sendgrid.com/v3/designs?page_token=vHdvHCg0w1F-TmWJcPNpTEnFY2aPEmRBHONwOgZ6TgJbX2_I" + }, + "result": [ + { + "categories": [ + "welcome", + "new customer" + ], + "created_at": "2021-04-09T17:29:46Z", + "editor": "code", + "generate_plain_content": true, + "id": "3247eaea-c912-42a3-b0bc-60bdaf210396", + "name": "Welcome Email", + "subject": "Welcom to the Cake or Pie Cafe", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/llny8o5b3m636z92p7hbjnmq1jvpka39p370jwtin2s1wxv7x1sgm0y5fk518d0s.png", + "updated_at": "2021-04-09T17:29:55Z" + }, + { + "categories": [ + "promo", + "coupon" + ], + "created_at": "2021-04-09T17:29:21Z", + "editor": "design", + "generate_plain_content": true, + "id": "02dfd792-f31f-439a-a79e-5c47fbcfdbac", + "name": "Monthly Promo", + "subject": "Free Dozen Cupcakes", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/hfyxahd7ues2ajuoeoqq2xe6ibdasl1q89ox0y9ncya2ftpoicssmtf9ddus4c39.png", + "updated_at": "2021-04-09T17:29:42Z" + }, + { + "categories": [], + "created_at": "2020-10-09T17:33:46Z", + "editor": "design", + "generate_plain_content": true, + "id": "e54be823-19ef-4c6f-8b60-efd7514f492d", + "name": "Duplicate: Ingrid & Anders", + "subject": "Welcome to Ingrid & Anders!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/12kni9gjpyb9uxmwr9vk7unycjr70u95zoyhe9sg2zounul2zg7dih1s20k13q2z.png", + "updated_at": "2021-04-07T19:57:52Z" + } + ] + }, + "title": "Design Output - Summary", + "x-stoplight": { + "id": "design-output-summary", + "name": "Design Output - Summary", + "public": true + } + }, + "domain-authentication-200-response": { + "example": [ + { + "automatic_security": true, + "custom_spf": true, + "default": true, + "dns": { + "dkim1": { + "data": "s1._domainkey.u7.wl.sendgrid.net", + "host": "s1._domainkey.example.com", + "type": "cname", + "valid": true + }, + "dkim2": { + "data": "s2._domainkey.u7.wl.sendgrid.net", + "host": "s2._domainkey.example.com", + "type": "cname", + "valid": true + }, + "mail_cname": { + "data": "u7.wl.sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "ips": [ + "192.168.1.1", + "192.168.1.2" + ], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "jane@example.com", + "valid": true + }, + { + "automatic_security": true, + "custom_spf": false, + "default": true, + "dns": { + "dkim1": { + "data": "k=rsa; t=s; p=publicKey", + "host": "example2.com", + "type": "txt", + "valid": false + }, + "dkim2": { + "data": "k=rsa; t=s p=publicKey", + "host": "example2.com", + "type": "txt", + "valid": false + }, + "mail_cname": { + "data": "sendgrid.net", + "host": "news.example2.com", + "type": "mx", + "valid": false + } + }, + "domain": "example2.com", + "id": 2, + "ips": [], + "legacy": false, + "subdomain": "new", + "user_id": 8, + "username": "john@example2.com", + "valid": false + } + ], + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/authentication_domain" + }, + { + "properties": { + "last_validation_attempt_at": { + "description": "A Unix epoch timestamp representing the last time of a validation attempt.", + "type": "integer" + }, + "subusers": { + "items": { + "properties": { + "user_id": { + "description": "The ID of the subuser that this authenticated domain will be associated with.", + "type": "integer" + }, + "username": { + "description": "The username of the subuser that this authenticated domain is associated with.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + }, + "title": "Domain Authentication 200 Response", + "type": "array", + "x-stoplight": { + "id": "domain-authentication-200-response", + "name": "Domain Authentication 200 Response", + "public": true + } + }, + "domain_authentication_domain_spf": { + "properties": { + "automatic_security": { + "description": "Indicates if this authenticated domain uses automated security.", + "type": "boolean" + }, + "custom_spf": { + "description": "Indicates if this authenticated domain uses custom SPF.", + "type": "boolean" + }, + "default": { + "description": "Indicates if this is the default domain.", + "type": "boolean" + }, + "dns": { + "description": "The DNS records for this authenticated domain.", + "properties": { + "dkim": { + "description": "The DKIM record for messages sent using this authenticated domain.", + "properties": { + "data": { + "description": "The DKIM record.", + "type": "string" + }, + "host": { + "description": "The DNS labels for the DKIM signature.", + "type": "string" + }, + "type": { + "description": "The type of data in the DKIM record.", + "type": "string" + }, + "valid": { + "description": "Indicates if the DKIM record is valid.", + "type": "boolean" + } + }, + "required": [ + "host", + "type", + "data", + "valid" + ], + "type": "object" + }, + "domain_spf": { + "description": "The SPF record for the root domain.", + "properties": { + "data": { + "description": "The SPF record.", + "type": "string" + }, + "host": { + "description": "The root domain that this SPF record will be used to authenticate.", + "type": "string" + }, + "type": { + "description": "The type of data in the SPF record.", + "type": "string" + }, + "valid": { + "description": "Indicates if the SPF record is valid.", + "type": "boolean" + } + }, + "required": [ + "host", + "type", + "data", + "valid" + ], + "type": "object" + }, + "mail_server": { + "description": "Designates which mail server is responsible for accepting messages from a domain.", + "properties": { + "data": { + "description": "The mail server responsible for accepting messages from the sending domain.", + "type": "string" + }, + "host": { + "description": "The domain sending the messages.", + "type": "string" + }, + "type": { + "description": "They type of DNS record.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid DNS record.", + "type": "boolean" + } + }, + "required": [ + "host", + "type", + "data", + "valid" + ], + "type": "object" + }, + "subdomain_spf": { + "description": "The SPF record for the subdomain used to create this authenticated domain.", + "properties": { + "data": { + "description": "The SPF record.", + "type": "string" + }, + "host": { + "description": "The domain that this SPF record will be used to authenticate.", + "type": "string" + }, + "type": { + "description": "The type of data in the SPF record.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid SPF record.", + "type": "boolean" + } + }, + "required": [ + "host", + "type", + "data", + "valid" + ], + "type": "object" + } + }, + "required": [ + "mail_server", + "subdomain_spf", + "domain_spf", + "dkim" + ], + "type": "object" + }, + "domain": { + "description": "The domain authenticated.", + "type": "string" + }, + "id": { + "description": "The ID of the authenticated domain.", + "type": "integer" + }, + "ips": { + "description": "The IP addresses that are included in the SPF record for this authenticated domain.", + "items": {}, + "type": "array" + }, + "legacy": { + "description": "Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it.", + "type": "boolean" + }, + "subdomain": { + "description": "The subdomain that was used to create this authenticated domain.", + "type": "string" + }, + "user_id": { + "description": "The user_id of the account that this authenticated domain is associated with.", + "type": "integer" + }, + "username": { + "description": "The username of the account that this authenticated domain is associated with.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid authenticated domain .", + "type": "boolean" + } + }, + "required": [ + "id", + "domain", + "username", + "user_id", + "ips", + "custom_spf", + "default", + "legacy", + "automatic_security", + "valid", + "dns" + ], + "title": "Domain Authentication", + "type": "object", + "x-stoplight": { + "id": "domain_authentication:domain_spf", + "name": "Domain Authentication", + "public": true + } + }, + "email-activity-response-common-fields": { + "properties": { + "from_email": { + "default": "test0@example.com", + "description": "The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account.", + "format": "email", + "type": "string" + }, + "msg_id": { + "description": "A unique ID assigned to the message. This ID can be used to retrieve activity data for the specific message.", + "type": "string" + }, + "status": { + "description": "The message's status.", + "enum": [ + "processed", + "delivered", + "not_delivered" + ], + "type": "string" + }, + "subject": { + "description": "The email's subject line.", + "type": "string" + }, + "to_email": { + "description": "The intended recipient's email address.", + "format": "email", + "type": "string" + } + }, + "title": "Email Activity Response Common Fields", + "type": "object", + "x-stoplight": { + "id": "email-activity-response-common-fields", + "name": "Email Activity Response Common Fields", + "public": true + } + }, + "enforced-tls-request-response": { + "example": { + "require_tls": true, + "require_valid_cert": true + }, + "properties": { + "require_tls": { + "description": "Indicates if you want to require your recipients to support TLS. ", + "type": "boolean" + }, + "require_valid_cert": { + "description": "Indicates if you want to require your recipients to have a valid certificate.", + "type": "boolean" + } + }, + "title": "Enforced TLS Request Response", + "type": "object", + "x-stoplight": { + "id": "enforced-tls-request-response", + "name": "Enforced TLS Request Response", + "public": true + } + }, + "error": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + }, + "parameter": { + "type": "string" + } + }, + "required": [ + "message" + ], + "title": "error", + "type": "object", + "x-stoplight": { + "id": "error", + "name": "error", + "public": true + } + }, + "errors": { + "description": "If the request is incorrect, an array of errors will be returned.", + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "description": "A description of what is wrong with the field passed in the request.", + "nullable": true, + "type": "string" + }, + "parameter": { + "description": "The parameter in the request body that is incorrect.", + "type": "string" + } + }, + "required": [ + "parameter", + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "title": "Errors", + "type": "object", + "x-stoplight": { + "id": "errors", + "name": "errors", + "public": true + } + }, + "errors-seg-v2": { + "description": "If the request is incorrect, an array of errors will be returned.", + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "description": "the field in the request body that is incorrect", + "type": "string" + }, + "message": { + "description": "a description of what is specifically wrong with the field passed in the request", + "type": "string" + } + }, + "required": [ + "field", + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "title": "errors-seg", + "type": "object", + "x-stoplight": { + "id": "errors-seg-v2", + "name": "errors-seg", + "public": true + } + }, + "event-webhook-response": { + "properties": { + "bounce": { + "description": "Receiving server could not or would not accept message.", + "type": "boolean" + }, + "click": { + "description": "Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event.", + "type": "boolean" + }, + "deferred": { + "description": "Recipient's email server temporarily rejected message.", + "type": "boolean" + }, + "delivered": { + "description": "Message has been successfully delivered to the receiving server.", + "type": "boolean" + }, + "dropped": { + "description": "You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota", + "type": "boolean" + }, + "enabled": { + "description": "Indicates if the event webhook is enabled.", + "type": "boolean" + }, + "group_resubscribe": { + "description": "Recipient resubscribes to specific group by updating preferences. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "group_unsubscribe": { + "description": "Recipient unsubscribe from specific group, by either direct link or updating preferences. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "oauth_client_id": { + "description": "The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token.", + "type": "string" + }, + "oauth_token_url": { + "description": "The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider.", + "type": "string" + }, + "open": { + "description": "Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event.", + "type": "boolean" + }, + "processed": { + "description": "Message has been received and is ready to be delivered.", + "type": "boolean" + }, + "spam_report": { + "description": "Recipient marked a message as spam.", + "type": "boolean" + }, + "unsubscribe": { + "description": "Recipient clicked on message's subscription management link. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "url": { + "description": "The URL that you want the event webhook to POST to.", + "type": "string" + } + }, + "required": [ + "enabled", + "url", + "group_resubscribe", + "delivered", + "group_unsubscribe", + "spam_report", + "bounce", + "deferred", + "unsubscribe", + "processed", + "open", + "click", + "dropped" + ], + "title": "Webhooks: Event Webhook Response", + "type": "object", + "x-stoplight": { + "id": "event-webhook-response", + "name": "Webhooks: Event Webhook Response", + "public": true + } + }, + "event-webhook-update-oauth-request": { + "properties": { + "bounce": { + "description": "Receiving server could not or would not accept message.", + "type": "boolean" + }, + "click": { + "description": "Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event.", + "type": "boolean" + }, + "deferred": { + "description": "Recipient's email server temporarily rejected message.", + "type": "boolean" + }, + "delivered": { + "description": "Message has been successfully delivered to the receiving server.", + "type": "boolean" + }, + "dropped": { + "description": "You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota", + "type": "boolean" + }, + "enabled": { + "description": "Indicates if the event webhook is enabled.", + "type": "boolean" + }, + "group_resubscribe": { + "description": "Recipient resubscribes to specific group by updating preferences. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "group_unsubscribe": { + "description": "Recipient unsubscribe from specific group, by either direct link or updating preferences. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "oauth_client_id": { + "description": "The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token. When passing data in this field, you must also include the oauth_token_url field.", + "type": "string" + }, + "oauth_client_secret": { + "description": "This secret is needed only once to create an access token. SendGrid will store this secret, allowing you to update your Client ID and Token URL without passing the secret to SendGrid again. When passing data in this field, you must also include the oauth_client_id and oauth_token_url fields.", + "type": "string" + }, + "oauth_token_url": { + "description": "The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the oauth_client_id field.", + "type": "string" + }, + "open": { + "description": "Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event.", + "type": "boolean" + }, + "processed": { + "description": "Message has been received and is ready to be delivered.", + "type": "boolean" + }, + "spam_report": { + "description": "Recipient marked a message as spam.", + "type": "boolean" + }, + "unsubscribe": { + "description": "Recipient clicked on message's subscription management link. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "url": { + "description": "The URL that you want the event webhook to POST to.", + "type": "string" + } + }, + "required": [ + "enabled", + "url", + "group_resubscribe", + "delivered", + "group_unsubscribe", + "spam_report", + "bounce", + "deferred", + "unsubscribe", + "processed", + "open", + "click", + "dropped" + ], + "title": "Webhooks: Event Webhook Update with OAuth Request", + "type": "object", + "x-stoplight": { + "id": "event-webhook-update-oauth-request", + "name": "Webhooks: Event Webhook Update with OAuth Request", + "public": true + } + }, + "from_email_object": { + "example": { + "email": "jane_doe@example.com", + "name": "Jane Doe" + }, + "properties": { + "email": { + "description": "The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account.", + "format": "email", + "type": "string" + }, + "name": { + "description": "A name or title associated with the sending email address.", + "type": "string" + } + }, + "required": [ + "email" + ], + "title": "From Email Object", + "type": "object", + "x-stoplight": { + "id": "from_email_object", + "name": "From Email Object", + "public": true + } + }, + "full-segment": { + "allOf": [ + { + "$ref": "#/components/schemas/segment_summary" + }, + { + "properties": { + "contacts_sample": { + "items": { + "$ref": "#/components/schemas/contact_response" + }, + "type": "array" + }, + "query_json": { + "description": "AST representation of the query DSL", + "type": "object" + } + }, + "required": [ + "contacts_sample" + ], + "type": "object" + }, + { + "$ref": "#/components/schemas/segment_write_v2" + } + ], + "example": { + "contacts_count": 9266921, + "contacts_sample": [ + { + "address_line_1": "sunt aliqua", + "address_line_2": "sit proident Lorem veniam labore", + "alternate_emails": [ + "yKDUP11FDch@QoU.vwy", + "ZNSN5@czAMqPi.at", + "7wr51kFVVKlcBSH@DWxOueOZepetzBrku.qosk", + "iib-ObtO7Fxz5@vLJPRIFKPOqJGCEqcIDab.ypn" + ], + "city": "œȎţȸÛ\tč\u000bCŁ", + "contact_id": "c1183ada-b784-49ac-9b1f-50e73578a6dc", + "country": "do reprehenderit qui", + "custom_fields": { + "custom_field_name1": "esse", + "custom_field_name2": "in consectetur ut aliqua sint" + }, + "first_name": "est", + "last_name": "eiusmod in laboris velit cupidatat", + "postal_code": 30296612, + "primary_email": "ft88@d.izxx", + "state_province_region": "ut proident" + } + ], + "created_at": "2085-08-08T21:07:05.692Z", + "id": "58567a46-305e-48d1-b4f8-a006c906920e", + "name": "culpa", + "next_sample_update": "", + "parent_list_id": "2357714d-3d82-4c80-826c-b44a4147f81c", + "query_dsl": "cillum eiusmod", + "sample_updated_at": "3407-09-25T04:25:02.140Z", + "updated_at": "4431-05-07T22:23:22.352Z" + }, + "title": "full_segment", + "x-stoplight": { + "id": "full-segment", + "name": "full_segment", + "public": true + } + }, + "global_empty_request": { + "nullable": true, + "title": "Global: Request Empty Body", + "x-stoplight": { + "id": "global:empty_request", + "name": "Global: Request Empty Body", + "public": true + } + }, + "global_error_response_schema": { + "example": { + "errors": [ + { + "field": "field_name", + "message": "error message" + } + ] + }, + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "description": "the field that generated the error", + "nullable": true, + "type": "string" + }, + "help": { + "description": "helper text or docs for troubleshooting", + "type": "object" + }, + "message": { + "description": "the error message", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + }, + "id": { + "type": "string" + } + }, + "title": "Global Error Response Schema", + "type": "object", + "x-stoplight": { + "id": "global_error_response_schema", + "name": "Global Error Response Schema", + "public": true + } + }, + "global_id": { + "title": "Global: ID", + "type": "integer", + "x-stoplight": { + "id": "global:id", + "name": "Global: ID", + "public": true + } + }, + "google_analytics_settings": { + "example": { + "enabled": true, + "utm_campaign": "website", + "utm_content": "", + "utm_medium": "email", + "utm_source": "sendgrid.com", + "utm_term": "" + }, + "properties": { + "enabled": { + "description": "Indicates if Google Analytics is enabled.", + "type": "boolean" + }, + "utm_campaign": { + "description": "The name of the campaign.", + "type": "string" + }, + "utm_content": { + "description": "Used to differentiate ads", + "type": "string" + }, + "utm_medium": { + "description": "Name of the marketing medium (e.g. \"Email\").", + "type": "string" + }, + "utm_source": { + "description": "Name of the referrer source. ", + "type": "string" + }, + "utm_term": { + "description": "Any paid keywords.", + "type": "string" + } + }, + "title": "Settings: Google Analytics", + "type": "object", + "x-stoplight": { + "id": "google_analytics_settings", + "name": "Settings: Google Analytics", + "public": true + } + }, + "invalid-email": { + "example": { + "created": 1620141015, + "email": "invalid@example.com", + "reason": "Mail domain mentioned in email address is unknown" + }, + "properties": { + "created": { + "description": "A Unix timestamp indicating when the email address was added to the invalid emails list.", + "type": "integer" + }, + "email": { + "description": "The email address that was marked as invalid.", + "format": "email", + "type": "string" + }, + "reason": { + "description": "The reason that the email address was marked as invalid.", + "type": "string" + } + }, + "title": "Invalid Email", + "type": "object", + "x-stoplight": { + "id": "invalid-email", + "name": "Invalid Email", + "public": true + } + }, + "ip-access-response": { + "example": { + "result": [ + { + "created_at": 1441824715, + "id": 1, + "ip": "192.168.1.1/32", + "updated_at": 1441824715 + }, + { + "created_at": 1441824715, + "id": 2, + "ip": "192.0.0.0/8", + "updated_at": 1441824715 + }, + { + "created_at": 1441824715, + "id": 3, + "ip": "192.168.1.3/32", + "updated_at": 1441824715 + } + ] + }, + "properties": { + "result": { + "description": "An array listing all of your allowed IPs.", + "items": { + "properties": { + "created_at": { + "description": "A Unix timestamp indicating when the IP was added to the allow list.", + "type": "integer" + }, + "id": { + "description": "The ID of the allowed IP.", + "type": "integer" + }, + "ip": { + "description": "The allowed IP.", + "type": "string" + }, + "updated_at": { + "description": "A Unix timestamp indicating when the IPs allow status was most recently updated.", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "title": "IP Access Response", + "type": "object", + "x-stoplight": { + "id": "ip-access-response", + "name": "IP Access Response", + "public": true + } + }, + "ip_pool": { + "properties": { + "name": { + "description": "The name of the IP pool.", + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "IP Pools: Pool", + "type": "object", + "x-stoplight": { + "id": "ip_pool", + "name": "IP Pools: Pool", + "public": true + } + }, + "ip_pool_response": { + "example": { + "name": "sunt sint enim" + }, + "properties": { + "name": { + "description": "The name of the IP pool.", + "type": "string" + } + }, + "title": "IP Pools: Pool Resp", + "type": "object", + "x-stoplight": { + "id": "ip_pool_response", + "name": "IP Pools: Pool Resp", + "public": true + } + }, + "ip_warmup_response": { + "example": [ + { + "ip": "0.0.0.0", + "start_date": 1409616000 + } + ], + "items": { + "properties": { + "ip": { + "description": "The IP address.", + "type": "string" + }, + "start_date": { + "description": "A Unix timestamp indicating when the IP address entered warmup mode.", + "type": "integer" + } + }, + "required": [ + "ip", + "start_date" + ], + "type": "object" + }, + "title": "IP Warmup: IP", + "type": "array", + "x-stoplight": { + "id": "ip_warmup_response", + "name": "IP Warmup: IP", + "public": true + } + }, + "link": { + "properties": { + "href": { + "type": "string" + }, + "rel": { + "type": "string" + } + }, + "title": "Link", + "type": "object", + "x-stoplight": { + "id": "link", + "name": "Link", + "public": true + } + }, + "link-tracking-metadata": { + "properties": { + "count": { + "description": "The number of items in the entire list, i.e., across all pages.", + "type": "number" + }, + "next": { + "description": "The URL of the next page of results. If this field isn't present, you're at the end of the list.", + "format": "uri", + "type": "string" + }, + "prev": { + "description": "The URL of the previous page of results. If this field isn't present, you're at the start of the list.", + "format": "uri", + "type": "string" + }, + "self": { + "description": "The URL of the current page of results.", + "format": "uri", + "type": "string" + } + }, + "title": "link tracking metadata", + "type": "object", + "x-stoplight": { + "id": "link-tracking-metadata", + "name": "link tracking metadata", + "public": true + } + }, + "link_branding_200_response": { + "properties": { + "default": { + "description": "Indicates if this is the default link branding.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "dns": { + "description": "The DNS records generated for this link branding.", + "properties": { + "domain_cname": { + "description": "The DNS record generated to point to your link branding subdomain.", + "properties": { + "data": { + "description": "The domain that the DNS record points to.", + "type": "string" + }, + "host": { + "description": "The domain that this link branding will use for the links in your email.", + "type": "string" + }, + "type": { + "description": "The type of DNS record that was generated.", + "enum": [ + "cname", + "txt", + "mx" + ], + "type": "string" + }, + "valid": { + "description": "Indicates if the DNS record is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "required": [ + "valid", + "type", + "host", + "data" + ], + "type": "object" + }, + "owner_cname": { + "description": "The DNS record generated to verify who created the link branding.", + "properties": { + "data": { + "description": "The domain that the DNS record points to.", + "type": "string" + }, + "host": { + "description": "Used to verify the link branding. The subdomain of this domain is the ID of the user who created the link branding.", + "type": "string" + }, + "type": { + "description": "The type of DNS record generated.", + "enum": [ + "cname", + "txt", + "mx" + ], + "type": "string" + }, + "valid": { + "description": "Indicates if the DNS record is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "required": [ + "valid", + "host", + "data" + ], + "type": "object" + } + }, + "required": [ + "domain_cname" + ], + "type": "object" + }, + "domain": { + "description": "The root domain of the branded link.", + "type": "string" + }, + "id": { + "description": "The ID of the branded link.", + "type": "integer" + }, + "legacy": { + "description": "Indicates if this link branding was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create new link branding if you need to update it.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "subdomain": { + "description": "The subdomain used to generate the DNS records for this link branding. This subdomain must be different from the subdomain used for your authenticated domain.", + "type": "string" + }, + "user_id": { + "description": "The ID of the user that this link branding is associated with.", + "type": "integer" + }, + "username": { + "description": "The username of the account that this link branding is associated with.", + "type": "string" + }, + "valid": { + "description": "Indicates if this link branding is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "required": [ + "id", + "domain", + "username", + "user_id", + "default", + "valid", + "legacy", + "dns" + ], + "title": "Link Branding 200 Response", + "type": "object", + "x-stoplight": { + "id": "link_branding_200_response", + "name": "Link Branding 200 Response", + "public": true + } + }, + "list": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/selfmetadata" + }, + "contact_count": { + "description": "The number of contacts currently stored on the list.", + "type": "integer" + }, + "id": { + "description": "The generated ID for your list.", + "maxLength": 36, + "minLength": 36, + "type": "string" + }, + "name": { + "description": "The name you gave your list.", + "type": "string" + } + }, + "title": "list", + "type": "object", + "x-stoplight": { + "id": "list", + "name": "list", + "public": true + } + }, + "mail_batch_id": { + "example": { + "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi" + }, + "properties": { + "batch_id": { + "pattern": "^[a-zA-Z0-9\\-\\_]", + "type": "string" + } + }, + "required": [ + "batch_id" + ], + "title": "Mail Batch ID", + "type": "object", + "x-stoplight": { + "id": "mail_batch_id", + "name": "Mail Batch ID", + "public": true + } + }, + "mail_settings_address_whitelabel": { + "example": { + "enabled": true, + "list": [ + "email1@example.com", + "example.com" + ] + }, + "properties": { + "enabled": { + "description": "Indicates if you have an email address whitelist enabled. ", + "type": "boolean" + }, + "list": { + "description": "All email addresses that are currently on the whitelist.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "title": "Mail Settings: Address Whitelabel", + "type": "object", + "x-stoplight": { + "id": "mail_settings_address_whitelabel", + "name": "Mail Settings: Address Whitelabel", + "public": true + } + }, + "mail_settings_bounce_purge": { + "example": { + "enabled": false, + "hard_bounces": null, + "soft_bounces": 1234 + }, + "properties": { + "enabled": { + "description": "Indicates if the bounce purge mail setting is enabled.", + "type": "boolean" + }, + "hard_bounces": { + "description": "The number of days after which SendGrid will purge all contacts from your hard bounces suppression lists.", + "nullable": true, + "type": "integer" + }, + "soft_bounces": { + "description": "The number of days after which SendGrid will purge all contacts from your soft bounces suppression lists.", + "nullable": true, + "type": "integer" + } + }, + "title": "Mail Settings: Bounce Purge", + "type": "object", + "x-stoplight": { + "id": "mail_settings_bounce_purge", + "name": "Mail Settings: Bounce Purge", + "public": true + } + }, + "mail_settings_footer": { + "example": { + "enabled": true, + "html_content": "Example HTML content", + "plain_content": "Example plain content" + }, + "properties": { + "enabled": { + "description": "Indicates if the Footer mail setting is currently enabled.", + "type": "boolean" + }, + "html_content": { + "description": "The custom HTML content of your email footer.", + "type": "string" + }, + "plain_content": { + "description": "The plain text content of your email footer.", + "type": "string" + } + }, + "title": "Mail Settings: Footer", + "type": "object", + "x-stoplight": { + "id": "mail_settings_footer", + "name": "Mail Settings: Footer", + "public": true + } + }, + "mail_settings_forward_bounce": { + "example": { + "email": null, + "enabled": false + }, + "properties": { + "email": { + "description": "The email address that you would like your bounce reports forwarded to.", + "nullable": true, + "type": "string" + }, + "enabled": { + "description": "Indicates if the bounce forwarding mail setting is enabled.", + "type": "boolean" + } + }, + "title": "Mail Settings: Forward Bounce", + "type": "object", + "x-stoplight": { + "id": "mail_settings_forward_bounce", + "name": "Mail Settings: Forward Bounce", + "public": true + } + }, + "mail_settings_forward_spam": { + "example": { + "email": "", + "enabled": true + }, + "properties": { + "email": { + "description": "The email address where you would like the spam reports to be forwarded.", + "type": "string" + }, + "enabled": { + "description": "Indicates if the Forward Spam setting is enabled.", + "type": "boolean" + } + }, + "title": "Mail Settings: Forward Spam", + "type": "object", + "x-stoplight": { + "id": "mail_settings_forward_spam", + "name": "Mail Settings: Forward Spam", + "public": true + } + }, + "mail_settings_patch": { + "example": { + "email": "email@example.com", + "enabled": true + }, + "properties": { + "email": { + "description": "The email address of the recipient.", + "type": "string" + }, + "enabled": { + "description": "Indicates if the mail setting is enabled.", + "type": "boolean" + } + }, + "title": "Mail Settings: Patch", + "type": "object", + "x-stoplight": { + "id": "mail_settings_patch", + "name": "Mail Settings: Patch", + "public": true + } + }, + "mail_settings_template": { + "example": { + "enabled": false, + "html_content": "

<% body %>Example

\n" + }, + "properties": { + "enabled": { + "description": "Indicates if the legacy email template setting is enabled.", + "type": "boolean" + }, + "html_content": { + "description": "The HTML content that you want to use for your legacy email template.", + "type": "string" + } + }, + "title": "Mail Settings: Template", + "type": "object", + "x-stoplight": { + "id": "mail_settings_template", + "name": "Mail Settings: Template", + "public": true + } + }, + "mako_event": { + "example": { + "bounce_type": "blocked", + "event_name": "bounced", + "http_user_agent": "in tempor ex dolore est", + "mx_server": "quis proident", + "processed": "2017-10-13T18:56:21Z", + "reason": "some reason", + "url": "http://3LX,MU}N=B8'd,K}>bEma{l~!ad%peIF}y>qHfLPWQ$l9b\\!6.1H?$Z9H\"il-_gZD>/JPYsGqH4x4_3v090TCtnFalXGFiAdooDxgrDAYNXShUywSxwYr8gKeyc/4sal4VJ3IxEWsG74V5MYQ0mz27jhy7n5DHsUtApQ6zXHS13uO5vYBlJHpJRfuT6/F5nIpkHre2w3eTtN7M6pg9V5stjnnsavKkzQxyTv15CMSDLFwR_BTZwofhWpyBU7B9ypYL79vT97N3LDZyoaM/fNsOLPIqfGBer_Mx9_StergbQYANyOmOSjR6pZof01ky/ZcNDhpu3CkSl4MTtQ3NMCX780pOKQ5SYIPigyvz9IC9WtrCNcOkTxdOPdY0_4MJU4EuTTPmGvO/14KaJCDjIjgrbIqpzuUEL5mET0t2VeVlwvtnOnlHaBE8sic20ze2E0Xt3ETqXyzVJRjLDKh/LWkW8OVp_xkLBCCW7LQngRukKcOiWjMXeCEhYI9HoZ0RsMEWZC8KzRaHc4OI0uXPD4M9pav1LGrI/_0t_RnBnfnqGKsBJr0kdQi/Y6QN_aeawIqX5hDNIU3MF/wWKVWLS0ZFbDfK6KVv5oAid83EpwKoazAMA8MTfEXvHQLO7k7XYWX1Il3eGXL6/wCA96I1SOabzJkZHo2HsFpIC/VBk52Lnpp0xtDH/OCdlQ5e4PpxXQeklp70LPOndr7QKSYEQNUc48n36ixvTjhgpgO8wHsFFYqGcuBMHg9oaCARppQomiQDWYuVPVDynJHdsM1_gWl4/NSs8Y9PL7DrQXOu0UiFRRE0TUsvgqyUgJzlGjUnRziyYeROO75D0K_3aTtbGbCmhaxecos40a1w0PDCNkFp1W/iHwY7922drhsoM6ShwqqwGpAh5HLuU6Q5gqyckeai6YN7HCh9DdHPhhJcatgtMHZDKfQUBVt9ecUlDgiCFF_OnRX/GpzttcsL8E2FoXL9_eAWvSqjodROqx7MZCA/ORdnR/IssPCYP1kTHTIL5mZxv4UGEpyNjUzt4GdSJJTm0nztltWDYX8_Ezl2JvpLVnGVTJxobb4yQIJhe3n64khbOFyFLKHWEniIolm/AxpZQYmseWlVqrIz3YXU59XaSbTTrdCHNhvwF1ogXiiggN6TZ2B3QY_mBEtAp/SD0ONPVqEUkTNAFWTgnnlv6ZIMdMbTw5uZwtFRlB7qDvQouml9kujGmRu6k7zZMTOwWowRNtpboLUcL2NzkVgK6N1Zi2vq/Nt4NJvM5_l1dpIIbwJv_CIcZQZOqPtRWULa2iVxfmJJQaqgLQPwSHQH1zuRJMhraEsPjqVQRC0pZpSt/24VBDN8y31Ye/y_ekWxMdZCvr978C/WrdcTi29kxjJLyT9BII7BsgT5vLuI2l7ntqRAhAUWMs/h9JR0i8RbX5OfB46q41/TfmSdgi97bCR2HfgflyypXwKhRfKYU2MVpu2Dd90WQUlm7hZV8dSfGusuMj/nPMpRVWcbnvlAdsehJCPbLv6n4qdLSPeoMBo32acAGgu1BwBG8JsBgbH43yYi5X7UdGRWKqm_ZbqaDEKH3ncU/uA8EOJb41VfGho4LUeOi1IeYwVAhFEyO6YbteYZecEubrNFZrWWjZUqhzouzY95TeWU8E4StCXVPKlYPiFiwUSX20kG0lVtDbAy/7u4f4x0cYlFOvI1UN1qoOExmNxnxzQQFeM5exWfW2JrRXq5e0UdAJr4q2o9Y_0WaGfhL/nP6Ei06YajDKr11dK5H0LX/9CGTC37HFZeopyopzP_7fvGFkqIRoGTS48pLaIFz3gwpQNlWXUFCsd/PnRlsqJ3SBQSgp_AQe2cP6iBNy2bJI8lkxwY5YVDDdjxusuCcafdjfs2aUa/4tr_iMnNBnd27GxjQI28_JGJlfbOaajVJOxuPMT4ELpYCfPiFjdSbJyE0/gCwtj0rgDKSLWJnOPJ5TAJ935gCqeIsBhOhfcZX413GdilBZRRYEjCVKfOuWzHZ3GW/8yjyk5e_WMNv5F6xggl07w90DBwpx/Q/iWfncqMuSfoeFeqHQkDL9F5W19j1cGuAcyfIYMAXztHXpgTKh9vZcsLYC7LcgKr4FQj3JjEvtnDG2PjcMjGF/MnbCRCz22Ho410_vE9M1Hpq0wdk_i5DbZKNoSwlPgey9URkpuX146TcDdsx_VWDenCepY5HwMr9CPOY9hzUs/c5AWeUMXk/gvsI81Jkv5rHpEnNBUZXYzfqkwQfffhmrc/StLCtzRRlja8dpsEWdkzoKR9Kdxq1qAs5f0sdrGjVRLTT_s1Q2P59zhA/QmS4bubi64cYot3gSIgdNnkjA2GjCp1ETVa548_U9B6boTKDVmaKJlVIDvqL84RC3WI7Er/8opi2lZ48W83Ur47BRh38oOnI0agrCyZz8bp1w_gfVRlSO8PS0i/l_/qxq5xpLbhPkdxVoyZVsNAZchfnmkIHyIk5IK6EUDXdMR21y6OvKW50ZbooAtk9ymynBj4dAYMsd25RV7FE1I1vRTsiDw52/.E5WC0Ymo2zn.qelSbhzr-4laArYiWP.dwJB6qm_6rs0Rm5UXYaYtUNbh76_jJp_X1xQUCDSgbr2KOkDU0\"Q/-4dV\"Yk3QGg[(O86=Pf\"e17K4'r{)kicofHSXcMmP@>VF^`~4j4F*L/1]tD+Lw!WI!@]*OZm6C`M$u96}*ObEma{l~!ad%peIF}y>qHfLPWQ$l9b\\!6.1H?$Z9H\"il-_gZD>/JPYsGqH4x4_3v090TCtnFalXGFiAdooDxgrDAYNXShUywSxwYr8gKeyc/4sal4VJ3IxEWsG74V5MYQ0mz27jhy7n5DHsUtApQ6zXHS13uO5vYBlJHpJRfuT6/F5nIpkHre2w3eTtN7M6pg9V5stjnnsavKkzQxyTv15CMSDLFwR_BTZwofhWpyBU7B9ypYL79vT97N3LDZyoaM/fNsOLPIqfGBer_Mx9_StergbQYANyOmOSjR6pZof01ky/ZcNDhpu3CkSl4MTtQ3NMCX780pOKQ5SYIPigyvz9IC9WtrCNcOkTxdOPdY0_4MJU4EuTTPmGvO/14KaJCDjIjgrbIqpzuUEL5mET0t2VeVlwvtnOnlHaBE8sic20ze2E0Xt3ETqXyzVJRjLDKh/LWkW8OVp_xkLBCCW7LQngRukKcOiWjMXeCEhYI9HoZ0RsMEWZC8KzRaHc4OI0uXPD4M9pav1LGrI/_0t_RnBnfnqGKsBJr0kdQi/Y6QN_aeawIqX5hDNIU3MF/wWKVWLS0ZFbDfK6KVv5oAid83EpwKoazAMA8MTfEXvHQLO7k7XYWX1Il3eGXL6/wCA96I1SOabzJkZHo2HsFpIC/VBk52Lnpp0xtDH/OCdlQ5e4PpxXQeklp70LPOndr7QKSYEQNUc48n36ixvTjhgpgO8wHsFFYqGcuBMHg9oaCARppQomiQDWYuVPVDynJHdsM1_gWl4/NSs8Y9PL7DrQXOu0UiFRRE0TUsvgqyUgJzlGjUnRziyYeROO75D0K_3aTtbGbCmhaxecos40a1w0PDCNkFp1W/iHwY7922drhsoM6ShwqqwGpAh5HLuU6Q5gqyckeai6YN7HCh9DdHPhhJcatgtMHZDKfQUBVt9ecUlDgiCFF_OnRX/GpzttcsL8E2FoXL9_eAWvSqjodROqx7MZCA/ORdnR/IssPCYP1kTHTIL5mZxv4UGEpyNjUzt4GdSJJTm0nztltWDYX8_Ezl2JvpLVnGVTJxobb4yQIJhe3n64khbOFyFLKHWEniIolm/AxpZQYmseWlVqrIz3YXU59XaSbTTrdCHNhvwF1ogXiiggN6TZ2B3QY_mBEtAp/SD0ONPVqEUkTNAFWTgnnlv6ZIMdMbTw5uZwtFRlB7qDvQouml9kujGmRu6k7zZMTOwWowRNtpboLUcL2NzkVgK6N1Zi2vq/Nt4NJvM5_l1dpIIbwJv_CIcZQZOqPtRWULa2iVxfmJJQaqgLQPwSHQH1zuRJMhraEsPjqVQRC0pZpSt/24VBDN8y31Ye/y_ekWxMdZCvr978C/WrdcTi29kxjJLyT9BII7BsgT5vLuI2l7ntqRAhAUWMs/h9JR0i8RbX5OfB46q41/TfmSdgi97bCR2HfgflyypXwKhRfKYU2MVpu2Dd90WQUlm7hZV8dSfGusuMj/nPMpRVWcbnvlAdsehJCPbLv6n4qdLSPeoMBo32acAGgu1BwBG8JsBgbH43yYi5X7UdGRWKqm_ZbqaDEKH3ncU/uA8EOJb41VfGho4LUeOi1IeYwVAhFEyO6YbteYZecEubrNFZrWWjZUqhzouzY95TeWU8E4StCXVPKlYPiFiwUSX20kG0lVtDbAy/7u4f4x0cYlFOvI1UN1qoOExmNxnxzQQFeM5exWfW2JrRXq5e0UdAJr4q2o9Y_0WaGfhL/nP6Ei06YajDKr11dK5H0LX/9CGTC37HFZeopyopzP_7fvGFkqIRoGTS48pLaIFz3gwpQNlWXUFCsd/PnRlsqJ3SBQSgp_AQe2cP6iBNy2bJI8lkxwY5YVDDdjxusuCcafdjfs2aUa/4tr_iMnNBnd27GxjQI28_JGJlfbOaajVJOxuPMT4ELpYCfPiFjdSbJyE0/gCwtj0rgDKSLWJnOPJ5TAJ935gCqeIsBhOhfcZX413GdilBZRRYEjCVKfOuWzHZ3GW/8yjyk5e_WMNv5F6xggl07w90DBwpx/Q/iWfncqMuSfoeFeqHQkDL9F5W19j1cGuAcyfIYMAXztHXpgTKh9vZcsLYC7LcgKr4FQj3JjEvtnDG2PjcMjGF/MnbCRCz22Ho410_vE9M1Hpq0wdk_i5DbZKNoSwlPgey9URkpuX146TcDdsx_VWDenCepY5HwMr9CPOY9hzUs/c5AWeUMXk/gvsI81Jkv5rHpEnNBUZXYzfqkwQfffhmrc/StLCtzRRlja8dpsEWdkzoKR9Kdxq1qAs5f0sdrGjVRLTT_s1Q2P59zhA/QmS4bubi64cYot3gSIgdNnkjA2GjCp1ETVa548_U9B6boTKDVmaKJlVIDvqL84RC3WI7Er/8opi2lZ48W83Ur47BRh38oOnI0agrCyZz8bp1w_gfVRlSO8PS0i/l_/qxq5xpLbhPkdxVoyZVsNAZchfnmkIHyIk5IK6EUDXdMR21y6OvKW50ZbooAtk9ymynBj4dAYMsd25RV7FE1I1vRTsiDw52/.E5WC0Ymo2zn.qelSbhzr-4laArYiWP.dwJB6qm_6rs0Rm5UXYaYtUNbh76_jJp_X1xQUCDSgbr2KOkDU0\"Q/-4dV\"Yk3QGg[(O86=Pf\"e17K4'r{)kicofHSXcMmP@>VF^`~4j4F*L/1]tD+Lw!WI!@]*OZm6C`M$u96}*ObEma{l~!ad%peIF}y>qHfLPWQ$l9b\\!6.1H?$Z9H\"il-_gZD>/JPYsGqH4x4_3v090TCtnFalXGFiAdooDxgrDAYNXShUywSxwYr8gKeyc/4sal4VJ3IxEWsG74V5MYQ0mz27jhy7n5DHsUtApQ6zXHS13uO5vYBlJHpJRfuT6/F5nIpkHre2w3eTtN7M6pg9V5stjnnsavKkzQxyTv15CMSDLFwR_BTZwofhWpyBU7B9ypYL79vT97N3LDZyoaM/fNsOLPIqfGBer_Mx9_StergbQYANyOmOSjR6pZof01ky/ZcNDhpu3CkSl4MTtQ3NMCX780pOKQ5SYIPigyvz9IC9WtrCNcOkTxdOPdY0_4MJU4EuTTPmGvO/14KaJCDjIjgrbIqpzuUEL5mET0t2VeVlwvtnOnlHaBE8sic20ze2E0Xt3ETqXyzVJRjLDKh/LWkW8OVp_xkLBCCW7LQngRukKcOiWjMXeCEhYI9HoZ0RsMEWZC8KzRaHc4OI0uXPD4M9pav1LGrI/_0t_RnBnfnqGKsBJr0kdQi/Y6QN_aeawIqX5hDNIU3MF/wWKVWLS0ZFbDfK6KVv5oAid83EpwKoazAMA8MTfEXvHQLO7k7XYWX1Il3eGXL6/wCA96I1SOabzJkZHo2HsFpIC/VBk52Lnpp0xtDH/OCdlQ5e4PpxXQeklp70LPOndr7QKSYEQNUc48n36ixvTjhgpgO8wHsFFYqGcuBMHg9oaCARppQomiQDWYuVPVDynJHdsM1_gWl4/NSs8Y9PL7DrQXOu0UiFRRE0TUsvgqyUgJzlGjUnRziyYeROO75D0K_3aTtbGbCmhaxecos40a1w0PDCNkFp1W/iHwY7922drhsoM6ShwqqwGpAh5HLuU6Q5gqyckeai6YN7HCh9DdHPhhJcatgtMHZDKfQUBVt9ecUlDgiCFF_OnRX/GpzttcsL8E2FoXL9_eAWvSqjodROqx7MZCA/ORdnR/IssPCYP1kTHTIL5mZxv4UGEpyNjUzt4GdSJJTm0nztltWDYX8_Ezl2JvpLVnGVTJxobb4yQIJhe3n64khbOFyFLKHWEniIolm/AxpZQYmseWlVqrIz3YXU59XaSbTTrdCHNhvwF1ogXiiggN6TZ2B3QY_mBEtAp/SD0ONPVqEUkTNAFWTgnnlv6ZIMdMbTw5uZwtFRlB7qDvQouml9kujGmRu6k7zZMTOwWowRNtpboLUcL2NzkVgK6N1Zi2vq/Nt4NJvM5_l1dpIIbwJv_CIcZQZOqPtRWULa2iVxfmJJQaqgLQPwSHQH1zuRJMhraEsPjqVQRC0pZpSt/24VBDN8y31Ye/y_ekWxMdZCvr978C/WrdcTi29kxjJLyT9BII7BsgT5vLuI2l7ntqRAhAUWMs/h9JR0i8RbX5OfB46q41/TfmSdgi97bCR2HfgflyypXwKhRfKYU2MVpu2Dd90WQUlm7hZV8dSfGusuMj/nPMpRVWcbnvlAdsehJCPbLv6n4qdLSPeoMBo32acAGgu1BwBG8JsBgbH43yYi5X7UdGRWKqm_ZbqaDEKH3ncU/uA8EOJb41VfGho4LUeOi1IeYwVAhFEyO6YbteYZecEubrNFZrWWjZUqhzouzY95TeWU8E4StCXVPKlYPiFiwUSX20kG0lVtDbAy/7u4f4x0cYlFOvI1UN1qoOExmNxnxzQQFeM5exWfW2JrRXq5e0UdAJr4q2o9Y_0WaGfhL/nP6Ei06YajDKr11dK5H0LX/9CGTC37HFZeopyopzP_7fvGFkqIRoGTS48pLaIFz3gwpQNlWXUFCsd/PnRlsqJ3SBQSgp_AQe2cP6iBNy2bJI8lkxwY5YVDDdjxusuCcafdjfs2aUa/4tr_iMnNBnd27GxjQI28_JGJlfbOaajVJOxuPMT4ELpYCfPiFjdSbJyE0/gCwtj0rgDKSLWJnOPJ5TAJ935gCqeIsBhOhfcZX413GdilBZRRYEjCVKfOuWzHZ3GW/8yjyk5e_WMNv5F6xggl07w90DBwpx/Q/iWfncqMuSfoeFeqHQkDL9F5W19j1cGuAcyfIYMAXztHXpgTKh9vZcsLYC7LcgKr4FQj3JjEvtnDG2PjcMjGF/MnbCRCz22Ho410_vE9M1Hpq0wdk_i5DbZKNoSwlPgey9URkpuX146TcDdsx_VWDenCepY5HwMr9CPOY9hzUs/c5AWeUMXk/gvsI81Jkv5rHpEnNBUZXYzfqkwQfffhmrc/StLCtzRRlja8dpsEWdkzoKR9Kdxq1qAs5f0sdrGjVRLTT_s1Q2P59zhA/QmS4bubi64cYot3gSIgdNnkjA2GjCp1ETVa548_U9B6boTKDVmaKJlVIDvqL84RC3WI7Er/8opi2lZ48W83Ur47BRh38oOnI0agrCyZz8bp1w_gfVRlSO8PS0i/l_/qxq5xpLbhPkdxVoyZVsNAZchfnmkIHyIk5IK6EUDXdMR21y6OvKW50ZbooAtk9ymynBj4dAYMsd25RV7FE1I1vRTsiDw52/.E5WC0Ymo2zn.qelSbhzr-4laArYiWP.dwJB6qm_6rs0Rm5UXYaYtUNbh76_jJp_X1xQUCDSgbr2KOkDU0\"Q/-4dV\"Yk3QGg[(O86=Pf\"e17K4'r{)kicofHSXcMmP@>VF^`~4j4F*L/1]tD+Lw!WI!@]*OZm6C`M$u96}*O" + }, + "properties": { + "id": { + "description": "A unique ID assigned to the certificate by SendGrid.", + "type": "number" + }, + "intergration_id": { + "description": "An ID that matches a certificate to a specific IdP integration.", + "type": "string" + }, + "not_after": { + "description": "A unix timestamp (e.g., 1603915954) that indicates the time after which the certificate is no longer valid.", + "type": "number" + }, + "not_before": { + "description": "A unix timestamp (e.g., 1603915954) that indicates the time before which the certificate is not valid.", + "type": "number" + }, + "public_certificate": { + "description": "This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta. This is called the X509 certificate in the Twilio SendGrid UI.", + "type": "string" + } + }, + "title": "Single Sign-On Certificate Body", + "type": "object", + "x-stoplight": { + "id": "sso-certificate-body", + "name": "Single Sign-On Certificate Body", + "public": true + } + }, + "sso-error-response": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "title": "SSO Error Response", + "type": "array", + "x-stoplight": { + "id": "sso-error-response", + "name": "SSO Error Response", + "public": true + } + }, + "sso-integration": { + "allOf": [ + { + "$ref": "#/components/schemas/create-integration-request" + }, + { + "properties": { + "audience_url": { + "description": "The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Single Sign-On URL when using SendGrid.", + "type": "string" + }, + "id": { + "description": "A unique ID assigned to the configuration by SendGrid.", + "type": "string" + }, + "last_updated": { + "description": "A timestamp representing the last time the configuration was modified.", + "type": "number" + }, + "single_signon_url": { + "description": "The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Audience URL when using SendGrid.", + "type": "string" + } + }, + "required": [ + "last_updated" + ], + "type": "object" + } + ], + "title": "Single Sign-On Integration", + "x-stoplight": { + "id": "sso-integration", + "name": "Single Sign-On Integration", + "public": true + } + }, + "sso-teammate-common-fields": { + "properties": { + "email": { + "description": "The Teammate’s email address. This email address will also function as the Teammate’s username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created.", + "format": "email", + "type": "string" + }, + "first_name": { + "description": "The Teammate’s first name.", + "type": "string" + }, + "is_admin": { + "description": "Indicates if the Teammate has admin permissions.", + "type": "boolean" + }, + "is_read_only": { + "description": "Indicates if the Teammate has read_only permissions.", + "type": "boolean" + }, + "last_name": { + "description": "The Teammate’s last name.", + "type": "string" + } + }, + "required": [ + "first_name", + "last_name", + "email" + ], + "title": "Single Sing-On Teammate Common Fields", + "type": "object", + "x-stoplight": { + "id": "sso-teammate-common-fields", + "name": "Single Sing-On Teammate Common Fields", + "public": true + } + }, + "sso-teammate-request": { + "allOf": [ + { + "$ref": "#/components/schemas/sso-teammate-common-fields" + }, + { + "properties": { + "scopes": { + "description": "The permission scopes assigned to the Teammate.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "scopes" + ], + "type": "object" + } + ], + "title": "Single Sign-On Teammate Request", + "x-stoplight": { + "id": "sso-teammate-request", + "name": "Single Sign-On Teammate Request", + "public": true + } + }, + "sso-teammate-response": { + "allOf": [ + { + "$ref": "#/components/schemas/sso-teammate-common-fields" + }, + { + "properties": { + "is_sso": { + "description": "Indicates if the Teammate authenticates with SendGrid using SSO or with a username and password.", + "type": "boolean" + }, + "username": { + "description": "This should be set to the Teammate's email address.", + "type": "string" + } + }, + "type": "object" + } + ], + "title": "Single Sign-On Teammate Response", + "x-stoplight": { + "id": "sso-teammate-response", + "name": "Single Sign-On Teammate Response", + "public": true + } + }, + "sso-teammates-patch-response": { + "allOf": [ + { + "$ref": "#/components/schemas/sso-teammate-response" + }, + { + "properties": { + "address": { + "description": "The Teammate’s street address.", + "type": "string" + }, + "address2": { + "description": "The Teammate’s apartment number, suite number, or other secondary address information that is not part of the physical street address.", + "type": "string" + }, + "city": { + "description": "The Teammate's city.", + "type": "string" + }, + "company": { + "description": "The Teammate’s company name.", + "type": "string" + }, + "country": { + "description": "The Teammate’s country of residence.", + "type": "string" + }, + "email": { + "format": "email", + "type": "string" + }, + "phone": { + "description": "The Teammate’s stored phone number.", + "type": "string" + }, + "scopes": { + "description": "The permission scopes assigned to the Teammate.", + "items": { + "type": "string" + }, + "type": "array" + }, + "state": { + "description": "The Teammate’s state or province.", + "type": "string" + }, + "user_type": { + "description": "A Teammate can be an “admin,” “owner,” or “teammate.” Each role is associated with the scope of the Teammate’s permissions.", + "enum": [ + "admin", + "owner", + "teammate" + ], + "type": "string" + }, + "website": { + "description": "A website associated with the Teammate", + "type": "string" + }, + "zip": { + "description": "The Teammate’s zip code.", + "type": "string" + } + }, + "type": "object" + } + ], + "title": "Single Sign-On Teammates PATCH Response", + "x-stoplight": { + "id": "sso-teammates-patch-response", + "name": "Single Sign-On Teammates PATCH Response", + "public": true + } + }, + "stats-advanced-global-stats": { + "allOf": [ + { + "$ref": "#/components/schemas/advanced_stats_clicks_opens" + }, + { + "properties": { + "blocks": { + "description": "The number of emails that were not allowed to be delivered by ISPs.", + "type": "integer" + }, + "bounce_drops": { + "description": "The number of emails that were dropped because of a bounce.", + "type": "integer" + }, + "bounces": { + "description": "The number of emails that bounced instead of being delivered.", + "type": "integer" + }, + "deferred": { + "description": "The number of emails that temporarily could not be delivered. ", + "type": "integer" + }, + "delivered": { + "description": "The number of emails SendGrid was able to confirm were actually delivered to a recipient.", + "type": "integer" + }, + "invalid_emails": { + "description": "The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid.", + "type": "integer" + }, + "processed": { + "description": "Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed.", + "type": "integer" + }, + "requests": { + "description": "The number of emails that were requested to be delivered.", + "type": "integer" + }, + "spam_report_drops": { + "description": "The number of emails that were dropped due to a recipient previously marking your emails as spam.", + "type": "integer" + }, + "spam_reports": { + "description": "The number of recipients who marked your email as spam.", + "type": "integer" + }, + "unsubscribe_drops": { + "description": "The number of emails dropped due to a recipient unsubscribing from your emails.", + "type": "integer" + }, + "unsubscribes": { + "description": "The number of recipients who unsubscribed from your emails.", + "type": "integer" + } + }, + "type": "object" + } + ], + "title": "Stats: Advanced Global Stats", + "x-stoplight": { + "id": "stats-advanced-global-stats", + "name": "Stats: Advanced Global Stats", + "public": true + } + }, + "stats-advanced-stats-base-schema": { + "items": { + "properties": { + "date": { + "description": "The date the stats were gathered.", + "type": "string" + }, + "stats": { + "description": "The individual email activity stats.", + "items": { + "properties": { + "metrics": { + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "title": "Stats: Advanced Stats Base Schema", + "type": "array", + "x-stoplight": { + "id": "stats-advanced-stats-base-schema", + "name": "Stats: Advanced Stats Base Schema", + "public": true + } + }, + "subscription_tracking_settings": { + "properties": { + "enabled": { + "description": "Indicates if subscription tracking is enabled.", + "type": "boolean" + }, + "html_content": { + "description": "The information and HTML for your unsubscribe link. ", + "type": "string" + }, + "landing": { + "description": "The HTML that will be displayed on the page that your customers will see after clicking unsubscribe, hosted on SendGrid’s server.", + "type": "string" + }, + "plain_content": { + "description": "The information in plain text for your unsubscribe link. You should have the “<% %>” tag in your content, otherwise the user will have no URL for unsubscribing.", + "type": "string" + }, + "replace": { + "description": "Your custom defined replacement tag for your templates. Use this tag to place your unsubscribe content anywhere in your emailtemplate.", + "type": "string" + }, + "url": { + "description": "The URL where you would like your users sent to unsubscribe.", + "format": "uri", + "type": "string" + } + }, + "title": "Settings: Subscription Tracking", + "type": "object", + "x-stoplight": { + "id": "subscription_tracking_settings", + "name": "Settings: Subscription Tracking", + "public": true + } + }, + "subuser": { + "example": { + "disabled": false, + "email": "example@example.com", + "id": 1234, + "username": "example_subuser" + }, + "properties": { + "disabled": { + "description": "Whether or not the user is enabled or disabled.", + "type": "boolean" + }, + "email": { + "description": "The email address to contact this subuser.", + "format": "email", + "type": "string" + }, + "id": { + "description": "The ID of this subuser.", + "type": "number" + }, + "username": { + "description": "The name by which this subuser will be referred.", + "type": "string" + } + }, + "required": [ + "disabled", + "id", + "username", + "email" + ], + "title": "List all Subusers for a parent response", + "type": "object", + "x-stoplight": { + "id": "subuser", + "name": "Subuser", + "public": true + } + }, + "subuser_post": { + "example": { + "authorization_token": "", + "credit_allocation": { + "type": "unlimited" + }, + "email": "example@example.com", + "signup_session_token": "", + "user_id": 1234, + "username": "example_subuser" + }, + "properties": { + "authorization_token": { + "type": "string" + }, + "credit_allocation": { + "properties": { + "type": { + "type": "string" + } + }, + "type": "object" + }, + "email": { + "description": "The email address for this subuser.", + "format": "email", + "type": "string" + }, + "signup_session_token": { + "type": "string" + }, + "user_id": { + "description": "The user ID for this subuser.", + "type": "number" + }, + "username": { + "description": "The username of the subuser.", + "type": "string" + } + }, + "required": [ + "username", + "user_id", + "email" + ], + "title": "Subuser::POST", + "type": "object", + "x-stoplight": { + "id": "subuser_post", + "name": "Subuser::POST", + "public": true + } + }, + "subuser_stats": { + "example": { + "date": "2016-02-01", + "stats": [ + { + "first_name": "John", + "last_name": "Doe", + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 5, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 10, + "processed": 10, + "requests": 10, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "user1", + "type": "subuser" + } + ] + }, + "properties": { + "date": { + "description": "The date the statistics were gathered.", + "type": "string" + }, + "stats": { + "description": "The list of statistics.", + "items": { + "properties": { + "first_name": { + "description": "The first name of the subuser.", + "type": "string" + }, + "last_name": { + "description": "The last name of the subuser.", + "type": "string" + }, + "metrics": { + "properties": { + "blocks": { + "description": "The number of emails that were not allowed to be delivered by ISPs.", + "type": "integer" + }, + "bounce_drops": { + "description": "The number of emails that were dropped because of a bounce.", + "type": "integer" + }, + "bounces": { + "description": "The number of emails that bounced instead of being delivered.", + "type": "integer" + }, + "clicks": { + "description": "The number of links that were clicked in your emails.", + "type": "integer" + }, + "deferred": { + "description": "The number of emails that temporarily could not be delivered.", + "type": "integer" + }, + "delivered": { + "description": "The number of emails SendGrid was able to confirm were actually delivered to a recipient.", + "type": "integer" + }, + "invalid_emails": { + "description": "The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid.", + "type": "integer" + }, + "opens": { + "description": "The total number of times your emails were opened by recipients.", + "type": "integer" + }, + "processed": { + "description": "Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed.", + "type": "integer" + }, + "requests": { + "description": "The number of emails that were requested to be delivered.", + "type": "integer" + }, + "spam_report_drops": { + "description": "The number of emails that were dropped due to a recipient previously marking your emails as spam.", + "type": "integer" + }, + "spam_reports": { + "description": "The number of recipients who marked your email as spam.", + "type": "integer" + }, + "unique_clicks": { + "description": "The number of unique recipients who clicked links in your emails.", + "type": "integer" + }, + "unique_opens": { + "description": "The number of unique recipients who opened your emails.", + "type": "integer" + }, + "unsubscribe_drops": { + "description": "The number of emails dropped due to a recipient unsubscribing from your emails.", + "type": "integer" + }, + "unsubscribes": { + "description": "The number of recipients who unsubscribed from your emails.", + "type": "integer" + } + }, + "type": "object" + }, + "name": { + "description": "The username of the subuser.", + "type": "string" + }, + "type": { + "description": "The type of account.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "title": "subuser_stats", + "type": "object", + "x-stoplight": { + "id": "subuser_stats", + "name": "subuser_stats", + "public": true + } + }, + "suppression-group-request-base": { + "properties": { + "description": { + "description": "A brief description of your suppression group. Required when creating a group.", + "maxLength": 100, + "type": "string" + }, + "is_default": { + "description": "Indicates if you would like this to be your default suppression group.", + "type": "boolean" + }, + "name": { + "description": "The name of your suppression group. Required when creating a group.", + "maxLength": 30, + "type": "string" + } + }, + "title": "Suppression Group Request Base", + "type": "object", + "x-stoplight": { + "id": "suppression-group-request-base", + "name": "Suppression Group Request Base", + "public": true + } + }, + "suppression_group": { + "properties": { + "description": { + "description": "A description of the suppression group.", + "maxLength": 100, + "type": "string" + }, + "id": { + "description": "The id of the suppression group.", + "type": "number" + }, + "is_default": { + "default": false, + "description": "Indicates if this is the default suppression group.", + "type": "boolean" + }, + "last_email_sent_at": { + "nullable": true, + "type": "integer" + }, + "name": { + "description": "The name of the suppression group. Each group created by a user must have a unique name.", + "maxLength": 30, + "type": "string" + }, + "unsubscribes": { + "description": "The unsubscribes associated with this group.", + "type": "integer" + } + }, + "required": [ + "id", + "name", + "description" + ], + "title": "Suppressions: Suppression Group", + "type": "object", + "x-stoplight": { + "id": "suppression_group", + "name": "Suppressions: Suppression Group", + "public": true + } + }, + "suppressions-request": { + "example": { + "recipient_emails": [ + "test1@example.com", + "test2@example.com" + ] + }, + "properties": { + "recipient_emails": { + "description": "The array of email addresses to add or find.", + "items": { + "format": "email", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "recipient_emails" + ], + "title": "Suppressions Request Body", + "type": "object", + "x-stoplight": { + "id": "suppressions-request", + "name": "Suppressions Request Body", + "public": true + } + }, + "to_email_array": { + "example": [ + { + "email": "john_doe@example.com", + "name": "John Doe" + } + ], + "items": { + "properties": { + "email": { + "description": "The intended recipient's email address.", + "format": "email", + "type": "string" + }, + "name": { + "description": "The intended recipient's name.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + }, + "title": "To Email Array", + "type": "array", + "x-stoplight": { + "id": "to_email_array", + "name": "To Email Array", + "public": true + } + }, + "transactional-template-warning": { + "example": { + "message": "A sample warning message." + }, + "properties": { + "message": { + "description": "Warning message for the user", + "type": "string" + } + }, + "title": "Warning", + "type": "object", + "x-stoplight": { + "id": "transactional-template-warning", + "name": "Warning", + "public": true + } + }, + "transactional-templates-template-lean": { + "example": { + "generation": "legacy", + "id": "0c314114-a2b7-4523-8cbc-a293d7d19007", + "name": "example_name", + "updated_at ": "2021-04-28 13:12:46", + "versions": [] + }, + "properties": { + "generation": { + "description": "Defines the generation of the template.", + "enum": [ + "legacy", + "dynamic" + ], + "type": "string" + }, + "id": { + "description": "The ID of the transactional template.", + "format": "uuid", + "maxLength": 36, + "minLength": 36, + "type": "string" + }, + "name": { + "description": "The name for the transactional template.", + "maxLength": 100, + "type": "string" + }, + "updated_at ": { + "description": "The date and time that this transactional template version was updated.", + "pattern": "^(\\d{4}-\\d{2}-\\d{2}) ((\\d{2}):(\\d{2}):(\\d{2}))$", + "type": "string" + }, + "versions": { + "description": "The different versions of this transactional template.", + "items": { + "$ref": "#/components/schemas/transactional-templates-version-output-lean" + }, + "type": "array" + } + }, + "required": [ + "id", + "name", + "generation", + "updated_at " + ], + "title": "Transactional Templates: Template Lean", + "type": "object", + "x-stoplight": { + "id": "transactional-templates-template-lean", + "name": "Transactional Templates: Template Lean", + "public": true + } + }, + "transactional-templates-version-output-lean": { + "properties": { + "active": { + "description": "Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active.", + "enum": [ + 0, + 1 + ], + "type": "integer" + }, + "editor": { + "description": "The editor used in the UI.", + "enum": [ + "code", + "design" + ], + "type": "string" + }, + "generate_plain_content": { + "default": true, + "description": "If true, plain_content is always generated from html_content. If false, plain_content is not altered.", + "type": "boolean" + }, + "id": { + "description": "ID of the transactional template version.", + "format": "uuid", + "type": "string" + }, + "name": { + "description": "Name of the transactional template version.", + "maxLength": 100, + "type": "string" + }, + "subject": { + "description": "Subject of the new transactional template version.", + "maxLength": 255, + "type": "string" + }, + "template_id": { + "description": "ID of the transactional template.", + "type": "string" + }, + "thumbnail_url": { + "description": "A Thumbnail preview of the template's html content.", + "type": "string" + }, + "updated_at": { + "description": "The date and time that this transactional template version was updated.", + "type": "string" + } + }, + "title": "Transactional Templates: Version Output Lean", + "type": "object", + "x-stoplight": { + "id": "transactional-templates-version-output-lean", + "name": "Transactional Templates: Version Output Lean", + "public": true + } + }, + "transactional_template": { + "allOf": [ + { + "$ref": "#/components/schemas/transactional-templates-template-lean" + }, + { + "properties": { + "warning": { + "$ref": "#/components/schemas/transactional-template-warning" + } + }, + "type": "object" + } + ], + "example": { + "generation": "legacy", + "id": "33feeff2-5069-43fe-8853-428651e5be79", + "name": "example_name", + "updated_at ": "2021-04-28 13:12:46", + "warning": { + "message": "Sample warning message" + } + }, + "title": "Transactional Templates: Template", + "x-stoplight": { + "id": "transactional_template", + "name": "Transactional Templates: Template", + "public": true + } + }, + "transactional_template_version_create": { + "example": { + "active": 1, + "editor": "design", + "generate_plain_content": false, + "html_content": "dolor", + "name": "pariatur non incididunt commodo", + "plain_content": "labore dolore", + "subject": "aliquip nulla Ut", + "template_id": "Excepteur Ut qui" + }, + "properties": { + "active": { + "description": "Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active.", + "enum": [ + 0, + 1 + ], + "type": "integer" + }, + "editor": { + "description": "The editor used in the UI.", + "enum": [ + "code", + "design" + ], + "type": "string" + }, + "generate_plain_content": { + "default": true, + "description": "If true, plain_content is always generated from html_content. If false, plain_content is not altered.", + "type": "boolean" + }, + "html_content": { + "description": "The HTML content of the version. Maximum of 1048576 bytes allowed.", + "maxLength": 1048576, + "type": "string" + }, + "name": { + "description": "Name of the transactional template version.", + "maxLength": 100, + "type": "string" + }, + "plain_content": { + "default": "", + "description": "Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed.", + "maxLength": 1048576, + "type": "string" + }, + "subject": { + "description": "Subject of the new transactional template version.", + "maxLength": 255, + "type": "string" + }, + "test_data": { + "description": "For dynamic templates only, the mock json data that will be used for template preview and test sends.", + "type": "string" + } + }, + "required": [ + "name", + "subject" + ], + "title": "Transactional Templates: Version Create", + "type": "object", + "x-stoplight": { + "id": "transactional_template_version_create", + "name": "Transactional Templates: Version Create", + "public": true + } + }, + "transactional_template_version_output": { + "allOf": [ + { + "properties": { + "warnings": { + "items": { + "$ref": "#/components/schemas/transactional-template-warning" + }, + "type": "array" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/transactional_template_version_create" + }, + { + "$ref": "#/components/schemas/transactional-templates-version-output-lean" + } + ], + "title": "Transactional Templates: Version Output", + "x-stoplight": { + "id": "transactional_template_version_output", + "name": "Transactional Templates: Version Output", + "public": true + } + }, + "user_profile": { + "example": { + "address": "1451 Larimer Street, 3rd floor", + "address2": "", + "city": "Denver, CO", + "company": "SendGrid", + "country": "US", + "first_name": "Matthew", + "last_name": "Bernier", + "phone": "7208788003", + "state": "CO", + "website": "http://sendgrid.com", + "zip": "80202" + }, + "properties": { + "address": { + "description": "The street address for this user profile.", + "type": "string" + }, + "address2": { + "description": "An optional second line for the street address of this user profile.", + "type": "string" + }, + "city": { + "description": "The city for the user profile.", + "type": "string" + }, + "company": { + "description": "That company that this user profile is associated with.", + "type": "string" + }, + "country": { + "description": "Th country of this user profile.", + "type": "string" + }, + "first_name": { + "description": "The first name of the user.", + "type": "string" + }, + "last_name": { + "description": "The last name of the user.", + "type": "string" + }, + "phone": { + "description": "The phone number for the user.", + "type": "string" + }, + "state": { + "description": "The state for this user.", + "type": "string" + }, + "website": { + "description": "The website associated with this user.", + "type": "string" + }, + "zip": { + "description": "The zip code for this user.", + "type": "string" + } + }, + "title": "User: Profile", + "type": "object", + "x-stoplight": { + "id": "user_profile", + "name": "User: Profile", + "public": true + } + }, + "user_scheduled_send_status": { + "allOf": [ + { + "$ref": "#/components/schemas/mail_batch_id" + }, + { + "description": "The status of the scheduled send.", + "properties": { + "status": { + "description": "The status of the scheduled send.", + "enum": [ + "cancel", + "pause" + ], + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + ], + "example": { + "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi", + "status": "pause" + }, + "title": "User Scheduled Send status", + "x-stoplight": { + "id": "user_scheduled_send_status", + "name": "User Scheduled Send status", + "public": true + } + }, + "verified-sender-request-schema": { + "example": { + "address": "1234 Fake St", + "address2": "PO Box 1234", + "city": "San Francisco", + "country": "USA", + "from_email": "orders@example.com", + "from_name": "Example Orders", + "nickname": "Orders", + "reply_to": "orders@example.com", + "reply_to_name": "Example Orders", + "state": "CA", + "zip": "94105" + }, + "properties": { + "address": { + "maxLength": 100, + "type": "string" + }, + "address2": { + "maxLength": 100, + "type": "string" + }, + "city": { + "maxLength": 150, + "type": "string" + }, + "country": { + "maxLength": 100, + "type": "string" + }, + "from_email": { + "format": "email", + "maxLength": 256, + "type": "string" + }, + "from_name": { + "maxLength": 256, + "type": "string" + }, + "nickname": { + "maxLength": 100, + "type": "string" + }, + "reply_to": { + "format": "email", + "maxLength": 256, + "type": "string" + }, + "reply_to_name": { + "maxLength": 256, + "type": "string" + }, + "state": { + "maxLength": 2, + "type": "string" + }, + "zip": { + "maxLength": 10, + "type": "string" + } + }, + "required": [ + "nickname", + "from_email", + "reply_to" + ], + "title": "Verified Sender Request Schema", + "type": "object", + "x-stoplight": { + "id": "verified-sender-request-schema", + "name": "Verified Sender Request Schema", + "public": true + } + }, + "verified-sender-response-schema": { + "example": { + "address": "1234 Fake St.", + "address2": "PO Box 1234", + "city": "San Francisco", + "country": "USA", + "from_email": "orders@example.com", + "from_name": "Example Orders", + "id": 1234, + "locked": false, + "nickname": "Example Orders", + "reply_to": "orders@example.com", + "reply_to_name": "Example Orders", + "state": "CA", + "verified": true, + "zip": "94105" + }, + "properties": { + "address": { + "type": "string" + }, + "address2": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "from_email": { + "type": "string" + }, + "from_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "locked": { + "type": "boolean" + }, + "nickname": { + "type": "string" + }, + "reply_to": { + "type": "string" + }, + "reply_to_name": { + "type": "string" + }, + "state": { + "type": "string" + }, + "verified": { + "type": "boolean" + }, + "zip": { + "type": "string" + } + }, + "title": "Verified Sender Response Schema", + "type": "object", + "x-stoplight": { + "id": "verified-sender-response-schema", + "name": "Verified Sender Response Schema", + "public": true + } + }, + "webhook": { + "properties": { + "nonce": { + "description": "The one time nonce to use when \"signature\" is \"hmac-sha1\"", + "maxLength": 32, + "minLength": 8, + "type": "string" + }, + "url": { + "description": "The URL to invoke in the webhook", + "type": "string" + } + }, + "required": [ + "url", + "nonce" + ], + "title": "webhook", + "type": "object", + "x-stoplight": { + "id": "webhook", + "name": "webhook", + "public": true + } + }, + "webhooks-event-webhook-request": { + "properties": { + "bounce": { + "description": "Receiving server could not or would not accept message.", + "type": "boolean" + }, + "click": { + "description": "Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event.", + "type": "boolean" + }, + "deferred": { + "description": "Recipient's email server temporarily rejected message.", + "type": "boolean" + }, + "delivered": { + "description": "Message has been successfully delivered to the receiving server.", + "type": "boolean" + }, + "dropped": { + "description": "You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota", + "type": "boolean" + }, + "enabled": { + "description": "Indicates if the event webhook is enabled.", + "type": "boolean" + }, + "group_resubscribe": { + "description": "Recipient resubscribes to specific group by updating preferences. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "group_unsubscribe": { + "description": "Recipient unsubscribe from specific group, by either direct link or updating preferences. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "oauth_client_id": { + "description": "The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token. When passing data in this field, you must also include the oauth_token_url field.", + "type": "string" + }, + "oauth_token_url": { + "description": "The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the oauth_client_id field.", + "type": "string" + }, + "open": { + "description": "Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event.", + "type": "boolean" + }, + "processed": { + "description": "Message has been received and is ready to be delivered.", + "type": "boolean" + }, + "spam_report": { + "description": "Recipient marked a message as spam.", + "type": "boolean" + }, + "unsubscribe": { + "description": "Recipient clicked on message's subscription management link. You need to enable Subscription Tracking for getting this type of event.", + "type": "boolean" + }, + "url": { + "description": "The URL that you want the event webhook to POST to.", + "type": "string" + } + }, + "required": [ + "enabled", + "url", + "group_resubscribe", + "delivered", + "group_unsubscribe", + "spam_report", + "bounce", + "deferred", + "unsubscribe", + "processed", + "open", + "click", + "dropped" + ], + "title": "Webhooks: Event Webhook Request", + "type": "object", + "x-stoplight": { + "id": "webhooks-event-webhook-request", + "name": "Webhooks: Event Webhook Request", + "public": true + } + } + }, + "securitySchemes": { + "Authorization": { + "in": "header", + "name": "Authorization", + "type": "apiKey" + } + } + }, + "info": { + "description": "The Beta endpoints for the new Email Activity APIs - functionality is subject to change without notice. You may not have access to this Beta endpoint.\n\nEmail Activity offers filtering and search by event type for two days worth of data. There is an optional add-on to store 60 days worth of data. This add-on also gives you access to the ability to download a CSV of the 60 days worth of email event data. The Beta endpoints for the new Email Activity APIs - functionality is subject to change without notice. You may not have access to this Beta endpoint.\n\nEmail Activity offers filtering and search by event type for two days worth of data. There is an optional add-on to store 60 days worth of data. This add-on also gives you access to the ability to download a CSV of the 60 days worth of email event data.", + "title": "Email Activity (beta)", + "version": "" + }, + "openapi": "3.1.0", + "paths": { + "/access_settings/activity": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all of the IP addresses that recently attempted to access your account either through the User Interface or the API.**", + "operationId": "GET_access_settings-activity", + "parameters": [ + { + "description": "Limits the number of IPs to return.", + "in": "query", + "name": "limit", + "schema": { + "default": 20, + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "allowed": false, + "auth_method": "Web", + "first_at": 1444087966, + "ip": "1.1.1.1", + "last_at": 1444406672, + "location": "Australia" + }, + { + "allowed": false, + "auth_method": "Web", + "first_at": 1444087505, + "ip": "1.2.3.48", + "last_at": 1444087505, + "location": "Mukilteo, Washington" + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "description": "An array containing the IPs that recently attempted to access your account.", + "items": { + "properties": { + "allowed": { + "description": "Indicates if the IP address was granted access to the account.", + "type": "boolean" + }, + "auth_method": { + "description": "The authentication method used when attempting access.", + "type": "string" + }, + "first_at": { + "description": "A Unix timestamp indicating when the first access attempt was made.", + "type": "integer" + }, + "ip": { + "description": "The IP addressed used during the access attempt.", + "type": "string" + }, + "last_at": { + "description": "A Unix timestamp indicating when the most recent access attempt was made", + "type": "integer" + }, + "location": { + "description": "The geographic location from which the access attempt originated.", + "type": "string" + } + }, + "required": [ + "allowed", + "auth_method", + "first_at", + "ip", + "last_at", + "location" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "result" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all recent access attempts", + "tags": [ + "IP Access Management" + ], + "x-stoplight": { + "id": "GET_accesssettings-activity", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/access_settings/whitelist": { + "delete": { + "description": "**This endpoint allows you to remove one or more IP addresses from your list of allowed addresses.**\n\nTo remove one or more IP addresses, pass this endpoint an array containing the ID(s) associated with the IP(s) you intend to remove. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint.\n\nIt is possible to remove your own IP address, which will block access to your account. You will need to submit a [support ticket](https://sendgrid.com/docs/ui/account-and-settings/support/) if this happens. For this reason, it is important to double check that you are removing only the IPs you intend to remove when using this endpoint.", + "operationId": "DELETE_access_settings-whitelist", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "ids": [ + 1, + 2, + 3 + ] + }, + "properties": { + "ids": { + "description": "An array of the IDs of the IP address that you want to remove from your allow list.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove one or more IPs from the allow list", + "tags": [ + "IP Access Management" + ], + "x-stoplight": { + "id": "DELETE_accesssettings-whitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a list of IP addresses that are currently allowed to access your account.**\n\nEach IP address returned to you will have `created_at` and `updated_at` dates. Each IP will also be associated with an `id` that can be used to remove the address from your allow list.", + "operationId": "GET_access_settings-whitelist", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "created_at": 1441824715, + "id": 1, + "ip": "192.168.1.1/32", + "updated_at": 1441824715 + }, + { + "created_at": 1441824715, + "id": 2, + "ip": "192.168.1.2/32", + "updated_at": 1441824715 + }, + { + "created_at": 1441824715, + "id": 3, + "ip": "192.168.1.3/32", + "updated_at": 1441824715 + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/ip-access-response" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a list of currently allowed IPs", + "tags": [ + "IP Access Management" + ], + "x-stoplight": { + "id": "GET_accesssettings-whitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to add one or more allowed IP addresses.**\n\nTo allow one or more IP addresses, pass them to this endpoint in an array. Once an IP address is added to your allow list, it will be assigned an `id` that can be used to remove the address. You can retrieve the ID associated with an IP using the \"Retrieve a list of currently allowed IPs\" endpoint.", + "operationId": "POST_access_settings-whitelist", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "ips": [ + { + "ip": "192.168.1.1" + }, + { + "ip": "192.*.*.*" + }, + { + "ip": "192.168.1.3/32" + } + ] + }, + "properties": { + "ips": { + "description": "An array containing the IP(s) you want to allow.", + "items": { + "properties": { + "ip": { + "description": "An IP address that you want to allow.", + "type": "string" + } + }, + "required": [ + "ip" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "ips" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "created_at": 1441824715, + "id": 1, + "ip": "192.168.1.1/32", + "updated_at": 1441824715 + }, + { + "created_at": 1441824715, + "id": 2, + "ip": "192.0.0.0/8", + "updated_at": 1441824715 + }, + { + "created_at": 1441824715, + "id": 3, + "ip": "192.168.1.3/32", + "updated_at": 1441824715 + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/ip-access-response" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add one or more IPs to the allow list", + "tags": [ + "IP Access Management" + ], + "x-stoplight": { + "id": "POST_accesssettings-whitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/access_settings/whitelist/{rule_id}": { + "delete": { + "description": "**This endpoint allows you to remove a specific IP address from your list of allowed addresses.**\n\nWhen removing a specific IP address from your list, you must include the ID in your call. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint.", + "operationId": "DELETE_access_settings-whitelist-rule_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove a specific IP from the allowed list", + "tags": [ + "IP Access Management" + ], + "x-stoplight": { + "id": "DELETE_accesssettings-whitelist-ruleid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retreive a specific IP address that has been allowed to access your account.**\n\nYou must include the ID for the specific IP address you want to retrieve in your call. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint.", + "operationId": "GET_access_settings-whitelist-rule_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "created_at": 1441824715, + "id": 1, + "ip": "192.168.1.1", + "updated_at": 1441824715 + } + } + }, + "schema": { + "$ref": "#/components/schemas/ip-access-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific allowed IP", + "tags": [ + "IP Access Management" + ], + "x-stoplight": { + "id": "GET_accesssettings-whitelist-ruleid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the allowed IP address that you want to retrieve.", + "in": "path", + "name": "rule_id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/alerts": { + "get": { + "description": "**This endpoint allows you to retrieve all of your alerts.**\n\nAlerts allow you to specify an email address to receive notifications regarding your email usage or statistics. \n* Usage alerts allow you to set the threshold at which an alert will be sent.\n* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, \"daily\", \"weekly\", or \"monthly\".\n\nFor more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/).", + "operationId": "GET_alerts", + "parameters": [ + { + "in": "header", + "name": "Authorization", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created_at": 1451498784, + "email_to": "example1@example.com", + "id": 46, + "percentage": 90, + "type": "usage_limit", + "updated_at": 1451498784 + }, + { + "created_at": 1451498812, + "email_to": "example2@example.com", + "frequency": "monthly", + "id": 47, + "type": "stats_notification", + "updated_at": 1451498812 + }, + { + "created_at": 1451520930, + "email_to": "example3@example.com", + "frequency": "daily", + "id": 48, + "type": "stats_notification", + "updated_at": 1451520930 + } + ] + } + }, + "schema": { + "description": "The list of alerts.", + "items": { + "properties": { + "created_at": { + "description": "A Unix timestamp indicating when the alert was created.", + "type": "integer" + }, + "email_to": { + "description": "The email address that the alert will be sent to.", + "type": "string" + }, + "frequency": { + "description": "If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example, \"daily\", \"weekly\", or \"monthly\".", + "type": "string" + }, + "id": { + "description": "The ID of the alert.", + "type": "integer" + }, + "percentage": { + "description": "If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent.", + "type": "integer" + }, + "type": { + "description": "The type of alert.", + "enum": [ + "usage_limit", + "stats_notification" + ], + "type": "string" + }, + "updated_at": { + "description": "A Unix timestamp indicating when the alert was last modified.", + "type": "integer" + } + }, + "required": [ + "created_at", + "email_to", + "id", + "type" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all alerts", + "tags": [ + "Alerts" + ], + "x-stoplight": { + "beforeScript": "function (ctx, request) {\n // Your javascript code here.+\n request.header.set('User-Agent', 'sendgrid/stoplightLocs');\n}", + "id": "GET_alerts", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new alert.**\n\nAlerts allow you to specify an email address to receive notifications regarding your email usage or statistics. There are two types of alerts that can be created with this endpoint:\n\n* `usage_limit` allows you to set the threshold at which an alert will be sent.\n* `stats_notification` allows you to set how frequently you would like to receive email statistics reports. For example, \"daily\", \"weekly\", or \"monthly\".\n\nFor more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/).", + "operationId": "POST_alerts", + "parameters": [ + { + "in": "header", + "name": "Authorization", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "on-behalf-of", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "email_to": "example@example.com", + "frequency": "daily", + "type": "stats_notification" + }, + "properties": { + "email_to": { + "description": "The email address the alert will be sent to.\nExample: test@example.com", + "format": "email", + "nullable": true, + "type": "string" + }, + "frequency": { + "description": "Required for stats_notification. How frequently the alert will be sent.\nExample: daily", + "type": "string" + }, + "percentage": { + "description": "Required for usage_alert. When this usage threshold is reached, the alert will be sent.\nExample: 90", + "type": "integer" + }, + "type": { + "description": "The type of alert you want to create. Can be either usage_limit or stats_notification.\nExample: usage_limit", + "enum": [ + "stats_notification", + "usage_limit" + ], + "type": "string" + } + }, + "required": [ + "type", + "email_to" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "created_at": 1451520930, + "email_to": "test@example.com", + "frequency": "daily", + "id": 48, + "type": "stats_notification", + "updated_at": 1451520930 + } + } + }, + "schema": { + "properties": { + "created_at": { + "description": "A Unix timestamp indicating when the alert was created.", + "type": "integer" + }, + "email_to": { + "description": "The email address that the alert will be sent to.", + "format": "email", + "type": "string" + }, + "frequency": { + "description": "If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example, \"daily\", \"weekly\", or \"monthly\".", + "type": "string" + }, + "id": { + "description": "The ID of the alert.", + "type": "integer" + }, + "percentage": { + "description": "\"If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent.", + "type": "integer" + }, + "type": { + "description": "The type of alert.", + "type": "string" + }, + "updated_at": { + "description": "A Unix timestamp indicating when the alert was last modified.", + "type": "integer" + } + }, + "required": [ + "created_at", + "email_to", + "id", + "type", + "updated_at" + ], + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a new Alert", + "tags": [ + "Alerts" + ], + "x-stoplight": { + "id": "POST_alerts", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/alerts/{alert_id}": { + "delete": { + "description": "**This endpoint allows you to delete an alert.**\n\nAlerts allow you to specify an email address to receive notifications regarding your email usage or statistics. \n* Usage alerts allow you to set the threshold at which an alert will be sent.\n* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, \"daily\", \"weekly\", or \"monthly\".\n\nFor more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/).", + "operationId": "DELETE_alerts-alert_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete an alert", + "tags": [ + "Alerts" + ], + "x-stoplight": { + "id": "DELETE_alerts-alertid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific alert.**\n\nAlerts allow you to specify an email address to receive notifications regarding your email usage or statistics. \n* Usage alerts allow you to set the threshold at which an alert will be sent.\n* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, \"daily\", \"weekly\", or \"monthly\".\n\nFor more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/).", + "operationId": "GET_alerts-alert_id", + "parameters": [ + { + "in": "header", + "name": "Authorization", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "created_at": 1451520930, + "email_to": "example@example.com", + "frequency": "daily", + "id": 48, + "type": "stats_notification", + "updated_at": 1451520930 + } + } + }, + "schema": { + "properties": { + "created_at": { + "description": "A Unix timestamp indicating when the alert was created.", + "type": "integer" + }, + "email_to": { + "description": "The email address that the alert will be sent to.", + "type": "string" + }, + "frequency": { + "description": "If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example: \"daily\", \"weekly\", or \"monthly\".", + "type": "string" + }, + "id": { + "description": "The ID of the alert.", + "type": "integer" + }, + "percentage": { + "description": "If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent.", + "type": "integer" + }, + "type": { + "description": "The type of alert.", + "enum": [ + "usage_alert", + "stats_notification" + ], + "type": "string" + }, + "updated_at": { + "description": "A Unix timestamp indicating when the alert was last modified.", + "type": "integer" + } + }, + "required": [ + "created_at", + "email_to", + "id", + "type", + "updated_at" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific alert", + "tags": [ + "Alerts" + ], + "x-stoplight": { + "id": "GET_alerts-alertid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the alert you would like to retrieve.", + "in": "path", + "name": "alert_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update an alert.**\n\nAlerts allow you to specify an email address to receive notifications regarding your email usage or statistics. \n* Usage alerts allow you to set the threshold at which an alert will be sent.\n* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, \"daily\", \"weekly\", or \"monthly\".\n\nFor more information about alerts, please see our [Alerts documentation](https://sendgrid.com/docs/ui/account-and-settings/alerts/).", + "operationId": "PATCH_alerts-alert_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "email_to": "example@example.com" + }, + "properties": { + "email_to": { + "description": "The new email address you want your alert to be sent to.\nExample: test@example.com", + "type": "string" + }, + "frequency": { + "description": "The new frequency at which to send the stats_notification alert.\nExample: monthly", + "type": "string" + }, + "percentage": { + "description": "The new percentage threshold at which the usage_limit alert will be sent.\nExample: 90", + "type": "integer" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "created_at": 1451520930, + "email_to": "example@example.com", + "frequency": "daily", + "id": 48, + "type": "stats_notification", + "updated_at": 1451522691 + } + } + }, + "schema": { + "properties": { + "created_at": { + "description": "A Unix timestamp indicating when the alert was created.", + "type": "integer" + }, + "email_to": { + "description": "The email address that the alert will be sent to.", + "type": "string" + }, + "frequency": { + "description": "If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example: \"daily\", \"weekly\", or \"monthly\".", + "type": "string" + }, + "id": { + "description": "The ID of the alert.", + "type": "integer" + }, + "percentage": { + "description": "If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent.", + "type": "integer" + }, + "type": { + "description": "The type of alert.", + "enum": [ + "usage_alert", + "stats_notification" + ], + "type": "string" + }, + "updated_at": { + "description": "A Unix timestamp indicating when the alert was last modified.", + "type": "integer" + } + }, + "required": [ + "created_at", + "email_to", + "id", + "type", + "updated_at" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update an alert", + "tags": [ + "Alerts" + ], + "x-stoplight": { + "id": "PATCH_alerts-alertid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/api_keys": { + "get": { + "description": "**This endpoint allows you to retrieve all API Keys that belong to the authenticated user.**\n\nA successful response from this API will include all available API keys' names and IDs.\n\nFor security reasons, there is not a way to retrieve the key itself after it's created. If you lose your API key, you must create a new one. Only the \"Create API keys\" endpoint will return a key to you and only at the time of creation.\n\nAn `api_key_id` can be used to update or delete the key, as well as retrieve the key's details, such as its scopes.", + "operationId": "GET_api_keys", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "api_key_id": "some-apikey-id", + "name": "API Key Name" + }, + { + "api_key_id": "another-apikey-id", + "name": "API Key Name 2" + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "items": { + "$ref": "#/components/schemas/api_key_name_id" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all API Keys belonging to the authenticated user", + "tags": [ + "API Keys" + ], + "x-stoplight": { + "id": "GET_apikeys", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new API Key for the user.**\n\nTo create your initial SendGrid API Key, you should [use the SendGrid App](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.\n\n> There is a limit of 100 API Keys on your account.\n\nA JSON request body containing a `name` property is required when making requests to this endpoint. If the number of maximum keys, 100, is reached, a `403` status will be returned.\n\nThough the `name` field is required, it does not need to be unique. A unique API key ID will be generated for each key you create and returned in the response body.\n\nIt is not necessary to pass a `scopes` field to the API when creating a key, but you should be aware that omitting the `scopes` field from your request will create a key with \"Full Access\" permissions by default.\n\nSee the [API Key Permissions List](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization) for all available scopes. An API key's scopes can be updated after creation using the \"Update API keys\" endpoint.", + "operationId": "create-api-keys", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "My API Key", + "scopes": [ + "mail.send", + "alerts.create", + "alerts.read" + ] + }, + "properties": { + "name": { + "description": "The name you will use to describe this API Key.", + "type": "string" + }, + "scopes": { + "description": "The individual permissions that you are giving to this API Key.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "api_key": "SG.xxxxxxxx.yyyyyyyy", + "api_key_id": "xxxxxxxx", + "name": "My API Key", + "scopes": [ + "mail.send", + "alerts.create", + "alerts.read" + ] + } + } + }, + "schema": { + "properties": { + "api_key": { + "type": "string" + }, + "api_key_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "scopes": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_apiKeysErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_apiKeysErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_apiKeysErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create API keys", + "tags": [ + "API Keys" + ], + "x-stoplight": { + "id": "create-api-keys", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 201 + }, + "public": true + } + } + }, + "/api_keys/{api_key_id}": { + "delete": { + "description": "**This endpoint allows you to revoke an existing API Key using an `api_key_id`**\n\nAuthentications using a revoked API Key will fail after after some small propogation delay. If the API Key ID does not exist, a `404` status will be returned.", + "operationId": "DELETE_api_keys-api_key_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_apiKeysErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete API keys", + "tags": [ + "API Keys" + ], + "x-stoplight": { + "id": "DELETE_apikeys-apikeyid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a single API key using an `api_key_id`.**\n\nThe endpoint will return a key's name, ID, and scopes. If the API Key ID does not, exist a `404` status will be returned.\n\nSee the [API Key Permissions List](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization) for all available scopes. An API key's scopes can be updated after creation using the \"Update API keys\" endpoint.", + "operationId": "GET_api_keys-api_key_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "api_key_id": "some-apikey-id", + "name": "API Key Name" + }, + { + "api_key_id": "another-apikey-id", + "name": "API Key Name 2" + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "items": { + "$ref": "#/components/schemas/api_key_name_id_scopes" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_apiKeysErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_apiKeysErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_apiKeysErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve an existing API Key", + "tags": [ + "API Keys" + ], + "x-stoplight": { + "id": "GET_apikeys-apikeyid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "", + "in": "path", + "name": "api_key_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update the name of an existing API Key.**\n\nYou must pass this endpoint a JSON request body with a `name` property, which will be used to rename the key associated with the `api_key_id` passed in the URL.", + "operationId": "PATCH_api_keys-api_key_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "A New Hope" + }, + "properties": { + "name": { + "description": "The new name of the API Key.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA", + "name": "A New Hope" + } + } + }, + "schema": { + "$ref": "#/components/schemas/api_key_name_id" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_apiKeysErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update API key name", + "tags": [ + "API Keys" + ], + "x-stoplight": { + "id": "PATCH_apikeys-apikeyid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "put": { + "description": "**This endpoint allows you to update the name and scopes of a given API key.**\n\nYou must pass this endpoint a JSON request body with a `name` field and a `scopes` array containing at least one scope. The `name` and `scopes` fields will be used to update the key associated with the `api_key_id` in the request URL.\n\nIf you need to update a key's scopes only, pass the `name` field with the key's existing name; the `name` will not be modified. If you need to update a key's name only, use the \"Update API key name\" endpoint.\n\nSee the [API Key Permissions List](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization) for all available scopes.", + "operationId": "PUT_api_keys-api_key_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "Profiles key", + "scopes": [ + "user.profile.read", + "user.profile.update" + ] + }, + "properties": { + "name": { + "type": "string" + }, + "scopes": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA", + "name": "Profiles Key", + "scopes": [ + "user.profile.read", + "user.profile.update" + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/api_key_name_id_scopes" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_apiKeysErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update API key name and scopes", + "tags": [ + "API Keys" + ], + "x-stoplight": { + "id": "PUT_apikeys-apikeyid", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/asm/groups": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all suppression groups created by this user.**\n\nThis endpoint can also return information for multiple group IDs that you include in your request. To add a group ID to your request, simply append `?id=123456&id=123456`, with the appropriate group IDs.", + "operationId": "GET_asm-groups", + "parameters": [ + { + "in": "query", + "name": "id", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "description": "An Unsubscribe Group", + "id": 1234, + "is_default": true, + "last_email_sent_at": null, + "name": "Unsubscribe Group", + "unsubscribes": 1234 + }, + { + "description": "An Unsubscribe Group", + "id": 1234, + "is_default": true, + "last_email_sent_at": null, + "name": "Unsubscribe Group", + "unsubscribes": 1234 + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/suppression_group" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all suppression groups associated with the user.", + "tags": [ + "Suppressions - Unsubscribe Groups" + ], + "x-stoplight": { + "id": "GET_asm-groups", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new suppression group.**\n\nTo add an email address to the suppression group, [create a Suppression](https://sendgrid.api-docs.io/v3.0/suppressions-suppressions/add-suppressions-to-a-suppression-group).", + "operationId": "POST_asm-groups", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/suppression-group-request-base" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "description": "Suggestions for products our users might like.", + "id": 103, + "is_default": false, + "name": "Product Suggestions" + } + } + }, + "schema": { + "properties": { + "description": { + "description": "A brief description of the suppression group.", + "type": "string" + }, + "id": { + "description": "The ID of the suppression group.", + "type": "integer" + }, + "is_default": { + "description": "Indicates if this is the default suppression group.", + "type": "boolean" + }, + "name": { + "description": "The name of the suppression group.", + "type": "string" + } + }, + "required": [ + "id", + "name", + "description", + "is_default" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a new suppression group", + "tags": [ + "Suppressions - Unsubscribe Groups" + ], + "x-stoplight": { + "id": "POST_asm-groups", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/asm/groups/{group_id}": { + "delete": { + "description": "**This endpoint allows you to delete a suppression group.**\n\nIf a recipient uses the \"one-click unsubscribe\" option on an email associated with a deleted group, that recipient will be added to the global suppression list.\n\nDeleting a suppression group will remove the suppression, meaning email will once again be sent to the previously suppressed addresses. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required.", + "operationId": "DELETE_asm-groups-group_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Suppression Group", + "tags": [ + "Suppressions - Unsubscribe Groups" + ], + "x-stoplight": { + "id": "DELETE_asm-groups-groupid", + "mock": { + "dynamic": false, + "statusCode": 204 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a single suppression group.**", + "operationId": "GET_asm-groups-group_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "description": "Our monthly newsletter.", + "id": 100, + "is_default": true, + "last_email_sent_at": null, + "name": "Newsletters", + "unsubscribes": 400 + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/suppression-group-request-base" + }, + { + "properties": { + "id": { + "description": "The ID of the suppression group.", + "type": "integer" + }, + "last_email_sent_at": { + "nullable": true, + "type": "string" + }, + "unsubscribes": { + "description": "The number of unsubscribes, or suppressions, in this group.", + "type": "integer" + } + }, + "required": [ + "id" + ], + "type": "object" + } + ] + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get information on a single suppression group.", + "tags": [ + "Suppressions - Unsubscribe Groups" + ], + "x-stoplight": { + "id": "GET_asm-groups-groupid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the suppression group you would like to retrieve.", + "in": "path", + "name": "group_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update or change a suppression group.**", + "operationId": "PATCH_asm-groups-group_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/suppression-group-request-base" + } + ], + "example": { + "description": "Suggestions for items our users might like.", + "id": 103, + "name": "Item Suggestions" + } + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "description": "Suggestions for items our users might like.", + "id": 103, + "name": "Item Suggestions" + } + } + }, + "schema": { + "$ref": "#/components/schemas/suppression_group" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a suppression group.", + "tags": [ + "Suppressions - Unsubscribe Groups" + ], + "x-stoplight": { + "id": "PATCH_asm-groups-groupid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/asm/groups/{group_id}/suppressions": { + "get": { + "description": "**This endpoint allows you to retrieve all suppressed email addresses belonging to the given group.**", + "operationId": "GET_asm-groups-group_id-suppressions", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + "example@example.com", + "example2@example.com" + ] + } + }, + "schema": { + "description": "The list of email addresses belonging to the given suppression group.", + "items": { + "format": "email", + "type": "string" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all suppressions for a suppression group", + "tags": [ + "Suppressions - Suppressions" + ], + "x-stoplight": { + "id": "GET_asm-groups-groupid-suppressions", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the unsubscribe group that you are adding suppressions to.", + "in": "path", + "name": "group_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to add email addresses to an unsubscribe group.**\n\nIf you attempt to add suppressions to a group that has been deleted or does not exist, the suppressions will be added to the global suppressions list.", + "operationId": "POST_asm-groups-group_id-suppressions", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/suppressions-request" + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipient_emails": [ + "test1@example.com", + "test2@example.com" + ] + } + } + }, + "schema": { + "properties": { + "recipient_emails": { + "description": "The email addresses you added to the unsubscribe group", + "items": { + "format": "email", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add suppressions to a suppression group", + "tags": [ + "Suppressions - Suppressions" + ], + "x-stoplight": { + "id": "POST_asm-groups-groupid-suppressions", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/asm/groups/{group_id}/suppressions/search": { + "parameters": [ + { + "description": "The ID of the suppression group that you would like to search.", + "in": "path", + "name": "group_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to search a suppression group for multiple suppressions.**\n\nWhen given a list of email addresses and a group ID, this endpoint will only return the email addresses that have been unsubscribed from the given group.", + "operationId": "POST_asm-groups-group_id-suppressions-search", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/suppressions-request" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + "exists1@example.com", + "exists2@example.com" + ] + } + }, + "schema": { + "description": "The email address from your search that do exist in the suppression group.", + "items": { + "format": "email", + "type": "string" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Search for suppressions within a group", + "tags": [ + "Suppressions - Suppressions" + ], + "x-stoplight": { + "id": "POST_asm-groups-groupid-suppressions-search", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/asm/groups/{group_id}/suppressions/{email}": { + "delete": { + "description": "**This endpoint allows you to remove a suppressed email address from the given suppression group.**\n\nRemoving an address will remove the suppression, meaning email will once again be sent to the previously suppressed addresses. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required.", + "operationId": "DELETE_asm-groups-group_id-suppressions-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a suppression from a suppression group", + "tags": [ + "Suppressions - Suppressions" + ], + "x-stoplight": { + "id": "DELETE_asm-groups-groupid-suppressions-email", + "mock": { + "dynamic": false, + "statusCode": 204 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the suppression group that you are removing an email address from.", + "in": "path", + "name": "group_id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The email address that you want to remove from the suppression group.", + "in": "path", + "name": "email", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/asm/suppressions": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all suppressions.**", + "operationId": "GET_asm-suppressions", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created_at": 1410986704, + "email": "test1@example.com", + "group_id": 1, + "group_name": "Weekly News" + }, + { + "created_at": 1411493671, + "email": "test1@example.com", + "group_id": 2, + "group_name": "Daily News" + }, + { + "created_at": 1411493671, + "email": "test2@example.com", + "group_id": 2, + "group_name": "Daily News" + } + ] + } + }, + "schema": { + "items": { + "properties": { + "created_at": { + "description": "A UNIX timestamp indicating when the suppression was created.", + "type": "integer" + }, + "email": { + "description": "The email address that was suppressed.", + "type": "string" + }, + "group_id": { + "description": "The id of the suppression group that this email address belongs to.", + "type": "integer" + }, + "group_name": { + "description": "The name of the suppression group that this email address belongs to.", + "type": "string" + } + }, + "required": [ + "email", + "group_id", + "group_name", + "created_at" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all suppressions", + "tags": [ + "Suppressions - Suppressions" + ], + "x-stoplight": { + "id": "GET_asm-suppressions", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/asm/suppressions/global": { + "post": { + "description": "**This endpoint allows you to add one or more email addresses to the global suppressions group.**", + "operationId": "POST_asm-suppressions-global", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/suppressions-request" + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipient_emails": [ + "test1@example.com", + "test2@example.com" + ] + } + } + }, + "schema": { + "properties": { + "recipient_emails": { + "description": "The email addresses that are globally suppressed", + "items": { + "format": "email", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "recipient_emails" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add recipient addresses to the global suppression group.", + "tags": [ + "Suppressions - Global Suppressions" + ], + "x-stoplight": { + "id": "POST_asm-suppressions-global", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/asm/suppressions/global/{email}": { + "delete": { + "description": "**This endpoint allows you to remove an email address from the global suppressions group.**\n\nDeleting a suppression group will remove the suppression, meaning email will once again be sent to the previously suppressed addresses. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required.", + "operationId": "DELETE_asm-suppressions-global-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Global Suppression", + "tags": [ + "Suppressions - Global Suppressions" + ], + "x-stoplight": { + "id": "DELETE_asm-suppressions-global-email", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a global suppression. You can also use this endpoint to confirm if an email address is already globally suppresed.**\n\nIf the email address you include in the URL path parameter `{email}` is already globally suppressed, the response will include that email address. If the address you enter for `{email}` is not globally suppressed, an empty JSON object `{}` will be returned.", + "operationId": "GET_asm-suppressions-global-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipient_email": "test@example.com" + } + } + }, + "schema": { + "properties": { + "recipient_email": { + "description": "The email address that is globally suppressed. This will be an empty object if the email address you included in your call is not globally suppressed.", + "format": "email", + "type": "string" + } + }, + "required": [ + "recipient_email" + ], + "title": "Retrieve a Global Suppression response", + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Global Suppression", + "tags": [ + "Suppressions - Global Suppressions" + ], + "x-stoplight": { + "id": "GET_asm-suppressions-global-email", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The email address of the global suppression you want to retrieve. Or, if you want to check if an email address is on the global suppressions list, enter that email address here.", + "in": "path", + "name": "email", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/asm/suppressions/{email}": { + "get": { + "description": "**This endpoint returns a list of all groups from which the given email address has been unsubscribed.**", + "operationId": "GET_asm-suppressions-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "suppressions": [ + { + "description": "Optional description.", + "id": 1, + "is_default": true, + "name": "Weekly News", + "suppressed": true + }, + { + "description": "Some daily news.", + "id": 2, + "is_default": true, + "name": "Daily News", + "suppressed": true + }, + { + "description": "An old group.", + "id": 2, + "is_default": false, + "name": "Old News", + "suppressed": false + } + ] + } + } + }, + "schema": { + "properties": { + "suppressions": { + "description": "The array of suppression groups.", + "items": { + "properties": { + "description": { + "description": "The description of the suppression group.", + "type": "string" + }, + "id": { + "description": "The id of the suppression group.", + "type": "integer" + }, + "is_default": { + "description": "Indicates if the suppression group is set as the default.", + "type": "boolean" + }, + "name": { + "description": "The name of the suppression group.", + "type": "string" + }, + "suppressed": { + "description": "Indicates if the given email address is suppressed for this group.", + "type": "boolean" + } + }, + "required": [ + "description", + "id", + "is_default", + "name", + "suppressed" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "suppressions" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all suppression groups for an email address", + "tags": [ + "Suppressions - Suppressions" + ], + "x-stoplight": { + "id": "GET_asm-suppressions-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The email address that you want to search suppression groups for.", + "in": "path", + "name": "email", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/browsers/stats": { + "get": { + "description": "**This endpoint allows you to retrieve your email statistics segmented by browser type.**\n\n**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.\n\nAdvanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/).", + "operationId": "GET_browsers-stats", + "parameters": [ + { + "description": "The browsers to get statistics for. You can include up to 10 different browsers by including this parameter multiple times.", + "in": "query", + "name": "browsers", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_limit" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_offset" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_aggregated_by" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_start_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_end_date" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2014-10-01", + "stats": [ + { + "metrics": { + "clicks": 0, + "unique_clicks": 0 + }, + "name": "Chrome", + "type": "browser" + }, + { + "metrics": { + "clicks": 1, + "unique_clicks": 1 + }, + "name": "Firefox", + "type": "browser" + } + ] + }, + { + "date": "2014-10-02", + "stats": [ + { + "metrics": { + "clicks": 0, + "unique_clicks": 0 + }, + "name": "Chrome", + "type": "browser" + }, + { + "metrics": { + "clicks": 1, + "unique_clicks": 1 + }, + "name": "Firefox", + "type": "browser" + } + ] + } + ] + } + }, + "schema": { + "items": { + "properties": { + "date": { + "description": "The date that the statistics were gathered.", + "type": "string" + }, + "stats": { + "description": "The list of statistics.", + "items": { + "properties": { + "metrics": { + "$ref": "#/components/schemas/advanced_stats_clicks" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by browser.", + "tags": [ + "Stats" + ], + "x-stoplight": { + "id": "GET_browsers-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/campaigns": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all of your campaigns.**\n\nReturns campaigns in reverse order they were created (newest first).\n\nReturns an empty array if no campaigns exist.", + "operationId": "GET_campaigns", + "parameters": [ + { + "description": "The number of results you would like to receive at a time.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "type": "integer" + } + }, + { + "description": "The index of the first campaign to return, where 0 is the first campaign.", + "in": "query", + "name": "offset", + "schema": { + "default": 0, + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "categories": [ + "spring line" + ], + "custom_unsubscribe_url": "", + "html_content": "

Check out our spring line!

", + "id": 986724, + "ip_pool": "marketing", + "list_ids": [ + 110, + 124 + ], + "plain_content": "Check out our spring line!", + "segment_ids": [ + 110 + ], + "sender_id": 124451, + "status": "Draft", + "subject": "New Products for Spring!", + "suppression_group_id": 42, + "title": "March Newsletter" + }, + { + "categories": [ + "winter line" + ], + "custom_unsubscribe_url": "", + "html_content": "

Last call for winter clothes!

", + "id": 986723, + "ip_pool": "marketing", + "list_ids": [ + 110, + 124 + ], + "plain_content": "Last call for winter clothes!", + "segment_ids": [ + 110 + ], + "sender_id": 124451, + "status": "Sent", + "subject": "Final Winter Product Sale!", + "suppression_group_id": 42, + "title": "February Newsletter" + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "items": { + "$ref": "#/components/schemas/campaign_response" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all Campaigns", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "GET_campaigns", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a campaign.**\n\nIn order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both html and plain text), and at least one list or segment ID. This information is not required when you create a campaign.", + "operationId": "POST_campaigns", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/campaign_request" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [ + "spring line" + ], + "custom_unsubscribe_url": "", + "html_content": "

Check out our spring line!

", + "id": 986724, + "ip_pool": "marketing", + "list_ids": [ + 110, + 124 + ], + "plain_content": "Check out our spring line!", + "segment_ids": [ + 110 + ], + "sender_id": 124451, + "status": "Draft", + "subject": "New Products for Spring!", + "suppression_group_id": 42, + "title": "March Newsletter" + } + } + }, + "schema": { + "$ref": "#/components/schemas/campaign_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "title", + "message": "title can't be blank" + }, + { + "field": "title", + "message": "title is too long (maximum is 100 characters)" + }, + { + "field": "categories", + "message": "categories exceeds 10 category limit" + }, + { + "field": "html_content", + "message": "html_content exceeds the 1MB limit" + }, + { + "field": "plain_content", + "message": "plain_content exceeds the 1MB limit" + }, + { + "field": "sender_id", + "message": "sender_id does not exist" + }, + { + "field": "sender_id", + "message": "sender_id is not a verified sender identity" + }, + { + "field": "list_ids", + "message": "list_ids do not all exist" + }, + { + "field": "segment_ids", + "message": "segment_ids do not all exist" + }, + { + "field": "ip_pool", + "message": "The ip pool you provided is invalid" + }, + { + "field": "suppression_group_id", + "message": "suppression_group_id does not exist" + }, + { + "field": "unsubscribes", + "message": "Either suppression_group_id or custom_unsubscribe_url may be set/used, but not both. Please remove one before setting the other." + }, + { + "field": null, + "message": "The JSON you have submitted cannot be parsed." + }, + { + "field": null, + "message": "You've reached your limit of 250 campaigns. Please delete one or more and try again." + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"title\": \"title can't be blank\"\n\"title\": \"title is too long (maximum is 100 characters)\"\n\"categories\": \"categories exceeds 10 category limit\"\n\"html_content\": \"html_content exceeds the 1MB limit\"\n\"plain_content\": \"plain_content exceeds the 1MB limit\"\n\"sender_id\": \"sender_id does not exist\"\n\"sender_id\": \"sender_id is not a verified sender identity\"\n\"list_ids\": \"list_ids do not all exist\"\n\"segment_ids\": \"segment_ids do not all exist\"\n\"ip_pool\": \"The ip pool you provided is invalid\"\n\"suppression_group_id\": \"suppression_group_id does not exist\"\n\"unsubscribes\": \"Either suppression_group_id or custom_unsubscribe_url may be set/used, but not both. Please remove one before setting the other.\"\n\"\": \"The JSON you have submitted cannot be parsed.\"\n\"\": \"You've reached your limit of 250 campaigns. Please delete one or more and try again.\"" + }, + "401": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "POST_campaigns", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/campaigns/{campaign_id}": { + "delete": { + "description": "**This endpoint allows you to delete a specific campaign.**", + "operationId": "DELETE_campaigns-campaign_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "DELETE_campaigns-campaignid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific campaign.**", + "operationId": "GET_campaigns-campaign_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [ + "spring line" + ], + "custom_unsubscribe_url": "", + "html_content": "

Check out our spring line!

", + "id": 986724, + "ip_pool": "marketing", + "list_ids": [ + 110 + ], + "plain_content": "Check out our spring line!", + "segment_ids": [ + 110 + ], + "sender_id": 124451, + "status": "Draft", + "subject": "New Products for Spring!", + "suppression_group_id": 42, + "title": "March Newsletter" + } + } + }, + "schema": { + "properties": { + "categories": { + "items": { + "type": "string" + }, + "type": "array" + }, + "custom_unsubscribe_url": { + "type": "string" + }, + "html_content": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "ip_pool": { + "type": "string" + }, + "list_ids": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "plain_content": { + "type": "string" + }, + "segment_ids": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "sender_id": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "suppression_group_id": { + "type": "integer" + }, + "title": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + } + }, + "schema": { + "type": "object" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a single campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "GET_campaigns-campaignid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the campaign you would like to retrieve.", + "in": "path", + "name": "campaign_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update a specific campaign.**\n\nThis is especially useful if you only set up the campaign using POST /campaigns, but didn't set many of the parameters.", + "operationId": "PATCH_campaigns-campaign_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "categories": [ + "summer line" + ], + "html_content": "

Check out our summer line!

", + "plain_content": "Check out our summer line!", + "subject": "New Products for Summer!", + "title": "May Newsletter" + }, + "properties": { + "categories": { + "description": "The categories you want to tag on this campaign.", + "items": { + "type": "string" + }, + "type": "array" + }, + "html_content": { + "description": "The HTML content of this campaign.", + "type": "string" + }, + "plain_content": { + "description": "The plain content of this campaign.", + "type": "string" + }, + "subject": { + "description": "The subject line for your campaign.", + "type": "string" + }, + "title": { + "description": "The title of the campaign.", + "type": "string" + } + }, + "required": [ + "title", + "subject", + "categories", + "html_content", + "plain_content" + ], + "title": "Update a Campaign request", + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [ + "summer line" + ], + "custom_unsubscribe_url": "", + "html_content": "

Check out our summer line!

", + "id": 986724, + "ip_pool": "marketing", + "list_ids": [ + 110, + 124 + ], + "plain_content": "Check out our summer line!", + "segment_ids": [ + 110 + ], + "sender_id": 124451, + "status": "Draft", + "subject": "New Products for Summer!", + "suppression_group_id": 42, + "title": "May Newsletter" + } + } + }, + "schema": { + "$ref": "#/components/schemas/campaign_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "title", + "message": "title can't be blank" + }, + { + "field": "title", + "message": "title is too long (maximum is 100 characters)" + }, + { + "field": "categories", + "message": "categories exceeds 10 category limit" + }, + { + "field": "html_content", + "message": "html_content exceeds the 1MB limit" + }, + { + "field": "plain_content", + "message": "plain_content exceeds the 1MB limit" + }, + { + "field": "sender_id", + "message": "sender_id does not exist" + }, + { + "field": "sender_id", + "message": "sender_id is not a verified sender identity" + }, + { + "field": "list_ids", + "message": "list_ids do not all exist" + }, + { + "field": "segment_ids", + "message": "segment_ids do not all exist" + }, + { + "field": "ip_pool", + "message": "The ip pool you provided is invalid" + }, + { + "field": "suppression_group_id", + "message": "suppression_group_id does not exist" + }, + { + "field": "unsubscribes", + "message": "Either suppression_group_id or custom_unsubscribe_url may be set/used, but not both. Please remove one before setting the other." + }, + { + "field": null, + "message": "The JSON you have submitted cannot be parsed." + } + ] + } + } + }, + "schema": { + "type": "object" + } + } + }, + "description": "\"title\": \"title can't be blank\"\n\"title\": \"title is too long (maximum is 100 characters)\"\n\"categories\": \"categories exceeds 10 category limit\"\n\"html_content\": \"html_content exceeds the 1MB limit\"\n\"plain_content\": \"plain_content exceeds the 1MB limit\"\n\"sender_id\": \"sender_id does not exist\"\n\"sender_id\": \"sender_id is not a verified sender identity\"\n\"list_ids\": \"list_ids do not all exist\"\n\"segment_ids\": \"segment_ids do not all exist\"\n\"ip_pool\": \"The ip pool you provided is invalid\"\n\"suppression_group_id\": \"suppression_group_id does not exist\"\n\"unsubscribes\": \"Either suppression_group_id or custom_unsubscribe_url may be set/used, but not both. Please remove one before setting the other.\"\n\"\": \"The JSON you have submitted cannot be parsed.\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "403": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "You may only update a campaign when it is in draft mode." + } + ] + } + } + }, + "schema": { + "type": "object" + } + } + }, + "description": "\"\": \"You may only update a campaign when it is in draft mode.\"" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "PATCH_campaigns-campaignid", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/campaigns/{campaign_id}/schedules": { + "delete": { + "description": "**This endpoint allows you to unschedule a campaign that has already been scheduled to be sent.**\n\nA successful unschedule will return a 204.\nIf the specified campaign is in the process of being sent, the only option is to cancel (a different method).", + "operationId": "DELETE_campaigns-campaign_id-schedules", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "403": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "This campaign is already In Progress." + }, + { + "field": null, + "message": "This campaign is already Sent." + }, + { + "field": null, + "message": "This campaign is already Paused." + }, + { + "field": null, + "message": "This campaign is already Canceled." + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"This campaign is already In Progress.\"\n\"\": \"This campaign is already Sent.\"\n\"\": \"This campaign is already Paused.\"\n\"\": \"This campaign is already Canceled.\"" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Unschedule a Scheduled Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "DELETE_campaigns-campaignid-schedules", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve the date and time that a campaign has been scheduled to be sent.**", + "operationId": "GET_campaigns-campaign_id-schedules", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "send_at": 1490778528 + } + } + }, + "schema": { + "properties": { + "send_at": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "send_at" + ], + "title": "View Scheduled Time of a Campaign response", + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "View Scheduled Time of a Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "GET_campaigns-campaignid-schedules", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "campaign_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "patch": { + "description": "**This endpoint allows to you change the scheduled time and date for a campaign to be sent.**", + "operationId": "PATCH_campaigns-campaign_id-schedules", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "send_at": 1489451436 + }, + "properties": { + "send_at": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "send_at" + ], + "title": "Update a Scheduled Campaign request", + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "description": "The campaign ID", + "type": "integer" + }, + "send_at": { + "description": "The unix timestamp to send the campaign.", + "type": "integer" + }, + "status": { + "description": "The status of the schedule.", + "type": "string" + } + }, + "required": [ + "id", + "send_at", + "status" + ], + "title": "Update a Scheduled Campaign response", + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "send_at", + "message": "Please choose a future time for sending your campaign." + }, + { + "field": null, + "message": "The JSON you have submitted cannot be parsed." + }, + { + "field": null, + "message": "You do not have enough credits to send this campaign. Upgrade your plan to send https://app.sendgrid.com/settings/billing" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"The JSON you have submitted cannot be parsed.\"\n\"send_at\": \"Please choose a future time for sending your campaign.\"\n\"\":\"You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing\"" + }, + "403": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "send_at", + "message": "You cannot update the send_at value of non-scheduled campaign." + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"send_at\": \"You cannot update the send_at value of non-scheduled campaign.\"" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a Scheduled Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "PATCH_campaigns-campaignid-schedules", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to schedule a specific date and time for your campaign to be sent.**\n\nIf you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid those times (for example, scheduling at 10:53) can result in lower deferral rates because it won't be going through our servers at the same times as everyone else's mail.", + "operationId": "POST_campaigns-campaign_id-schedules", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "send_at": 1489771528 + }, + "properties": { + "send_at": { + "description": "The unix timestamp for the date and time you would like your campaign to be sent out.", + "type": "integer" + } + }, + "required": [ + "send_at" + ], + "title": "Schedule a Campaign request", + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1234, + "send_at": 1489771528, + "status": "Scheduled" + } + } + }, + "schema": { + "properties": { + "id": { + "description": "The campaign ID.", + "type": "integer" + }, + "send_at": { + "description": "The date time you scheduled your campaign to be sent.", + "type": "integer" + }, + "status": { + "description": "The status of your campaign.", + "enum": [ + "Scheduled" + ], + "type": "string" + } + }, + "required": [ + "id", + "send_at", + "status" + ], + "title": "Schedule a Campaign response", + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "subject", + "message": "subject can't be blank" + }, + { + "field": "sender_id", + "message": "sender_id can't be blank" + }, + { + "field": "plain_content", + "message": "plain_content can't be blank, please provide plain text or html content" + }, + { + "field": "list_id", + "message": "You must select at least 1 segment or 1 list to send to." + }, + { + "field": "unsubscribe_tag", + "message": "An [unsubscribe] tag in both your html and plain content is required to send a campaign." + }, + { + "field": "suppression_group_id", + "message": "Either a suppression_group_id or custom_unsubscribe_url is required to send a campaign." + }, + { + "field": null, + "message": "You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"subject\": \"subject can't be blank\"\n\"sender_id\": \"sender_id can't be blank\"\n\"plain_content\": \"plain_content can't be blank, please provide plain text or html content\"\n\"list_ids\": \"You must select at least 1 segment or 1 list to send to.\"\n\"send_at\": \"Please choose a future time for sending your campaign.\"\n\"unsubscribe_tag\": \"An [unsubscribe] tag in both your html and plain content is required to send a campaign.\"\n\"suppression_group_id\": \"Either a suppression_group_id or custom_unsubscribe_url is required to send a campaign.\"\n\"\": \"The JSON you have submitted cannot be parsed.\"\n\"\":\"You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "403": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "You cannot POST to a campaign that has already sent or scheduled. However you can update a scheduled campaign with a PATCH." + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"You cannot POST to a campaign that has already sent or scheduled. However you can update a scheduled campaign with a PATCH.\"" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Schedule a Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "POST_campaigns-campaignid-schedules", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/campaigns/{campaign_id}/schedules/now": { + "parameters": [ + { + "in": "path", + "name": "campaign_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "post": { + "description": "**This endpoint allows you to immediately send an existing campaign.**\n\nNormally a POST request would have a body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed.", + "operationId": "POST_campaigns-campaign_id-schedules-now", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1234, + "status": "Scheduled" + } + } + }, + "schema": { + "properties": { + "id": { + "format": "int64", + "type": "integer" + }, + "status": { + "type": "string" + } + }, + "required": [ + "id", + "status" + ], + "title": "Send a Campaign response", + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "subject", + "message": "subject can't be blank" + }, + { + "field": "sender_id", + "message": "sender_id can't be blank" + }, + { + "field": "plain_content", + "message": "plain_content can't be blank, please provide plain text or html content" + }, + { + "field": "list_id", + "message": "You must select at least 1 segment or 1 list to send to." + }, + { + "field": "unsubscribe_tag", + "message": "An [unsubscribe] tag in both your html and plain content is required to send a campaign." + }, + { + "field": "suppression_group_id", + "message": "Either a suppression_group_id or custom_unsubscribe_url is required to send a campaign." + }, + { + "field": null, + "message": "You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"subject\": \"subject can't be blank\"\n\"sender_id\": \"sender_id can't be blank\"\n\"plain_content\": \"plain_content can't be blank, please provide plain text or html content\"\n\"list_ids\": \"You must select at least 1 segment or 1 list to send to.\"\n\"unsubscribe_tag\": \"An [unsubscribe] tag in both your html and plain content is required to send a campaign.\"\n\"suppression_group_id\": \"Either a suppression_group_id or custom_unsubscribe_url is required to send a campaign.\"\n\"\": \"You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "403": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "You may only send a campaign when it is in draft mode." + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"You may only send a campaign when it is in draft mode.\"" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Send a Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "POST_campaigns-campaignid-schedules-now", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/campaigns/{campaign_id}/schedules/test": { + "parameters": [ + { + "in": "path", + "name": "campaign_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "post": { + "description": "**This endpoint allows you to send a test campaign.**\n\nTo send to multiple addresses, use an array for the JSON \"to\" value [\"one@address\",\"two@address\"]", + "operationId": "POST_campaigns-campaign_id-schedules-test", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "to": "your.email@example.com" + }, + "properties": { + "to": { + "description": "The email address that should receive the test campaign.", + "format": "email", + "type": "string" + } + }, + "required": [ + "to" + ], + "type": "object" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": { + "to": { + "type": "string" + } + }, + "required": [ + "to" + ], + "title": "Send a Test Campaign request", + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "send_at", + "message": "Please choose a future time for sending your campaign." + }, + { + "field": null, + "message": "The JSON you have submitted cannot be parsed." + }, + { + "field": null, + "message": "You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"The JSON you have submitted cannot be parsed.\"\n\"to\": \"Please provide an email address to which the test should be sent.\"\n\"to\": \"You can only send tests to 10 addresses at a time.\"\n\"subject\": \"Please add a subject to your campaign before sending a test.\"\n\"plain_content\": \"Plain content and html content can't both be blank. Please set one of these values before sending a test.\"\n\"sender_id\": \"Please assign a sender identity to your campaign before sending a test.\"" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\": \"not found\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Send a Test Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "id": "POST_campaigns-campaignid-schedules-test", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/categories": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all of your categories.**", + "operationId": "GET_categories", + "parameters": [ + { + "description": "The number of categories to display per page.", + "in": "query", + "name": "limit", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "Allows you to perform a prefix search on this particular category.", + "in": "query", + "name": "category", + "schema": { + "type": "string" + } + }, + { + "description": "The point in the list that you would like to begin displaying results.", + "in": "query", + "name": "offset", + "schema": { + "default": 0, + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "category": "category 1" + }, + { + "category": "category 2" + } + ] + } + }, + "schema": { + "items": { + "properties": { + "category": { + "description": "A category used to group emails by broad topic.", + "type": "string" + } + }, + "required": [ + "category" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "sort_by", + "message": "invalid sort value" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "description": "The error returned.", + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "description": "A message explaining why your categories could not be retrieved.", + "type": "string" + } + }, + "required": [ + "field", + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all categories", + "tags": [ + "Categories" + ], + "x-stoplight": { + "id": "GET_categories", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/categories/stats": { + "get": { + "description": "**This endpoint allows you to retrieve all of your email statistics for each of your categories.**\n\nIf you do not define any query parameters, this endpoint will return a sum for each category in groups of 10.", + "operationId": "GET_categories-stats", + "parameters": [ + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD", + "in": "query", + "name": "start_date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "The individual categories that you want to retrieve statistics for. You may include up to 10 different categories.", + "in": "query", + "name": "categories", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The number of results to include.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 500, + "maximum": 500, + "type": "integer" + } + }, + { + "description": "The number of results to skip.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "in": "query", + "name": "aggregated_by", + "required": false, + "schema": { + "enum": [ + "day", + "week", + "month" + ], + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2015-10-01", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "docs", + "type": "category" + }, + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "mattscategory", + "type": "category" + } + ] + }, + { + "date": "2015-11-01", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "docs", + "type": "category" + }, + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "mattscategory", + "type": "category" + } + ] + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/category_stats" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Email Statistics for Categories", + "tags": [ + "Categories" + ], + "x-stoplight": { + "id": "GET_categories-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/categories/stats/sums": { + "get": { + "description": "**This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.**\n\nIf you do not define any query parameters, this endpoint will return a sum for each category in groups of 10.", + "operationId": "GET_categories-stats-sums", + "parameters": [ + { + "description": "The metric that you want to sort by. Must be a single metric.", + "in": "query", + "name": "sort_by_metric", + "required": false, + "schema": { + "default": "delivered", + "type": "string" + } + }, + { + "description": "The direction you want to sort.", + "in": "query", + "name": "sort_by_direction", + "required": false, + "schema": { + "default": "desc", + "enum": [ + "desc", + "asc" + ], + "type": "string" + } + }, + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Limits the number of results returned.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 5, + "type": "integer" + } + }, + { + "description": "The point in the list to begin retrieving results.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "type": "integer" + } + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "in": "query", + "name": "aggregated_by", + "required": false, + "schema": { + "enum": [ + "day", + "week", + "month" + ], + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "date": "2015-01-01", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 20, + "deferred": 0, + "delivered": 20, + "invalid_emails": 0, + "opens": 20, + "processed": 0, + "requests": 20, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 20, + "unique_opens": 20, + "unsubscribe_drops": 0, + "unsubscribes": 20 + }, + "name": "cat1", + "type": "category" + }, + { + "metrics": { + "blocks": 1, + "bounce_drops": 0, + "bounces": 0, + "clicks": 19, + "deferred": 0, + "delivered": 19, + "invalid_emails": 0, + "opens": 19, + "processed": 0, + "requests": 20, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 19, + "unique_opens": 19, + "unsubscribe_drops": 0, + "unsubscribes": 19 + }, + "name": "cat2", + "type": "category" + }, + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 5, + "deferred": 0, + "delivered": 5, + "invalid_emails": 0, + "opens": 5, + "processed": 0, + "requests": 5, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 5, + "unique_opens": 5, + "unsubscribe_drops": 0, + "unsubscribes": 5 + }, + "name": "cat3", + "type": "category" + }, + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 6, + "deferred": 0, + "delivered": 5, + "invalid_emails": 0, + "opens": 6, + "processed": 0, + "requests": 5, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 5, + "unique_opens": 5, + "unsubscribe_drops": 0, + "unsubscribes": 6 + }, + "name": "cat4", + "type": "category" + }, + { + "metrics": { + "blocks": 10, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 10, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "cat5", + "type": "category" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/category_stats" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?]", + "tags": [ + "Categories" + ], + "x-stoplight": { + "id": "GET_categories-stats-sums", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/clients/stats": { + "get": { + "description": "**This endpoint allows you to retrieve your email statistics segmented by client type.**\n\n**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.\n\nAdvanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/).", + "operationId": "GET_clients-stats", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedStatsBaseQueryStrings_start_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedStatsBaseQueryStrings_end_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedStatsBaseQueryStrings_aggregated_by" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2014-10-01", + "stats": [ + { + "metrics": { + "opens": 1, + "unique_opens": 1 + }, + "name": "Gmail", + "type": "client" + } + ] + }, + { + "date": "2014-10-02", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "client" + } + ] + } + ] + } + }, + "schema": { + "items": { + "properties": { + "date": { + "description": "The date that the statistics were gathered.", + "type": "string" + }, + "stats": { + "description": "The list of statistics.", + "items": { + "properties": { + "metrics": { + "$ref": "#/components/schemas/advanced_stats_opens" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by client type.", + "tags": [ + "Stats" + ], + "x-stoplight": { + "id": "GET_clients-stats", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/clients/{client_type}/stats": { + "get": { + "description": "**This endpoint allows you to retrieve your email statistics segmented by a specific client type.**\n\n**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.\n\n## Available Client Types\n- phone\n- tablet\n- webmail\n- desktop\n\nAdvanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/).", + "operationId": "GET_clients-client_type-stats", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedStatsBaseQueryStrings_start_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedStatsBaseQueryStrings_end_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedStatsBaseQueryStrings_aggregated_by" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2014-10-01", + "stats": [ + { + "metrics": { + "opens": 1, + "unique_opens": 1 + }, + "name": "Gmail", + "type": "client" + } + ] + }, + { + "date": "2014-10-02", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "client" + } + ] + } + ] + } + }, + "schema": { + "items": { + "properties": { + "date": { + "description": "The date that the statistics were gathered.", + "type": "string" + }, + "stats": { + "description": "The list of statistics.", + "items": { + "properties": { + "metrics": { + "$ref": "#/components/schemas/advanced_stats_opens" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve stats by a specific client type.", + "tags": [ + "Stats" + ], + "x-stoplight": { + "id": "GET_clients-clienttype-stats", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "Specifies the type of client to retrieve stats for. Must be either \"phone\", \"tablet\", \"webmail\", or \"desktop\".", + "in": "path", + "name": "client_type", + "required": true, + "schema": { + "enum": [ + "phone", + "tablet", + "webmail", + "desktop" + ], + "type": "string" + } + } + ] + }, + "/contactdb/custom_fields": { + "get": { + "description": "**This endpoint allows you to retrieve all custom fields.**", + "operationId": "GET_contactdb-custom_fields", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "custom_fields": [ + { + "id": 6234, + "name": "age", + "type": "number" + }, + { + "id": 6233, + "name": "country", + "type": "text" + }, + { + "id": 6235, + "name": "favorite_color", + "type": "text" + }, + { + "id": 6239, + "name": "fname", + "type": "text" + }, + { + "id": 6240, + "name": "lname", + "type": "text" + }, + { + "id": 49439, + "name": "pet", + "type": "text" + } + ] + } + } + }, + "schema": { + "properties": { + "custom_fields": { + "items": { + "$ref": "#/components/schemas/contactdb_custom_field_with_id" + }, + "type": "array" + } + }, + "required": [ + "custom_fields" + ], + "title": "List All Custom Fields response", + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all custom fields", + "tags": [ + "Contacts API - Custom Fields" + ], + "x-stoplight": { + "id": "GET_contactdb-customfields", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a custom field.**\n\n**You can create up to 120 custom fields.**", + "operationId": "POST_contactdb-custom_fields", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "pet", + "type": "text" + }, + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1, + "name": "pet", + "type": "text" + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_custom_field_with_id" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "Returned if request body is invalid JSON" + }, + { + "field": "type", + "message": "Returned if custom field type is invalid or not provided" + }, + { + "field": "name", + "message": "Returned if custom field name is not provided" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\" : \"Returned if request body is invalid JSON\"\n\"type\" : \"Returned if custom field type is invalid or not provided\"\n\"name\" : \"Returned if custom field name is not provided\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Custom Field", + "tags": [ + "Contacts API - Custom Fields" + ], + "x-stoplight": { + "id": "POST_contactdb-customfields", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/custom_fields/{custom_field_id}": { + "delete": { + "description": "**This endpoint allows you to delete a custom field by ID.**", + "operationId": "DELETE_contactdb-custom_fields-custom_field_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "202": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "message": "Custom Field delete is processing." + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "Custom field in use by one or more segment conditions" + }, + { + "message": "Custom field ID does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"id\" : \"Returned if custom_field_id is not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "Custom field ID does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"custom_field_id\" : \"Returned if custom_field_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Custom Field", + "tags": [ + "Contacts API - Custom Fields" + ], + "x-stoplight": { + "id": "DELETE_contactdb-customfields-customfieldid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a custom field by ID.**", + "operationId": "GET_contactdb-custom_fields-custom_field_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1, + "name": "pet", + "type": "text" + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_custom_field_with_id" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "invalid id" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "Custom field ID does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"custom_field_id\" : \"Returned if custom_field_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Custom Field", + "tags": [ + "Contacts API - Custom Fields" + ], + "x-stoplight": { + "id": "GET_contactdb-customfields-customfieldid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the custom field that you want to retrieve.", + "in": "path", + "name": "custom_field_id", + "required": true, + "schema": { + "type": "integer" + } + } + ] + }, + "/contactdb/lists": { + "delete": { + "description": "**This endpoint allows you to delete multiple recipient lists.**", + "operationId": "DELETE_contactdb-lists", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": [ + 1, + 2, + 3, + 4 + ], + "items": { + "type": "integer" + }, + "type": "array" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "list id was invalid" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"id\" : \"Returned if all list ids are not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Multiple lists", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "DELETE_contactdb-lists", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve all of your recipient lists. If you don't have any lists, an empty array will be returned.**", + "operationId": "GET_contactdb-lists", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "lists": [ + { + "id": 1, + "name": "the jones", + "recipient_count": 1 + } + ] + } + } + }, + "schema": { + "properties": { + "lists": { + "items": { + "$ref": "#/components/schemas/contactdb_list" + }, + "type": "array" + } + }, + "required": [ + "lists" + ], + "title": "List All Lists response", + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all lists", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "GET_contactdb-lists", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a list for your recipients.**", + "operationId": "POST_contactdb-lists", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "your list name" + }, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Create a List request", + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1, + "name": "your list name", + "recipient_count": 0 + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_list" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "Returned if request body is invalid JSON" + }, + { + "field": "name", + "message": "Returned if list name is not a string" + }, + { + "field": "name", + "message": "Returned if list name is a duplicate of an existing list or segment" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"name\" : \"Returned if list name is a duplicate of an existing list or segment\"\n\"name\" : \"Returned if list name is not a string\"\n\"\" : \"Returned if request body is invalid JSON\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a List", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "POST_contactdb-lists", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/lists/{list_id}": { + "delete": { + "description": "**This endpoint allows you to delete a specific recipient list with the given ID.**", + "operationId": "DELETE_contactdb-lists-list_id", + "parameters": [ + { + "description": "Adds the ability to delete all contacts on the list in addition to deleting the list.", + "in": "query", + "name": "delete_contacts", + "schema": { + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/DELETE_contactdb-lists-list_idBody" + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "delete_contacts", + "message": "delete_contacts not a bool" + }, + { + "field": "list_id", + "message": "Returned if list_id is not valid" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id is not valid\"\n\"delete_contacts\" : \"Returned if delete_contacts is not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "List not found: 5" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a List", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "DELETE_contactdb-lists-listid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a single recipient list.**", + "operationId": "GET_contactdb-lists-list_id", + "parameters": [ + { + "description": "The ID of the list to retrieve.", + "in": "query", + "name": "list_id", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1, + "name": "listname", + "recipient_count": 0 + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_list" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "invalid id" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id is not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "List ID does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a single list", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "GET_contactdb-lists-listid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "list_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update the name of one of your recipient lists.**", + "operationId": "PATCH_contactdb-lists-list_id", + "parameters": [ + { + "description": "The ID of the list you are updating.", + "in": "query", + "name": "list_id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "newlistname" + }, + "properties": { + "name": { + "description": "The new name for your list. ", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Update a List request", + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1234, + "name": "2016 iPhone Users", + "recipient_count": 0 + } + } + }, + "schema": { + "properties": { + "id": { + "description": "The ID of the list", + "type": "integer" + }, + "name": { + "description": "The new name for the list", + "type": "string" + }, + "recipient_count": { + "description": "The number of recipients on the list", + "type": "integer" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "invalid id" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"name\" : \"Returned if list name is a duplicate of existing list or segment\"\n\"name\" : \"Returned if list name is invalid or not provided\"\n\"list_id\" : \"Returned if list_id is not valid\"\n\"\" : \"Returned if request body is invalid JSON\"" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "List ID does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a List", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "PATCH_contactdb-lists-listid", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/lists/{list_id}/recipients": { + "get": { + "description": "**This endpoint allows you to retrieve all recipients on the list with the given ID.**", + "operationId": "GET_contactdb-lists-list_id-recipients", + "parameters": [ + { + "description": "Page index of first recipient to return (must be a positive integer)", + "in": "query", + "name": "page", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "description": "Number of recipients to return at a time (must be a positive integer between 1 and 1000)", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "description": "The ID of the list whose recipients you are requesting.", + "in": "query", + "name": "list_id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipients": [ + { + "created_at": 1433348344, + "custom_fields": [ + { + "id": 6234, + "name": "age", + "type": "number", + "value": null + }, + { + "id": 6233, + "name": "country", + "type": "text", + "value": null + }, + { + "id": 6235, + "name": "fname", + "type": "text", + "value": "Example" + }, + { + "id": 6239, + "name": "lname", + "type": "text", + "value": "User" + }, + { + "id": 6240, + "name": "lname", + "type": "text", + "value": null + } + ], + "email": "example@example.com", + "first_name": "Example", + "id": "ZGVWfyZWsuYmFpbmVzQHNlbmRmCmLkLmNv==", + "last_clicked": 1438616117, + "last_emailed": 1438613272, + "last_name": "User", + "last_opened": 1438616109, + "updated_at": 1438616119 + } + ] + } + } + }, + "schema": { + "properties": { + "recipients": { + "items": { + "$ref": "#/components/schemas/contactdb_recipient" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id is not a valid integer" + }, + { + "field": "page", + "message": "Returned if page is not a valid integer" + }, + { + "field": "page", + "message": "Returned if page is less than 1" + }, + { + "field": "page_size", + "message": "Returned if page_size is not a valid integer" + }, + { + "field": "page_size", + "message": "Returned if page_size is less than 1 or greater than 1000" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id is not a valid integer\"\n\"page\" : \"Returned if page is not a valid integer\"\n\"page\" : \"Returned if page is less than 1\"\n\"page_size\" : \"Returned if page_size is not a valid integer\"\n\"page_size\" : \"Returned if page_size is less than 1 or greater than 1000\"" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id is invalid" + } + ] + } + } + }, + "schema": { + "type": "object" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all recipients on a List", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "GET_contactdb-lists-listid-recipients", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the list of recipients you want to retrieve.", + "in": "path", + "name": "list_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "post": { + "description": "**This endpoint allows you to add multiple recipients to a list.**\n\nAdds existing recipients to a list, passing in the recipient IDs to add. Recipient IDs should be passed exactly as they are returned from recipient endpoints.", + "operationId": "POST_contactdb-lists-list_id-recipients", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": [ + 1, + 2 + ], + "items": { + "type": "integer" + }, + "type": "array" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "list_id", + "message": "list_id is invalid" + }, + { + "field": "recipient_id", + "message": "no valid recipients were provided" + }, + { + "field": null, + "message": "no recipients were added" + }, + { + "field": null, + "message": "request body is invalid JSON" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id is not a valid integer\"\n\"\" : \"Returned if no valid recipient ids were passed\"\n\"\" : \"Returned if no recipients were added\"\n\"\" : \"Returned if request body is invalid JSON\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "list_id", + "message": "list_id does not exist" + }, + { + "field": "recipient_id", + "message": "recipient_id does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\": \"Returned if list_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add Multiple Recipients to a List", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "POST_contactdb-lists-listid-recipients", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/lists/{list_id}/recipients/{recipient_id}": { + "delete": { + "description": "**This endpoint allows you to delete a single recipient from a list.**", + "operationId": "DELETE_contactdb-lists-list_id-recipients-recipient_id", + "parameters": [ + { + "description": "The ID of the list you are taking this recipient away from.", + "in": "query", + "name": "list_id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "The ID of the recipient to take off the list.", + "in": "query", + "name": "recipient_id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/DELETE_contactdb-lists-list_idBody" + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id is invalid" + }, + { + "field": "recipient_id", + "message": "no valid recipients were provided" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id is not valid\"\n\"recipient_id\" : \"Returned if recipient_id is not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id does not exist" + }, + { + "field": "recipient_id", + "message": "Returned if recipient_id does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id does not exist\"\n\"recipient_id\" : \"Returned if recipient_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Single Recipient from a Single List", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "DELETE_contactdb-lists-listid-recipients-recipientid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the list that you want to add the recipient to.", + "in": "path", + "name": "list_id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "The ID of the recipient you are adding to the list.", + "in": "path", + "name": "recipient_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to add a single recipient to a list.**", + "operationId": "POST_contactdb-lists-list_id-recipients-recipient_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id is invalid" + }, + { + "field": "recipient_id", + "message": "Returned if recipient_id is invalid" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id is invalid\"\n\"recipient_id\" : \"Returned if recipient_id is invalid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id does not exist" + }, + { + "field": "recipient_id", + "message": "Returned if recipient_id does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"list_id\" : \"Returned if list_id does not exist\"\n\"recipient_id\" : \"Returned if recipient_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add a Single Recipient to a List", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "id": "POST_contactdb-lists-listid-recipients-recipientid", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/recipients": { + "delete": { + "description": "**This endpoint allows you to deletes one or more recipients.**\n\nThe body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete.", + "operationId": "DELETE_contactdb-recipients", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": [ + "recipient_id1", + "recipient_id2" + ], + "items": { + "type": "string" + }, + "type": "array" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "No recipient ids provided" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\" : \"Returned if no recipients are deleted\"\n\"\" : \"Returned if all of the provided recipient ids are invalid\"\n\"\" : \"Returned if request body is not valid json\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "DELETE_contactdb-recipients", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve all of your Marketing Campaigns recipients.**\n\nBatch deletion of a page makes it possible to receive an empty page of recipients before reaching the end of\nthe list of recipients. To avoid this issue; iterate over pages until a 404 is retrieved.", + "operationId": "GET_contactdb-recipients", + "parameters": [ + { + "description": "Page index of first recipients to return (must be a positive integer)", + "in": "query", + "name": "page", + "schema": { + "type": "integer" + } + }, + { + "description": "Number of recipients to return at a time (must be a positive integer between 1 and 1000)", + "in": "query", + "name": "page_size", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "recipients": { + "items": { + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "recipients" + ], + "title": "List Recipients response", + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "\"page\" : \"Returned if page is not a valid integer\"\n\"page\" : \"Returned if page is less than 1\"\n\"page_size\" : \"Returned if page_size is not a valid integer\"\n\"page_size\" : \"Returned if page_size is less than 1 or greater than 1000\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "GET_contactdb-recipients", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update one or more recipients.**\n\nThe body of an API call to this endpoint must include an array of one or more recipient objects.\n\nIt is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields SendGrid provides.", + "operationId": "PATCH_contactdb-recipients", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": [ + { + "email": "jones@example.com", + "first_name": "Guy", + "last_name": "Jones" + } + ], + "items": { + "properties": { + "email": { + "format": "email", + "type": "string" + }, + "first_name": { + "description": "The first name of the recipient. This is one of the default custom fields.", + "type": "string" + }, + "last_name": { + "description": "The last name of the recipient. This is one of the default custom fields.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + }, + "type": "array" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contactdb_recipient_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "Request body is not valid json" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\" : \"Returned if request body is not valid json\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Recipient", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "PATCH_contactdb-recipients", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to add a Marketing Campaigns recipient.**\n\nYou can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides.\n\nThe rate limit is three requests every 2 seconds. You can upload 1000 contacts per request. So the maximum upload rate is 1500 recipients per second.", + "operationId": "POST_contactdb-recipients", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": [ + { + "age": 25, + "email": "example@example.com", + "first_name": "", + "last_name": "User" + }, + { + "age": 25, + "email": "example2@example.com", + "first_name": "Example", + "last_name": "User" + } + ], + "items": { + "properties": { + "age": { + "type": "integer" + }, + "email": { + "description": "The email address of the recipient.", + "format": "email", + "type": "string" + }, + "first_name": { + "description": "The first name of the recipient.", + "type": "string" + }, + "last_name": { + "description": "The last name of the recipient.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + }, + "type": "array" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "error_count": 1, + "error_indices": [ + 2 + ], + "errors": [ + { + "error_indices": [ + 2 + ], + "message": "Invalid email." + } + ], + "new_count": 2, + "persisted_recipients": [ + "YUBh", + "bWlsbGVyQG1pbGxlci50ZXN0" + ], + "updated_count": 0 + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_recipient_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "Request body is not valid json" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\" : \"Returned if request body is not valid json\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "POST_contactdb-recipients", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/recipients/billable_count": { + "get": { + "description": "**This endpoint allows you to retrieve the number of Marketing Campaigns recipients that you will be billed for.**\n\nYou are billed for marketing campaigns based on the highest number of recipients you have had in your account at one time. This endpoint will allow you to know the current billable count value.", + "operationId": "GET_contactdb-recipients-billable_count", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipient_count": 1234 + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_recipient_count" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the count of billable recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "GET_contactdb-recipients-billablecount", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/contactdb/recipients/count": { + "get": { + "description": "**This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.**", + "operationId": "GET_contactdb-recipients-count", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipient_count": 1234 + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_recipient_count" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Count of Recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "GET_contactdb-recipients-count", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/recipients/search": { + "get": { + "description": "**This endpoint allows you to perform a search on all of your Marketing Campaigns recipients.**\n\nfield_name:\n\n* is a variable that is substituted for your actual custom field name from your recipient.\n* Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200)\n* If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert\nyour epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to\nMon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through\nMon, 02 Feb 2015 23:59:59 GMT.", + "operationId": "GET_contactdb-recipients-search", + "parameters": [ + { + "in": "query", + "name": "{field_name}", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipients": [ + { + "created_at": 1422313607, + "custom_fields": [ + { + "id": 23, + "name": "pet", + "type": "text", + "value": "Fluffy" + } + ], + "email": "jones@example.com", + "first_name": null, + "id": "YUBh", + "last_clicked": null, + "last_emailed": null, + "last_name": "Jones", + "last_opened": null, + "updated_at": 1422313790 + } + ] + } + } + }, + "schema": { + "properties": { + "recipients": { + "items": { + "$ref": "#/components/schemas/contactdb_recipient" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "The following parameters are not custom fields or reserved fields: [{field_name}]" + }, + { + "message": "No search params are specified" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"\" : \"Returned if no search params are specified\"\n\"field\" : \"Returned if the provided field is invalid or does not exist\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Search recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "GET_contactdb-recipients-search", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "

\n Search using segment conditions without actually creating a segment.\n Body contains a JSON object with conditions, a list of conditions as described below, and an optional list_id, which is a valid list ID for a list to limit the search on.\n

\n\n

\n Valid operators for create and update depend on the type of the field for which you are searching.\n

\n\n
    \n
  • Dates:\n
      \n
    • \"eq\", \"ne\", \"lt\" (before), \"gt\" (after)\n
        \n
      • You may use MM/DD/YYYY for day granularity or an epoch for second granularity.
      • \n
      \n
    • \n
    • \"empty\", \"not_empty\"
    • \n
    • \"is within\"\n \n
    • \n
    \n
  • \n
  • Text: \"contains\", \"eq\" (is - matches the full field), \"ne\" (is not - matches any field where the entire field is not the condition value), \"empty\", \"not_empty\"
  • \n
  • Numbers: \"eq\", \"lt\", \"gt\", \"empty\", \"not_empty\"
  • \n
  • Email Clicks and Opens: \"eq\" (opened), \"ne\" (not opened)
  • \n
\n\n

\n Field values must all be a string.\n

\n\n

\n Search conditions using \"eq\" or \"ne\" for email clicks and opens should provide a \"field\" of either clicks.campaign_identifier or opens.campaign_identifier.\n The condition value should be a string containing the id of a completed campaign.\n

\n\n

\n Search conditions list may contain multiple conditions, joined by an \"and\" or \"or\" in the \"and_or\" field.\n The first condition in the conditions list must have an empty \"and_or\", and subsequent conditions must all specify an \"and_or\".\n

", + "operationId": "POST_contactdb-recipients-search", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "conditions": [ + { + "and_or": "", + "field": "birthday", + "operator": "eq", + "value": "01/12/1985" + }, + { + "and_or": "", + "field": "birthday", + "operator": "eq", + "value": "01/12/1985" + }, + { + "and_or": "", + "field": "birthday", + "operator": "eq", + "value": "01/12/1985" + }, + { + "and_or": "", + "field": "birthday", + "operator": "eq", + "value": "01/12/1985" + } + ], + "list_id": -27497588 + }, + "properties": { + "conditions": { + "description": "The conditions by which this segment should be created.", + "items": { + "$ref": "#/components/schemas/contactdb_segments_conditions" + }, + "type": "array" + }, + "list_id": { + "format": "int32", + "type": "integer" + } + }, + "required": [ + "list_id", + "conditions" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipient_count": 65190677, + "recipients": [ + { + "created_at": -27901208, + "email": "ut magna quis ipsum", + "id": "fugiat ad adipisicing ullamco", + "last_emailed": 21626657 + }, + { + "created_at": 17466400, + "email": "sunt irure", + "first_name": "est", + "id": "et", + "last_clicked": -23135244, + "last_opened": -44593357 + }, + { + "created_at": -34495329, + "email": "reprehenderit incididunt velit Lorem esse", + "id": "esse Ut ad dolore", + "last_clicked": 10164083, + "last_opened": 34443062 + }, + { + "created_at": -37030673, + "email": "amet deserunt fugiat voluptate", + "id": "et exercitation commodo id laborum", + "last_clicked": -10497425 + }, + { + "created_at": 3658435, + "custom_fields": [ + { + "id": -5765608, + "name": "proident pariatur", + "type": "dolore ut", + "value": "do in magna mollit" + }, + { + "id": -31131201, + "name": "laborum mollit", + "type": "veniam", + "value": 84434696 + } + ], + "email": "labore veniam", + "first_name": "Ut cupidatat nulla deserunt adipisicing", + "id": "ad pariatur esse", + "last_clicked": -52862671, + "last_opened": -84227501, + "updated_at": -56455352 + } + ] + } + } + }, + "schema": { + "properties": { + "recipient_count": { + "type": "integer" + }, + "recipients": { + "items": { + "properties": { + "created_at": { + "type": "integer" + }, + "custom_fields": { + "items": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + } + }, + "type": "object" + }, + "type": "array" + }, + "email": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "last_clicked": { + "type": "integer" + }, + "last_emailed": { + "type": "integer" + }, + "last_opened": { + "type": "integer" + }, + "updated_at": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Search recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "POST_contactdb-recipients-search", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/contactdb/recipients/{recipient_id}": { + "delete": { + "description": "**This endpoint allows you to delete a single recipient with the given ID from your contact database.**\n\n> Use this to permanently delete your recipients from all of your contact lists and all segments if required by applicable law.", + "operationId": "DELETE_contactdb-recipients-recipient_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "recipient not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"recipient_id\" : \"Returned if recipient_id is not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "recipient_id is not valid" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"recipient_id\" : \"Returned if record for recipient id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Recipient", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "DELETE_contactdb-recipients-recipientid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a single recipient by ID from your contact database.**", + "operationId": "GET_contactdb-recipients-recipient_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contactdb_recipient" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "\"recipient_id\" : \"Returned if recipient_id is not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "\"recipient_id\" : \"Returned if record for recipient id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a single recipient", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "GET_contactdb-recipients-recipientid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the recipient that you want to retrieve.", + "in": "path", + "name": "recipient_id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/contactdb/recipients/{recipient_id}/lists": { + "get": { + "description": "**This endpoint allows you to retrieve the lists that a given recipient belongs to.**\n\nEach recipient can be on many lists. This endpoint gives you all of the lists that any one recipient has been added to.", + "operationId": "GET_contactdb-recipients-recipient_id-lists", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "lists": [ + { + "id": 1234, + "name": "Example list", + "recipient_count": 42 + } + ] + } + } + }, + "schema": { + "properties": { + "lists": { + "items": { + "$ref": "#/components/schemas/contactdb_list" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "recipient ID is invalid" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"recipient_id\" : \"Returned if recipient_id is not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "recipient id not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"recipient_id\" : \"Returned if record for the recipient id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the lists that a recipient is on", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "GET_contactdb-recipients-recipientid-lists", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the recipient for whom you are retrieving lists.", + "in": "path", + "name": "recipient_id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/contactdb/reserved_fields": { + "get": { + "description": "**This endpoint allows you to list all fields that are reserved and can't be used for custom field names.**", + "operationId": "GET_contactdb-reserved_fields", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "reserved_fields": [ + { + "name": "first_name", + "type": "text" + }, + { + "name": "last_name", + "type": "text" + }, + { + "name": "email", + "type": "text" + }, + { + "name": "created_at", + "type": "date" + }, + { + "name": "updated_at", + "type": "date" + }, + { + "name": "last_emailed", + "type": "date" + }, + { + "name": "last_clicked", + "type": "date" + }, + { + "name": "last_opened", + "type": "date" + }, + { + "name": "lists", + "type": "set" + }, + { + "name": "campaigns", + "type": "set" + }, + { + "name": "my_custom_field", + "type": "text" + } + ] + } + } + }, + "schema": { + "properties": { + "reserved_fields": { + "items": { + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve reserved fields", + "tags": [ + "Contacts API - Custom Fields" + ], + "x-stoplight": { + "id": "GET_contactdb-reservedfields", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/segments": { + "get": { + "description": "**This endpoint allows you to retrieve all of your segments.**", + "operationId": "GET_contactdb-segments", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "segments": [ + { + "conditions": [ + { + "field": "age", + "operator": "lt", + "value": "25" + } + ], + "id": 1234, + "name": "Age segments < 25", + "recipient_count": 8 + }, + { + "conditions": [ + { + "field": "email", + "operator": "contains", + "value": "@gmail.com" + } + ], + "id": 2345, + "name": "email address - gmail", + "recipient_count": 0 + } + ] + } + } + }, + "schema": { + "properties": { + "segments": { + "items": { + "$ref": "#/components/schemas/contactdb_segments" + }, + "type": "array" + } + }, + "required": [ + "segments" + ], + "title": "List All Segments response", + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all segments", + "tags": [ + "Contacts API - Segments" + ], + "x-stoplight": { + "id": "GET_contactdb-segments", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new segment.**\n\n\n Valid operators for create and update depend on the type of the field for which you are searching.\n\n**Dates**\n- \"eq\", \"ne\", \"lt\" (before), \"gt\" (after)\n - You may use MM/DD/YYYY for day granularity or an epoch for second granularity.\n- \"empty\", \"not_empty\"\n- \"is within\"\n - You may use an [ISO 8601 date format](https://en.wikipedia.org/wiki/ISO_8601) or the # of days.\n\n**Text**\n- \"contains\"\n- \"eq\" (is/equals - matches the full field)\n- \"ne\" (is not/not equals - matches any field where the entire field is not the condition value)\n- \"empty\"\n- \"not_empty\"\n\n**Numbers**\n- \"eq\" (is/equals)\n- \"lt\" (is less than)\n- \"gt\" (is greater than)\n- \"empty\"\n- \"not_empty\"\n\n**Email Clicks and Opens**\n- \"eq\" (opened)\n- \"ne\" (not opened)\n\nAll field values must be a string.\n\n\nConditions using \"eq\" or \"ne\" for email clicks and opens should provide a \"field\" of either `clicks.campaign_identifier` or `opens.campaign_identifier`.\nThe condition value should be a string containing the id of a completed campaign.\n\n\nThe conditions list may contain multiple conditions, joined by an \"and\" or \"or\" in the \"and_or\" field.\n\nThe first condition in the conditions list must have an empty \"and_or\", and subsequent conditions must all specify an \"and_or\".", + "operationId": "POST_contactdb-segments", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contactdb_segments" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "conditions": [ + { + "and_or": "", + "field": "last_name", + "operator": "eq", + "value": "Miller" + }, + { + "and_or": "and", + "field": "last_clicked", + "operator": "gt", + "value": "01/02/2015" + }, + { + "and_or": "or", + "field": "clicks.campaign_identifier", + "operator": "eq", + "value": "513" + } + ], + "id": 1, + "list_id": 4, + "name": "Last Name Miller", + "recipient_count": 0 + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_segments_with_id" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "request body is not valid json" + }, + { + "message": "invalid value is passed into one of the request body parameters" + }, + { + "field": "field", + "message": "field and set value is not passed into the request body" + }, + { + "field": "value", + "message": "value and set value is not passed into the request body" + }, + { + "field": "operator", + "message": "operator and set value is not passed into the request body" + }, + { + "field": "and_or", + "message": "and_or is not set on more than one condition and less than all conditions" + }, + { + "field": "and_or", + "message": "and_or is set on all conditions" + }, + { + "field": "and_or", + "message": "and_or is set on the only condition passed" + }, + { + "field": "and_or", + "message": "and_or and set value is not passed into the request body" + }, + { + "field": "list_id", + "message": "the list_id is not valid" + }, + { + "field": "name", + "message": "the name is not valid" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"name\" : \"Returned if the name is not valid\"\n\"list_id\" : \"Returned if the list_id is not valid\"\n\"and_or\" : \"Returned if and_or and set value is not passed into the request body\"\n\"and_or\" : \"Returned if and_or is set on the only condition passed\"\n\"and_or\" : \"Returned if and_or is set on all conditions\"\n\"and_or\" : \"Returned if and_or is not set on more than one condition and less than all conditions\"\n\"operator\" : \"Returned if operator and set value is not passed into the request body\"\n\"value\" : \"Returned if value and set value is not passed into the request body\"\n\"field\" : \"Returned if field and set value is not passed into the request body\"\n\"\" : \"Returned if request body is not valid json\"\n\"\" : \"Returned if invalid value is passed into one of the request body parameters\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Segment", + "tags": [ + "Contacts API - Segments" + ], + "x-stoplight": { + "id": "POST_contactdb-segments", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/contactdb/segments/{segment_id}": { + "delete": { + "description": "**This endpoint allows you to delete a segment from your recipients database.**\n\nYou also have the option to delete all the contacts from your Marketing Campaigns recipient database who were in this segment.", + "operationId": "DELETE_contactdb-segments-segment_id", + "parameters": [ + { + "description": "True to delete all contacts matching the segment in addition to deleting the segment", + "in": "query", + "name": "delete_contacts", + "schema": { + "type": "boolean" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/DELETE_contactdb-lists-list_idBody" + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "segment_id", + "message": "Returned if segment_id is not valid" + }, + { + "field": "delete_contacts", + "message": "Returned if delete_contacts is not a valid boolean" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"segment_id\" : \"Returned if segment_id is not valid\"\n\"delete_contacts\" : \"Returned if delete_contacts is not a valid boolean\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "segment_id", + "message": "segment_id does not exist" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"segment_id\" : \"Returned if segment_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a segment", + "tags": [ + "Contacts API - Segments" + ], + "x-stoplight": { + "id": "DELETE_contactdb-segments-segmentid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 204 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a single segment with the given ID.**", + "operationId": "GET_contactdb-segments-segment_id", + "parameters": [ + { + "description": "The ID of the segment you want to request.", + "in": "query", + "name": "segment_id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "conditions": [ + { + "and_or": "", + "field": "last_name", + "operator": "eq", + "value": "Miller" + } + ], + "id": 1, + "list_id": 4, + "name": "Last Name Miller", + "recipient_count": 1 + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_segments" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "if segment_id is not valid" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"segment_id\" : \"Returned if segment_id is not valid\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "segment_id not found" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "\"segment_id\" : \"Returned if segment_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a segment", + "tags": [ + "Contacts API - Segments" + ], + "x-stoplight": { + "id": "GET_contactdb-segments-segmentid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "segment_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update a segment.**", + "operationId": "PATCH_contactdb-segments-segment_id", + "parameters": [ + { + "description": "The ID of the segment you are updating.", + "in": "query", + "name": "segment_id", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "conditions": [ + { + "and_or": "", + "field": "last_name", + "operator": "eq", + "value": "Miller" + } + ], + "list_id": 5, + "name": "The Millers" + }, + "properties": { + "conditions": { + "description": "The conditions by which this segment should be created.", + "items": { + "$ref": "#/components/schemas/contactdb_segments_conditions" + }, + "type": "array" + }, + "list_id": { + "description": "The list ID you would like this segment to be built from.", + "type": "number" + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "conditions": [ + { + "and_or": "", + "field": "last_name", + "operator": "eq", + "value": "Miller" + } + ], + "id": 5, + "list_id": 5, + "name": "The Millers", + "recipient_count": 1 + } + } + }, + "schema": { + "$ref": "#/components/schemas/contactdb_segments" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "request body is not valid json" + }, + { + "message": "invalid value is passed into one of the request body parameters" + }, + { + "message": "segment id is not valid", + "segment_id": "segment_id" + }, + { + "field": "field", + "message": "field and set value is not passed into the request body" + }, + { + "field": "value", + "message": "value and set value is not passed into the request body" + }, + { + "field": "operator", + "message": "operator and set value is not passed into the request body" + }, + { + "field": "and_or", + "message": "and_or is not set on more than one condition and less than all conditions" + }, + { + "field": "and_or", + "message": "and_or is set on all conditions" + }, + { + "field": "and_or", + "message": "and_or is set on the only condition passed" + }, + { + "field": "and_or", + "message": "and_or and set value is not passed into the request body" + }, + { + "field": "list_id", + "message": "the list_id is not valid" + }, + { + "field": "name", + "message": "the name is not valid" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a segment", + "tags": [ + "Contacts API - Segments" + ], + "x-stoplight": { + "id": "PATCH_contactdb-segments-segmentid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": false + } + } + }, + "/contactdb/segments/{segment_id}/recipients": { + "get": { + "description": "**This endpoint allows you to retrieve all of the recipients in a segment with the given ID.**", + "operationId": "GET_contactdb-segments-segment_id-recipients", + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "page_size", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "recipients": [ + { + "created_at": 1422313607, + "custom_fields": [ + { + "id": 23, + "name": "pet", + "type": "text", + "value": "Indiana" + } + ], + "email": "jones@example.com", + "first_name": null, + "id": "YUBh", + "last_clicked": null, + "last_emailed": null, + "last_name": "Jones", + "last_opened": null, + "updated_at": 1422313790 + } + ] + } + } + }, + "schema": { + "properties": { + "recipients": { + "items": { + "$ref": "#/components/schemas/contactdb_recipient" + }, + "type": "array" + } + }, + "required": [ + "recipients" + ], + "title": "List Recipients On a Segment response", + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "\"page\" : \"Returned if page is not a valid integer\"\n\"page\" : \"Returned if page is less than 1\"\n\"page_size\" : \"Returned if page_size is not a valid integer\"" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "\"segment_id\" : \"Returned if segment_id is not valid\"\n\"segment_id\" : \"Returned if segment_id does not exist\"" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve recipients on a segment", + "tags": [ + "Contacts API - Segments" + ], + "x-stoplight": { + "id": "GET_contactdb-segments-segmentid-recipients", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the segment from which you want to retrieve recipients.", + "in": "path", + "name": "segment_id", + "required": true, + "schema": { + "type": "integer" + } + } + ] + }, + "/contactdb/status": { + "get": { + "description": "**This endpoint allows you to check the upload status of a Marketing Campaigns recipient.**", + "operationId": "GET_contactdb-status", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "status": [ + { + "id": "worker_delay", + "value": "delayed" + }, + { + "id": "worker_delay_seconds", + "value": "75.0" + } + ] + } + } + }, + "schema": { + "properties": { + "status": { + "items": { + "properties": { + "": { + "type": "string" + }, + "id": { + "default": "", + "description": "Valid values are \"worker_delay\" and \"worker_delay_seconds\" (the second value appears only if \"worker_delay\" has a value of \"delayed\").", + "type": "string" + }, + "value": { + "default": "", + "description": "Valid values for the ID \"worker_delay\" are \"OK\" or \"Delayed\". Valid values for the ID \"worker_delay_seconds\" is the time of delay to upload.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Recipient Upload Status", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "id": "GET_contactdb-status", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/designs": { + "get": { + "description": "**This endpoint allows you to retrieve a list of designs already stored in your Design Library**.\n\nA GET request to `/designs` will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the `/designs/pre-builts` endpoint, which is detailed below.\n\nBy default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter.", + "operationId": "LIST-designs", + "parameters": [ + { + "$ref": "#/components/parameters/trait_designsQueryStrings_page_size" + }, + { + "$ref": "#/components/parameters/trait_designsQueryStrings_page_token" + }, + { + "$ref": "#/components/parameters/trait_designsQueryStrings_summary" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "count": 3, + "self": "https://api.sendgrid.com/v3/designs?page_token=vHdvHCg0w1F-TmWJcPNpTEnFY2aPEmRBHONwOgZ6TgJbX2_I" + }, + "result": [ + { + "categories": [ + "welcome", + "new customer" + ], + "created_at": "2021-04-09T17:29:46Z", + "editor": "code", + "generate_plain_content": true, + "id": "3247eaea-c912-42a3-b0bc-60bdaf210396", + "name": "Welcome Email", + "subject": "Welcom to the Cake or Pie Cafe", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/llny8o5b3m636z92p7hbjnmq1jvpka39p370jwtin2s1wxv7x1sgm0y5fk518d0s.png", + "updated_at": "2021-04-09T17:29:55Z" + }, + { + "categories": [ + "promo", + "coupon" + ], + "created_at": "2021-04-09T17:29:21Z", + "editor": "design", + "generate_plain_content": true, + "id": "02dfd792-f31f-439a-a79e-5c47fbcfdbac", + "name": "Monthly Promo", + "subject": "Free Dozen Cupcakes", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/hfyxahd7ues2ajuoeoqq2xe6ibdasl1q89ox0y9ncya2ftpoicssmtf9ddus4c39.png", + "updated_at": "2021-04-09T17:29:42Z" + }, + { + "categories": [], + "created_at": "2020-10-09T17:33:46Z", + "editor": "design", + "generate_plain_content": true, + "id": "e54be823-19ef-4c6f-8b60-efd7514f492d", + "name": "Duplicate: Ingrid & Anders", + "subject": "Welcome to Ingrid & Anders!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/12kni9gjpyb9uxmwr9vk7unycjr70u95zoyhe9sg2zounul2zg7dih1s20k13q2z.png", + "updated_at": "2021-04-07T19:57:52Z" + } + ] + } + } + }, + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + }, + "result": { + "items": { + "$ref": "#/components/schemas/design-output-summary" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "List Designs", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "LIST-designs", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new design**.\n\nYou can add a new design by passing data, including a string of HTML email content, to `/designs`. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to [Cross-Platform Email Design](https://sendgrid.com/docs/ui/sending-email/cross-platform-html-design/).\n\nThe Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the [Design and Code Editor documentation](https://sendgrid.com/docs/ui/sending-email/editor/#drag--drop-markup).\n\nBecause the `/designs` endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI.", + "operationId": "POST-design", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/design-input" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [], + "created_at": "2021-04-30T18:51:20Z", + "editor": "design", + "generate_plain_content": false, + "html_content": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n
\n \n \n \n
\n

\n
\n \n \n \n \n \n
Ahoy, World!

{{Sender_Name}}

{{Sender_Address}}, {{Sender_City}}, {{Sender_State}} {{Sender_Zip}}

Unsubscribe - Unsubscribe Preferences

\n \n
\n
\n
\n
\n
\n \n ", + "id": "3247eaea-c912-42a3-b0bc-60bdaf210396", + "name": "Ahoy, World!", + "plain_content": "Ahoy, World!\n\n{{Sender_Name}}\n\n{{Sender_Address}} , {{Sender_City}} , {{Sender_State}} {{Sender_Zip}}\n\nUnsubscribe ( {{{unsubscribe}}} ) - Unsubscribe Preferences ( {{{unsubscribe_preferences}}} )", + "subject": "Getting Started", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/kjlrmded0qnrscv8zqr39npoimrpdwgiax59q8iq6ovj7yoks2fzxoxpfjpwph6o.png", + "updated_at": "2021-04-30T18:51:20Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/design-output" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create Design", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "POST-design", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/designs/pre-builts": { + "get": { + "description": "**This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid**.\n\nUnlike the `/designs` endpoint where *your* designs are stored, a GET request made to `designs/pre-builts` will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library.\n\nBy default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter.\n\nThis endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify.", + "operationId": "LIST-Sendgrid-Pre-built-designs", + "parameters": [ + { + "$ref": "#/components/parameters/trait_designsQueryStrings_page_size" + }, + { + "$ref": "#/components/parameters/trait_designsQueryStrings_page_token" + }, + { + "$ref": "#/components/parameters/trait_designsQueryStrings_summary" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "count": 6, + "self": "https://api.sendgrid.com/v3/designs/pre-builts?page_token=yYzyCxj-iIVgP54t6NjKkunDCKYLLpngo-5vAsfYXz0To34U" + }, + "result": [ + { + "categories": [], + "created_at": "2019-09-10T02:11:34Z", + "editor": "design", + "generate_plain_content": true, + "id": "6ad69134-7165-48cb-964a-6c3cf03e8af8", + "name": "Off Grid Adventures", + "subject": "Welcome to the family!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/a85b4b202ff28094828f11ff472360caecf67ead2d186b69b45c904b9251aa0b.png", + "updated_at": "2021-01-11T21:47:52Z" + }, + { + "categories": [], + "created_at": "2019-09-10T02:12:32Z", + "editor": "design", + "generate_plain_content": true, + "id": "b0a9c6f7-a9a1-4b52-b0c5-16fc6f4cdb2b", + "name": "Song Riddle", + "subject": "Welcome to Song Riddle!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/4ef3a39249f3accb8461b03950c071454a745a232508feca89a626b3e7f578d3.png", + "updated_at": "2021-01-11T21:46:43Z" + }, + { + "categories": [], + "created_at": "2019-09-10T02:10:38Z", + "editor": "design", + "generate_plain_content": true, + "id": "f8d8da76-bcca-4cfe-b809-733887855f57", + "name": "Ingrid & Anders 1", + "subject": "Welcome to Ingrid & Anders!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/15c97ffa97ee31693581a67526728d096eef00adfbaa34bb030d91034d477da4.png", + "updated_at": "2021-01-11T21:45:05Z" + }, + { + "categories": [], + "created_at": "2019-09-10T02:09:31Z", + "editor": "design", + "generate_plain_content": true, + "id": "2935a7d0-7f02-4e0f-a570-dc302ce09749", + "name": "Ingrid & Anders 2", + "subject": "Check out these exclusive deals!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/7b36a6c0955cab0c350d105114ad248700a685bd11032592cdef85ae26540afc.png", + "updated_at": "2021-01-11T21:44:08Z" + }, + { + "categories": [], + "created_at": "2019-09-10T02:08:29Z", + "editor": "design", + "generate_plain_content": true, + "id": "7826ef14-7ba6-4dbc-91f0-a8c610ebe962", + "name": "Ingrid & Anders 3", + "subject": "Join our VIP club and save big!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/6dd8dd73a1a62bd7a76c4313b52d7c749250d49e31b19cce718906655fcbc675.png", + "updated_at": "2021-01-11T21:41:35Z" + }, + { + "categories": [], + "created_at": "2019-09-10T02:03:06Z", + "editor": "design", + "generate_plain_content": true, + "id": "41da47e7-d3e2-491b-a83f-f499a4139d6a", + "name": "Mercado", + "subject": "Subject", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/9cc87cc7671719712d9d363184995d0ec05103355db300ff03641fe9e205651d.png", + "updated_at": "2021-01-11T21:39:23Z" + } + ] + } + } + }, + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + }, + "result": { + "items": { + "$ref": "#/components/schemas/design-output-summary" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "List SendGrid Pre-built Designs", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "LIST-Sendgrid-Pre-built-designs", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/designs/pre-builts/{id}": { + "get": { + "description": "**This endpoint allows you to retrieve a single pre-built design**.\n\nA GET request to `/designs/pre-builts/{id}` will retrieve details about a specific pre-built design.\n\nThis endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify.", + "operationId": "GET-sendgrid-pre-built-design", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [], + "created_at": "2019-09-10T02:11:34Z", + "editor": "design", + "generate_plain_content": true, + "html_content": "\n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n
\n \n \n \n
\n

You've found the secret!

\n
\n \n \n \n
\"Off
\n \n \n \n
\"\"
\n \n \n \n
Welcome to the family!
\n \n \n \n
You've found a community of travelers that are just like you.
\n
 
\n
We don't want to be stuck in tourist traps that isolate us from vibrant, local experiences. We want to discover the hidden gems and less-traveled roads of our next destination.
\n
 
\n
Ready for your next authentic travel experience?
Browse Gallery
\n \n \n \n
\"\"
\n \n \n \n
\n
\n \n \n \n
\n \n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n \n \n
\n \n \n
\n \n \"Facebook\"\n \n \n \n \"Twitter\"\n \n \n \n \"Instagram\"\n \n \n \n \"Pinterest\"\n \n
\n

{{Sender_Name}}

{{Sender_Address}}, {{Sender_City}}, {{Sender_State}} {{Sender_Zip}}

Unsubscribe - Unsubscribe Preferences

\n \n
\n
\n
\n
\n
\n \n ", + "id": "6ad69134-7165-48cb-964a-6c3cf03e8af8", + "name": "Off Grid Adventures", + "plain_content": "You've found the secret!\n\nWelcome to the family!\n\nYou've found a community of travelers that are just like you.\n\nWe don't want to be stuck in tourist traps that isolate us from vibrant, local experiences. We want to discover the hidden gems and less-traveled roads of our next destination.\n\nReady for your next authentic travel experience?\n\nBrowse Gallery\n\n( https://www.facebook.com/sendgrid/ ) ( https://twitter.com/sendgrid?ref_src=twsrc%5egoogle%7ctwcamp%5eserp%7ctwgr%5eauthor ) ( https://www.instagram.com/sendgrid/?hl=en ) ( https://www.pinterest.com/sendgrid/ )\n\n{{Sender_Name}}\n\n{{Sender_Address}} , {{Sender_City}} , {{Sender_State}} {{Sender_Zip}}\n\nUnsubscribe ( {{{unsubscribe}}} ) - Unsubscribe Preferences ( {{{unsubscribe_preferences}}} )", + "subject": "Welcome to the family!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/a85b4b202ff28094828f11ff472360caecf67ead2d186b69b45c904b9251aa0b.png", + "updated_at": "2021-01-11T21:47:52Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/design-output" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get SendGrid Pre-built Design", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "GET-sendgrid-pre-built-design", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the pre-built Design you want to duplicate.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs**.\n\nLike duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the \"List SendGrid Pre-built Designs\" endpoint.\n\nYou can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request.\nMore on retrieving design IDs can be found above.", + "operationId": "POST-sendgrid-pre-built-design", + "requestBody": { + "$ref": "#/components/requestBodies/design-duplicate-input" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [], + "created_at": "2021-04-30T19:15:28Z", + "editor": "design", + "generate_plain_content": true, + "html_content": "\n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n
\n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n
\n \n \n \n
\n

You've found the secret!

\n
\n \n \n \n
\"Off
\n \n \n \n
\"\"
\n \n \n \n
Welcome to the family!
\n \n \n \n
You've found a community of travelers that are just like you.
\n
 
\n
We don't want to be stuck in tourist traps that isolate us from vibrant, local experiences. We want to discover the hidden gems and less-traveled roads of our next destination.
\n
 
\n
Ready for your next authentic travel experience?
Browse Gallery
\n \n \n \n
\"\"
\n \n \n \n
\n
\n \n \n \n
\n \n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n \n \n
\n \n \n
\n \n \"Facebook\"\n \n \n \n \"Twitter\"\n \n \n \n \"Instagram\"\n \n \n \n \"Pinterest\"\n \n
\n

{{Sender_Name}}

{{Sender_Address}}, {{Sender_City}}, {{Sender_State}} {{Sender_Zip}}

Unsubscribe - Unsubscribe Preferences

\n \n
\n
\n
\n
\n
\n \n ", + "id": "abe0877f-a224-21e2-b62e-c789d326cda5", + "name": "Ahoy, Pre-built Design!", + "plain_content": "You've found the secret!\n\nWelcome to the family!\n\nYou've found a community of travelers that are just like you.\n\nWe don't want to be stuck in tourist traps that isolate us from vibrant, local experiences. We want to discover the hidden gems and less-traveled roads of our next destination.\n\nReady for your next authentic travel experience?\n\nBrowse Gallery\n\n( https://www.facebook.com/sendgrid/ ) ( https://twitter.com/sendgrid?ref_src=twsrc%5egoogle%7ctwcamp%5eserp%7ctwgr%5eauthor ) ( https://www.instagram.com/sendgrid/?hl=en ) ( https://www.pinterest.com/sendgrid/ )\n\n{{Sender_Name}}\n\n{{Sender_Address}} , {{Sender_City}} , {{Sender_State}} {{Sender_Zip}}\n\nUnsubscribe ( {{{unsubscribe}}} ) - Unsubscribe Preferences ( {{{unsubscribe_preferences}}} )", + "subject": "Welcome to the family!", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/a85b4b202ff28094828f11ff472360caecf67ead2d186b69b45c904b9251aa0b.png", + "updated_at": "2021-04-30T19:15:28Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/design-output" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Duplicate SendGrid Pre-built Design", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "POST-sendgrid-pre-built-design", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/designs/{id}": { + "delete": { + "description": "**This endpoint allows you to delete a single design**.\n\nBe sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action.", + "operationId": "DELETE-design", + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Design", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "DELETE-design", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a single design**.\n\nA GET request to `/designs/{id}` will retrieve details about a specific design in your Design Library.\n\nThis endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request.", + "operationId": "GET-design", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [], + "created_at": "2021-04-30T18:51:20Z", + "editor": "design", + "generate_plain_content": false, + "html_content": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n
\n \n \n \n
\n

\n
\n \n \n \n \n \n
Ahoy, World!

{{Sender_Name}}

{{Sender_Address}}, {{Sender_City}}, {{Sender_State}} {{Sender_Zip}}

Unsubscribe - Unsubscribe Preferences

\n \n
\n
\n
\n
\n
\n \n ", + "id": "15b85720-ce48-48ef-8a07-672b0d3455da", + "name": "Ahoy, World!", + "plain_content": "Ahoy, World!\n\n{{Sender_Name}}\n\n{{Sender_Address}} , {{Sender_City}} , {{Sender_State}} {{Sender_Zip}}\n\nUnsubscribe ( {{{unsubscribe}}} ) - Unsubscribe Preferences ( {{{unsubscribe_preferences}}} )", + "subject": "Getting Started", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/5yysvuyi1lpdnxo1ym8ax8yd7ompve3azjtme76gamdace01vko3eyn1kzso1lhy.png", + "updated_at": "2021-04-30T18:51:20Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/design-output" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Design", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "GET-design", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the Design you want to duplicate.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to edit a design**.\n\nThe Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered.\n\nFor example, updating a design's name requires that you make a PATCH request to this endpoint with data specified for the `name` field only.\n\n```\n{\n \"name\": \"\"\n}\n```", + "operationId": "PUT-design", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "categories": [ + "promotions" + ], + "generate_plain_content": false, + "html_content": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n
\n \n \n \n
\n

\n
\n \n \n \n \n \n
Ahoy, World!

{{Sender_Name}}

{{Sender_Address}}, {{Sender_City}}, {{Sender_State}} {{Sender_Zip}}

Unsubscribe - Unsubscribe Preferences

\n \n
\n
\n
\n
\n
\n \n ", + "name": "Ahoy, World!", + "subject": "Getting Started" + }, + "properties": { + "categories": { + "description": "The list of categories applied to the design", + "items": { + "maxLength": 255, + "type": "string" + }, + "maxItems": 10, + "type": "array", + "uniqueItems": true + }, + "generate_plain_content": { + "default": true, + "description": "If true, plain_content is always generated from html_content. If false, plain_content is not altered.", + "type": "boolean" + }, + "html_content": { + "description": "The HTML content of the Design.", + "maxLength": 1048576, + "type": "string" + }, + "name": { + "default": "My Design", + "description": "Name of the Design.", + "maxLength": 100, + "type": "string" + }, + "plain_content": { + "default": "", + "description": "Plain text content of the Design.", + "maxLength": 1048576, + "type": "string" + }, + "subject": { + "description": "Subject of the Design.", + "maxLength": 5000, + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [ + "promotions" + ], + "created_at": "2021-04-30T18:51:20Z", + "editor": "design", + "generate_plain_content": false, + "html_content": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n
\n \n \n \n
\n

\n
\n \n \n \n \n \n
Ahoy, World!

{{Sender_Name}}

{{Sender_Address}}, {{Sender_City}}, {{Sender_State}} {{Sender_Zip}}

Unsubscribe - Unsubscribe Preferences

\n \n
\n
\n
\n
\n
\n \n ", + "id": "15b85720-ce48-48ef-8a07-672b0d3455da", + "name": "Ahoy, World!", + "subject": "Getting Started", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/5yysvuyi1lpdnxo1ym8ax8yd7ompve3azjtme76gamdace01vko3eyn1kzso1lhy.png", + "updated_at": "2021-04-30T18:51:20Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/design-output" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Design", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "PUT-design", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to duplicate one of your existing designs**.\n\nModifying an existing design is often the easiest way to create something new.\n\nYou are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs.\n\nYou can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request.\nMore on retrieving design IDs can be found below.", + "operationId": "POST-design-dup", + "requestBody": { + "$ref": "#/components/requestBodies/design-duplicate-input" + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [], + "created_at": "2021-04-30T19:00:16Z", + "editor": "design", + "generate_plain_content": false, + "html_content": "\n\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n
\n \n \n \n
\n

\n
\n \n \n \n \n \n
Ahoy, World!

{{Sender_Name}}

{{Sender_Address}}, {{Sender_City}}, {{Sender_State}} {{Sender_Zip}}

Unsubscribe - Unsubscribe Preferences

\n \n
\n
\n
\n
\n
\n \n ", + "id": "15b85720-ce48-48ef-8a07-672b0d3455da", + "name": "Ahoy, Cake or Pie Cafe!", + "plain_content": "Ahoy, World!\n\n{{Sender_Name}}\n\n{{Sender_Address}} , {{Sender_City}} , {{Sender_State}} {{Sender_Zip}}\n\nUnsubscribe ( {{{unsubscribe}}} ) - Unsubscribe Preferences ( {{{unsubscribe_preferences}}} )", + "subject": "Getting Started", + "thumbnail_url": "//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/79bb769ae6464960a307040120ad6f9921896fe9825e845ad1f24d12285ea068.png", + "updated_at": "2021-04-30T19:00:16Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/design-output" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-error" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/api-errors" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Duplicate Design", + "tags": [ + "Designs API" + ], + "x-stoplight": { + "id": "POST-design", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/devices/stats": { + "get": { + "description": "**This endpoint allows you to retrieve your email statistics segmented by the device type.**\n\n**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.\n\n## Available Device Types\n| **Device** | **Description** | **Example** |\n|---|---|---|\n| Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. |\n| Webmail |\tA web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. |\n| Phone | A smart phone. | iPhone, Android, Blackberry, etc.\n| Tablet | A tablet computer. | iPad, android based tablet, etc. |\n| Other | An unrecognized device. |\n\nAdvanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/).", + "operationId": "GET_devices-stats", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_limit" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_offset" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_aggregated_by" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_start_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_end_date" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2015-10-11", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-12", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-13", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-14", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-15", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-16", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-17", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-18", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-19", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-20", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-21", + "stats": [ + { + "metrics": { + "opens": 1, + "unique_opens": 1 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-22", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-23", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-24", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-25", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-26", + "stats": [ + { + "metrics": { + "opens": 2, + "unique_opens": 2 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-27", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-28", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-29", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-30", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-10-31", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-01", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-02", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-03", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-04", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-05", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-06", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-07", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-08", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-09", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + }, + { + "date": "2015-11-10", + "stats": [ + { + "metrics": { + "opens": 0, + "unique_opens": 0 + }, + "name": "Webmail", + "type": "device" + } + ] + } + ] + } + }, + "schema": { + "items": { + "properties": { + "date": { + "description": "The date that the statistics were gathered.", + "type": "string" + }, + "stats": { + "description": "The list of statistics.", + "items": { + "properties": { + "metrics": { + "$ref": "#/components/schemas/advanced_stats_opens" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by device type.", + "tags": [ + "Stats" + ], + "x-stoplight": { + "id": "GET_devices-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/geo/stats": { + "get": { + "description": "**This endpoint allows you to retrieve your email statistics segmented by country and state/province.**\n\n**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.\n\nAdvanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).", + "operationId": "GET_geo-stats", + "parameters": [ + { + "description": "The country you would like to see statistics for. Currently only supported for US and CA.", + "in": "query", + "name": "country", + "schema": { + "enum": [ + "US", + "CA" + ], + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_limit" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_offset" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_aggregated_by" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_start_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_end_date" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2015-10-11", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-12", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-13", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-14", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-15", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-16", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-17", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-18", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-19", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-20", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-21", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 1, + "unique_clicks": 0, + "unique_opens": 1 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-22", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-23", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-24", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-25", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-26", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-27", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-28", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-29", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-30", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-10-31", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-01", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-02", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-03", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-04", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-05", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-06", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-07", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-08", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-09", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + }, + { + "date": "2015-11-10", + "stats": [ + { + "metrics": { + "clicks": 0, + "opens": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "TX", + "type": "province" + } + ] + } + ] + } + }, + "schema": { + "items": { + "properties": { + "date": { + "description": "The date that the statistics were gathered.", + "type": "string" + }, + "stats": { + "description": "The list of statistics.", + "items": { + "properties": { + "metrics": { + "$ref": "#/components/schemas/advanced_stats_clicks_opens" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by country and state/province.", + "tags": [ + "Stats" + ], + "x-stoplight": { + "id": "GET_geo-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all assigned and unassigned IPs.**\n\nResponse includes warm up status, pools, assigned subusers, and reverse DNS info. The start_date field corresponds to when warmup started for that IP.\n\nA single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it.", + "operationId": "GET_ips", + "parameters": [ + { + "description": "The IP address to get", + "in": "query", + "name": "ip", + "schema": { + "type": "string" + } + }, + { + "description": "Should we exclude reverse DNS records (whitelabels)?", + "in": "query", + "name": "exclude_whitelabels", + "schema": { + "type": "boolean" + } + }, + { + "description": "The number of IPs you want returned at the same time.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "type": "integer" + } + }, + { + "description": "The offset for the number of IPs that you are requesting.", + "in": "query", + "name": "offset", + "schema": { + "default": 0, + "type": "integer" + } + }, + { + "description": "The subuser you are requesting for.", + "in": "query", + "name": "subuser", + "schema": { + "type": "string" + } + }, + { + "description": "The direction to sort the results.", + "in": "query", + "name": "sort_by_direction", + "schema": { + "enum": [ + "desc", + "asc" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "assigned_at": 1482883200, + "ip": "192.168.1.1", + "pools": [ + "pool1", + "pool2" + ], + "start_date": 1409616000, + "subusers": [ + "tim@sendgrid.net" + ], + "warmup": false, + "whitelabeled": false + }, + { + "assigned_at": 1482883200, + "ip": "208.115.214.22", + "pools": [], + "rdns": "o1.email.burgermail.com", + "start_date": 1409616000, + "subusers": [], + "warmup": false, + "whitelabeled": true + } + ] + } + }, + "schema": { + "items": { + "properties": { + "assigned_at": { + "description": "The date that the IP address was assigned to the user.", + "nullable": true, + "type": "integer" + }, + "ip": { + "description": "An IP address.", + "type": "string" + }, + "pools": { + "description": "The IP pools that this IP has been added to.", + "items": { + "type": "string" + }, + "type": "array" + }, + "rdns": { + "description": "The reverse DNS record for this IP address.", + "type": "string" + }, + "start_date": { + "description": "The date that the IP address was entered into warmup.", + "nullable": true, + "type": "number" + }, + "subusers": { + "description": "The subusers that are able to send email from this IP.", + "items": { + "type": "string" + }, + "type": "array" + }, + "warmup": { + "description": "Indicates if this IP address is currently warming up.", + "type": "boolean" + }, + "whitelabeled": { + "description": "Indicates if this IP address is associated with a reverse DNS record.", + "type": "boolean" + } + }, + "required": [ + "ip", + "subusers", + "pools", + "warmup", + "start_date", + "whitelabeled", + "assigned_at" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IP addresses", + "tags": [ + "IP Addresses" + ], + "x-stoplight": { + "id": "GET_ips", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "**This endpoint is for adding a(n) IP Address(es) to your account.**", + "operationId": "POST_ips", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "count": 90323478, + "subusers": [ + "subuser1", + "subuser2" + ], + "user_can_send": true, + "warmup": true + }, + "properties": { + "count": { + "description": "The amount of IPs to add to the account.", + "type": "integer" + }, + "subusers": { + "description": "Array of usernames to be assigned a send IP.", + "items": { + "type": "string" + }, + "type": "array" + }, + "warmup": { + "default": false, + "description": "Whether or not to warmup the IPs being added.", + "type": "boolean" + } + }, + "required": [ + "count" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "ips": [ + { + "ip": "1.2.3.4", + "subusers": [ + "user", + "subuser1" + ] + }, + { + "ip": "1.2.3.5", + "subusers": [ + "user", + "subuser1" + ] + } + ], + "remaining_ips": 1, + "warmup": true + } + } + }, + "schema": { + "properties": { + "ips": { + "description": "List of IP objects.", + "items": { + "properties": { + "ip": { + "description": "IP added to account.", + "type": "string" + }, + "subusers": { + "description": "Array of usernames assigned a send IP.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "ip", + "subusers" + ], + "type": "object" + }, + "type": "array" + }, + "remaining_ips": { + "description": "The number of IPs that can still be added to the user.", + "type": "integer" + }, + "warmup": { + "description": "Whether or not the IPs are being warmed up.", + "type": "boolean" + } + }, + "required": [ + "ips", + "remaining_ips", + "warmup" + ], + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "one or more subusers do not belong to this user" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add IPs", + "tags": [ + "IP Addresses" + ], + "x-stoplight": { + "id": "POST_ips", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/assigned": { + "get": { + "description": "**This endpoint allows you to retrieve only assigned IP addresses.**\n\nA single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it.", + "operationId": "GET_ips-assigned", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "ip": "167.89.21.3", + "pools": [ + "new_test5" + ], + "start_date": 1409616000, + "warmup": true + } + ] + } + }, + "schema": { + "items": { + "properties": { + "ip": { + "description": "The IP address.", + "type": "string" + }, + "pools": { + "description": "The IP pools that this IP address has been added to.", + "items": { + "type": "string" + }, + "type": "array" + }, + "start_date": { + "description": "The start date that this IP address was entered into warmup.", + "type": "integer" + }, + "warmup": { + "description": "Indicates if this IP address is currently warming up.", + "type": "boolean" + } + }, + "required": [ + "ip", + "pools", + "warmup", + "start_date" + ], + "type": "object" + }, + "title": "List all assigned IPs response", + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all assigned IPs", + "tags": [ + "IP Addresses" + ], + "x-stoplight": { + "id": "GET_ips-assigned", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/ips/pools": { + "get": { + "description": "**This endpoint allows you to get all of your IP pools.**", + "operationId": "GET_ips-pools", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "name": "marketing" + }, + { + "name": "transactional" + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/ip_pool_response" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IP pools", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "id": "GET_ips-pools", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create an IP pool.**\n\nBefore you can create an IP pool, you need to activate the IP in your SendGrid account: \n\n1. Log into your SendGrid account. \n1. Navigate to **Settings** and then select **IP Addresses**. \n1. Find the IP address you want to activate and then click **Edit**. \n1. Check **Allow my account to send mail using this IP address**.\n1. Click **Save**.", + "operationId": "POST_ips-pools", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "marketing" + }, + "properties": { + "name": { + "description": "The name of your new IP pool.", + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "name": "marketing" + } + } + }, + "schema": { + "$ref": "#/components/schemas/ip_pool_response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create an IP pool", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "id": "POST_ips-pools", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/pools/{pool_name}": { + "delete": { + "description": "**This endpoint allows you to delete an IP pool.**", + "operationId": "DELETE_ips-pools-pool_name", + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "error": "Unable to locate specified IPs Pool" + } + } + }, + "schema": { + "properties": { + "error": { + "description": "An error explaining why the pool could not be deleted.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete an IP pool", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "id": "DELETE_ips-pools-poolname", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to get all of the IP addresses that are in a specific IP pool.**", + "operationId": "GET_ips-pools-pool_name", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "ips": [ + "192.168.1.1", + "192.158.1.2", + "192.138.2.1" + ], + "pool_name": "Sample" + } + } + }, + "schema": { + "properties": { + "ips": { + "description": "The IP addresses that belong to this pool.", + "items": { + "type": "string" + }, + "type": "array" + }, + "pool_name": { + "description": "The name of the IP pool.", + "maxLength": 64, + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "error", + "message": "Unable to locate specified IPs Pool" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "description": "The name of the error.", + "type": "string" + }, + "message": { + "description": "A message explaining why the IP addresses could not be listed.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all the IPs in a specified pool", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "id": "GET_ips-pools-poolname", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The name of the IP pool that you want to retrieve the IP addresses for.", + "in": "path", + "name": "pool_name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "put": { + "description": "**This endpoint allows you to update the name of an IP pool.**", + "operationId": "PUT_ips-pools-pool_name", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "new_pool_name" + }, + "properties": { + "name": { + "description": "The new name for your IP pool.", + "maxLength": 64, + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "name": "new_pool_name" + } + } + }, + "schema": { + "$ref": "#/components/schemas/ip_pool_response" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "ip pool not found" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "description": "A message explaining why the name of your IP pool could not be updated.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Rename an IP pool", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "id": "PUT_ips-pools-poolname", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/pools/{pool_name}/ips": { + "parameters": [ + { + "description": "The name of the IP pool you want to add the address to. If the name contains spaces, they must be URL encoded (e.g., \"Test Pool\" becomes \"Test%20Pool\").", + "in": "path", + "name": "pool_name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to add an IP address to an IP pool.**\n\nYou can add the same IP address to multiple pools. It may take up to 60 seconds for your IP address to be added to a pool after your request is made.\n\nBefore you can add an IP to a pool, you need to activate it in your SendGrid account:\n\n1. Log into your SendGrid account. \n1. Navigate to **Settings** and then select **IP Addresses**. \n1. Find the IP address you want to activate and then click **Edit**. \n1. Check **Allow my account to send mail using this IP address**.\n1. Click **Save**.\n\nYou can retrieve all of your available IP addresses from the \"Retrieve all IP addresses\" endpoint.", + "operationId": "POST_ips-pools-pool_name-ips", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "ip": "0.0.0.0" + }, + "properties": { + "ip": { + "description": "The IP address that you want to add to the named pool.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "ip": "000.00.00.0", + "pools": [ + "test1" + ], + "start_date": 1409616000, + "warmup": true + } + } + }, + "schema": { + "properties": { + "ip": { + "description": "The IP address.", + "type": "string" + }, + "pools": { + "description": "The IP pools that this IP address has been added to.", + "items": { + "type": "string" + }, + "type": "array" + }, + "start_date": { + "description": "A Unix timestamp indicating when the warmup process began for the added IP address.", + "type": "integer" + }, + "warmup": { + "description": "Indicates if the IP address is in warmup.", + "type": "boolean" + } + }, + "required": [ + "ip", + "pools", + "start_date", + "warmup" + ], + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "resource not found" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "description": "The error returned.", + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "description": "A message explaining why the IP address could not be added to the IP Pool.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add an IP address to a pool", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "id": "POST_ips-pools-poolname-ips", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/pools/{pool_name}/ips/{ip}": { + "delete": { + "description": "**This endpoint allows you to remove an IP address from an IP pool.**", + "operationId": "DELETE_ips-pools-pool_name-ips-ip", + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "error": "Unable to locate specified IPs Pool" + } + } + }, + "schema": { + "properties": { + "error": { + "description": "An error explaining why the IP address could not be removed from the IP pool.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove an IP address from a pool", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "id": "DELETE_ips-pools-poolname-ips-ip", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The name of the IP pool that you are removing the IP address from.", + "in": "path", + "name": "pool_name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The IP address that you wish to remove.", + "in": "path", + "name": "ip", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/ips/remaining": { + "get": { + "description": "**This endpoint gets amount of IP Addresses that can still be created during a given period and the price of those IPs.**", + "operationId": "GET_ips-remaining", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "results": [ + { + "period": "month", + "price_per_ip": 20, + "remaining": 2 + } + ] + } + } + }, + "schema": { + "properties": { + "results": { + "items": { + "properties": { + "period": { + "description": "The length of time until user can add more IPs.", + "type": "string" + }, + "price_per_ip": { + "description": "The current cost to add an IP.", + "type": "number" + }, + "remaining": { + "description": "The number of IPs that can still be added to the user.", + "type": "integer" + } + }, + "required": [ + "remaining", + "period", + "price_per_ip" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "results" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get remaining IPs count", + "tags": [ + "IP Addresses" + ], + "x-stoplight": { + "id": "GET_ips-remaining", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/warmup": { + "get": { + "description": "**This endpoint allows you to retrieve all of your IP addresses that are currently warming up.**", + "operationId": "GET_ips-warmup", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "ip": "0.0.0.0", + "start_date": 1409616000 + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/ip_warmup_response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IPs currently in warmup", + "tags": [ + "IP Warmup" + ], + "x-stoplight": { + "id": "GET_ips-warmup", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to put an IP address into warmup mode.**", + "operationId": "POST_ips-warmup", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "ip": "0.0.0.0" + }, + "properties": { + "ip": { + "description": "The IP address that you want to begin warming up.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "ip": "0.0.0.0", + "start_date": 1409616000 + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/ip_warmup_response" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "resource not found" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "description": "The errors that were encountered.", + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "description": "A message explaining why the IP couldn't entered into warmup mode.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Start warming up an IP address", + "tags": [ + "IP Warmup" + ], + "x-stoplight": { + "id": "POST_ips-warmup", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/warmup/{ip_address}": { + "delete": { + "description": "**This endpoint allows you to remove an IP address from warmup mode.**\n\nYour request will return a 204 status code if the specified IP was successfully removed from warmup mode. To retrieve details of the IP’s warmup status *before* removing it from warmup mode, call the \"Retrieve the warmpup status for a specific IP address\" endpoint.", + "operationId": "DELETE_ips-warmup-ip_address", + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "resource not found" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "description": "The errors that were encountered.", + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "description": "A message explaining why the IP couldn't be removed from warmup.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Stop warming up an IP address", + "tags": [ + "IP Warmup" + ], + "x-stoplight": { + "id": "DELETE_ips-warmup-ipaddress", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve the warmup status for a specific IP address.**\n\nYou can retrieve all of your warming IPs using the \"Retrieve all IPs currently in warmup\" endpoint.", + "operationId": "GET_ips-warmup-ip_address", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "ip": "0.0.0.0", + "start_date": 1409616000 + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/ip_warmup_response" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "resource not found" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "description": "The errors that were encountered.", + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "description": "A message explaining why the warmup status could not be retrieved.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the warmup status for a specific IP address", + "tags": [ + "IP Warmup" + ], + "x-stoplight": { + "id": "GET_ips-warmup-ipaddress", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The IP address that you want to retrieve the warmup status for.", + "in": "path", + "name": "ip_address", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/ips/{ip_address}": { + "get": { + "description": "**This endpoint allows you to see which IP pools a particular IP address has been added to.**\n\nThe same IP address can be added to multiple IP pools.\n\nA single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it.", + "operationId": "GET_ips-ip_address", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "ip": "000.00.00.0", + "pools": [ + "test1" + ], + "rdns": "o1.em.example.com", + "start_date": null, + "subusers": [ + "subuser1", + "subuser2" + ], + "warmup": false, + "whitelabeled": true + } + } + }, + "schema": { + "properties": { + "ip": { + "description": "The IP address.", + "type": "string" + }, + "pools": { + "description": "The list of IP pools that this IP address belongs to.", + "items": { + "type": "string" + }, + "type": "array" + }, + "rdns": { + "description": "The reverse DNS record for this IP address.", + "type": "string" + }, + "start_date": { + "description": "The date that the IP address was entered into warmup.", + "nullable": true, + "type": "integer" + }, + "subusers": { + "description": "The subusers that can send email using this IP address.", + "items": { + "type": "string" + }, + "type": "array" + }, + "warmup": { + "description": "Indicates if this IP address is currently warming up.", + "type": "boolean" + }, + "whitelabeled": { + "description": "Indicates if this IP address is associated with a reverse DNS record.", + "type": "boolean" + } + }, + "required": [ + "ip", + "subusers", + "rdns", + "pools", + "warmup", + "start_date", + "whitelabeled" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IP pools an IP address belongs to", + "tags": [ + "IP Addresses" + ], + "x-stoplight": { + "id": "GET_ips-ipaddress", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The IP address you are retrieving the IP pools for.", + "in": "path", + "name": "ip_address", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/mail/batch": { + "post": { + "description": "**This endpoint allows you to generate a new batch ID.**\n\nOnce a `batch_id` is created, you can associate it with a scheduled send using the `/mail/send` endpoint. Passing the `batch_id` as a field in the `/mail/send` request body will assign the ID to the send you are creating.\n\nOnce an ID is associated with a scheduled send, the send can be accessed and its send status can be modified using the `batch_id`.", + "operationId": "POST_mail-batch", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi" + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_batch_id" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_cancelScheduledSendsErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a batch ID", + "tags": [ + "Cancel Scheduled Sends" + ], + "x-stoplight": { + "id": "POST_mail-batch", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail/batch/{batch_id}": { + "get": { + "description": "**This endpoint allows you to validate a batch ID.**\n\nWhen you pass a valid `batch_id` to this endpoint, it will return a `200` status code and the batch ID itself.\n\nIf you pass an invalid `batch_id` to the endpoint, you will receive a `400` level status code and an error message.\n\nA `batch_id` does not need to be assigned to a scheduled send to be considered valid. A successful response means only that the `batch_id` has been created, but it does not indicate that it has been associated with a send.", + "operationId": "GET_mail-batch-batch_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi" + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_batch_id" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_cancelScheduledSendsErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate batch ID", + "tags": [ + "Cancel Scheduled Sends" + ], + "x-stoplight": { + "id": "GET_mail-batch-batchid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "batch_id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/mail/send": { + "post": { + "description": "The Mail Send endpoint allows you to send email over SendGrid’s v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).\n\n## Helper Libraries\n\nTwilio SendGrid provides libraries to help you quickly and easily integrate with the v3 Web API in 7 different languages:\n\n* [C#](https://github.com/sendgrid/sendgrid-csharp) \n* [Go](https://github.com/sendgrid/sendgrid-go)\n* [Java](https://github.com/sendgrid/sendgrid-java)\n* [Node JS](https://github.com/sendgrid/sendgrid-nodejs)\n* [PHP](https://github.com/sendgrid/sendgrid-php)\n* [Python](https://github.com/sendgrid/sendgrid-python)\n* [Ruby](https://github.com/sendgrid/sendgrid-ruby)\n\n## Dynamic Transactional Templates and Handlebars\n\nIn order to send a dynamic template, specify the template ID with the `template_id` parameter. \n\nTo specify handlebar substitutions, define your substitutions in the request JSON with this syntax:\n\n```\n\"dynamic_template_data\": {\n      \"guest\": \"Jane Doe\",\n      \"partysize\": \"4\",\n      \"english\": true,\n      \"date\": \"April 1st, 2021\"\n    }\n```\n\nFor more information about Dynamic Transactional Templates and Handlebars, see our documentation and reference pages.\n\n* [How to send an email with Dynamic Transactional Templates\n](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/)\n* [Using Handlebars](https://sendgrid.com/docs/for-developers/sending-email/using-handlebars/) \n\n## Mail Body Compression\n\nMail body compression is available to some high volume accounts. Talk to your CSM if you are interested in this functionality. Mail body compression works by setting up a JSON payload as defined on this page, then compressing it with gzip (the gzip file can be no more than 30mb).\n\nTo use mail body compression:\n\n1. Add a `Content-Encoding` header, with a value of `gzip`. \n a. `Content-Encoding: gzip` \n2. Send the gzip as a data-binary. \n a. `--data-binary '@data.json.gz'\n`\n\n## Multiple Reply-To Emails\n\nUsing `reply_to_list` allows senders to include more than one recipient email address to receive reply and/or bounce messages from the recipient of the email.\n\n### Usage Considerations\n\n* `reply_to` is mutually exclusive with `reply_to_list`. If both are used, then the API call will be rejected. \n* The `reply_to_list` object, when used, must at least have an email parameter and may also contain a name parameter.\n* Each email address in the `reply_to_list` should be unique.\n* There is a limit of 1000 `reply_to_list` emails per mail/send request.\n* In SMTP calls, we will omit any invalid emails.\n\n### Possible 400 Error Messages\n\n* `reply_to` is mutually exclusive with `reply_to_list`.\n* The `reply_to_list` object, when used, must at least have an email parameter and may also contain a name parameter.\n* Each email address in the `reply_to_list` should be unique.\n* There is a limit of X `reply_to` emails per mail/send request.\n* The `reply_to_list` email does not contain a valid address.\n* The `reply_to_list` email exceeds the maximum total length of X characters.\n* The `reply_to_list` email parameter is required.", + "operationId": "POST_mail-send", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "asm": { + "group_id": 12345, + "groups_to_display": [ + 12345 + ] + }, + "attachments": [ + { + "content": "PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KCiAgICA8aGVhZD4KICAgICAgICA8bWV0YSBjaGFyc2V0PSJVVEYtOCI+CiAgICAgICAgPG1ldGEgaHR0cC1lcXVpdj0iWC1VQS1Db21wYXRpYmxlIiBjb250ZW50PSJJRT1lZGdlIj4KICAgICAgICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNlLXdpZHRoLCBpbml0aWFsLXNjYWxlPTEuMCI+CiAgICAgICAgPHRpdGxlPkRvY3VtZW50PC90aXRsZT4KICAgIDwvaGVhZD4KCiAgICA8Ym9keT4KCiAgICA8L2JvZHk+Cgo8L2h0bWw+Cg==", + "disposition": "attachment", + "filename": "index.html", + "type": "text/html" + } + ], + "batch_id": "AsdFgHjklQweRTYuIopzXcVBNm0aSDfGHjklmZcVbNMqWert1znmOP2asDFjkl", + "categories": [ + "cake", + "pie", + "baking" + ], + "content": [ + { + "type": "text/html", + "value": "

Hello from Twilio SendGrid!

Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.

%open-track%

" + } + ], + "from": { + "email": "orders@example.com", + "name": "Example Order Confirmation" + }, + "ip_pool_name": "transactional email", + "mail_settings": { + "bypass_list_management": { + "enable": false + }, + "footer": { + "enable": false + }, + "sandbox_mode": { + "enable": false + } + }, + "personalizations": [ + { + "bcc": [ + { + "email": "james_doe@example.com", + "name": "Jim Doe" + } + ], + "cc": [ + { + "email": "jane_doe@example.com", + "name": "Jane Doe" + } + ], + "to": [ + { + "email": "john_doe@example.com", + "name": "John Doe" + }, + { + "email": "julia_doe@example.com", + "name": "Julia Doe" + } + ] + }, + { + "bcc": [ + { + "email": "jordan_doe@example.com", + "name": "Jordan Doe" + } + ], + "from": { + "email": "sales@example.com", + "name": "Example Sales Team" + }, + "to": [ + { + "email": "janice_doe@example.com", + "name": "Janice Doe" + } + ] + } + ], + "reply_to": { + "email": "customer_service@example.com", + "name": "Example Customer Service Team" + }, + "send_at": 1617260400, + "subject": "Your Example Order Confirmation", + "tracking_settings": { + "click_tracking": { + "enable": true, + "enable_text": false + }, + "open_tracking": { + "enable": true, + "substitution_tag": "%open-track%" + }, + "subscription_tracking": { + "enable": false + } + } + }, + "properties": { + "asm": { + "description": "An object allowing you to specify how to handle unsubscribes.", + "properties": { + "group_id": { + "description": "The unsubscribe group to associate with this email.", + "type": "integer" + }, + "groups_to_display": { + "description": "An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page.", + "items": { + "type": "integer" + }, + "maxItems": 25, + "type": "array" + } + }, + "required": [ + "group_id" + ], + "type": "object" + }, + "attachments": { + "description": "An array of objects where you can specify any attachments you want to include.", + "items": { + "properties": { + "content": { + "description": "The Base64 encoded content of the attachment.", + "minLength": 1, + "type": "string" + }, + "content_id": { + "description": "The attachment's content ID. This is used when the disposition is set to `“inline”` and the attachment is an image, allowing the file to be displayed within the body of your email.", + "type": "string" + }, + "disposition": { + "default": "attachment", + "description": "The attachment's content-disposition, specifying how you would like the attachment to be displayed. For example, `“inline”` results in the attached file are displayed automatically within the message while `“attachment”` results in the attached file require some action to be taken before it is displayed, such as opening or downloading the file.", + "enum": [ + "inline", + "attachment" + ], + "type": "string" + }, + "filename": { + "description": "The attachment's filename.", + "type": "string" + }, + "type": { + "description": "The MIME type of the content you are attaching (e.g., `“text/plain”` or `“text/html”`).", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "content", + "filename" + ], + "type": "object" + }, + "type": "array" + }, + "batch_id": { + "description": "An ID representing a batch of emails to be sent at the same time. Including a `batch_id` in your request allows you include this email in that batch. It also enables you to cancel or pause the delivery of that batch. For more information, see the [Cancel Scheduled Sends API](https://sendgrid.com/docs/api-reference/).", + "type": "string" + }, + "categories": { + "description": "An array of category names for this message. Each category name may not exceed 255 characters. ", + "items": { + "maxLength": 255, + "type": "string" + }, + "maxItems": 10, + "type": "array", + "uniqueItems": true + }, + "content": { + "description": "An array where you can specify the content of your email. You can include multiple [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of content, but you must specify at least one MIME type. To include more than one MIME type, add another object to the array containing the `type` and `value` parameters.", + "items": { + "properties": { + "type": { + "description": "The MIME type of the content you are including in your email (e.g., `“text/plain”` or `“text/html”`).", + "minLength": 1, + "type": "string" + }, + "value": { + "description": "The actual content of the specified MIME type that you are including in your email.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "type", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "custom_args": { + "description": "Values that are specific to the entire send that will be carried along with the email and its activity data. Key/value pairs must be strings. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This parameter is overridden by `custom_args` set at the personalizations level. Total `custom_args` size may not exceed 10,000 bytes.", + "type": "string" + }, + "from": { + "$ref": "#/components/schemas/from_email_object" + }, + "headers": { + "description": "An object containing key/value pairs of header names and the value to substitute for them. The key/value pairs must be strings. You must ensure these are properly encoded if they contain unicode characters. These headers cannot be one of the reserved headers.", + "type": "object" + }, + "ip_pool_name": { + "description": "The IP Pool that you would like to send this email from.", + "maxLength": 64, + "minLength": 2, + "type": "string" + }, + "mail_settings": { + "description": "A collection of different mail settings that you can use to specify how you would like this email to be handled.", + "properties": { + "bypass_bounce_management": { + "description": "Allows you to bypass the bounce list to ensure that the email is delivered to recipients. Spam report and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypass_list_management` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + } + }, + "type": "object" + }, + "bypass_list_management": { + "description": "Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. This filter cannot be combined with any other bypass filters. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + } + }, + "type": "object" + }, + "bypass_spam_management": { + "description": "Allows you to bypass the spam report list to ensure that the email is delivered to recipients. Bounce and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypass_list_management` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + } + }, + "type": "object" + }, + "bypass_unsubscribe_management": { + "description": "Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. Bounce and spam report lists will still be checked; addresses on these other lists will not receive the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. This filter cannot be combined with the `bypass_list_management` filter. See our [documentation](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + } + }, + "type": "object" + }, + "footer": { + "description": "The default footer that you would like included on every email.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + }, + "html": { + "description": "The HTML content of your footer.", + "type": "string" + }, + "text": { + "description": "The plain text content of your footer.", + "type": "string" + } + }, + "type": "object" + }, + "sandbox_mode": { + "description": "Sandbox Mode allows you to send a test email to ensure that your request body is valid and formatted correctly.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "personalizations": { + "description": "An array of messages and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled. See our [Personalizations documentation](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) for examples.", + "items": { + "properties": { + "bcc": { + "description": "An array of recipients who will receive a blind carbon copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.", + "items": { + "$ref": "#/components/schemas/cc_bcc_email_object" + }, + "maxItems": 1000, + "type": "array" + }, + "cc": { + "description": "An array of recipients who will receive a copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name.", + "items": { + "$ref": "#/components/schemas/cc_bcc_email_object" + }, + "maxItems": 1000, + "type": "array" + }, + "custom_args": { + "description": "Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This field may not exceed 10,000 bytes.", + "maxProperties": 10000, + "type": "object" + }, + "dynamic_template_data": { + "description": "Dynamic template data is available using Handlebars syntax in Dynamic Transactional Templates. This field should be used in combination with a Dynamic Transactional Template, which can be identified by a `template_id` starting with `d-`. This field is a collection of key/value pairs following the pattern \"variable_name\":\"value to insert\".", + "type": "object" + }, + "from": { + "$ref": "#/components/schemas/from_email_object" + }, + "headers": { + "description": "A collection of JSON key/value pairs allowing you to specify handling instructions for your email. You may not overwrite the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`", + "type": "object" + }, + "send_at": { + "description": "A unix timestamp allowing you to specify when your email should be delivered. Scheduling delivery more than 72 hours in advance is forbidden.", + "type": "integer" + }, + "subject": { + "description": "The subject of your email. See character length requirements according to [RFC 2822](http://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit#answer-1592310).", + "minLength": 1, + "type": "string" + }, + "substitutions": { + "description": "Substitutions allow you to insert data without using Dynamic Transactional Templates. This field should **not** be used in combination with a Dynamic Transactional Template, which can be identified by a `template_id` starting with `d-`. This field is a collection of key/value pairs following the pattern \"substitution_tag\":\"value to substitute\". The key/value pairs must be strings. These substitutions will apply to the text and html content of the body of your email, in addition to the `subject` and `reply-to` parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object.", + "maxProperties": 10000, + "type": "object" + }, + "to": { + "$ref": "#/components/schemas/to_email_array" + } + }, + "required": [ + "to" + ], + "type": "object" + }, + "maxItems": 1000, + "type": "array", + "uniqueItems": false + }, + "reply_to": { + "$ref": "#/components/schemas/reply_to_email_object" + }, + "reply_to_list": { + "description": "An array of recipients who will receive replies and/or bounces. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name. You can either choose to use “reply_to” field or “reply_to_list” but not both.", + "items": { + "properties": { + "email": { + "description": "The email address where any replies or bounces will be returned.", + "format": "email", + "type": "string" + }, + "name": { + "description": "A name or title associated with the `reply_to_list` email address.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + }, + "maxItems": 1000, + "type": "array", + "uniqueItems": true + }, + "send_at": { + "description": "A unix timestamp allowing you to specify when you want your email to be delivered. This may be overridden by the `send_at` parameter set at the personalizations level. Delivery cannot be scheduled more than 72 hours in advance. If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid peak times — for example, scheduling at 10:53 — can result in lower deferral rates due to the reduced traffic during off-peak times.", + "type": "integer" + }, + "subject": { + "description": "The global or 'message level' subject of your email. This may be overridden by subject lines set in personalizations.", + "minLength": 1, + "type": "string" + }, + "template_id": { + "description": "An email template ID. A template that contains a subject and content — either text or html — will override any subject and content values specified at the personalizations or message level.", + "type": "string" + }, + "tracking_settings": { + "description": "Settings to determine how you would like to track the metrics of how your recipients interact with your email.", + "properties": { + "click_tracking": { + "description": "Allows you to track if a recipient clicked a link in your email.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + }, + "enable_text": { + "description": "Indicates if this setting should be included in the `text/plain` portion of your email.", + "type": "boolean" + } + }, + "type": "object" + }, + "ganalytics": { + "description": "Allows you to enable tracking provided by Google Analytics.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + }, + "utm_campaign": { + "description": "The name of the campaign.", + "type": "string" + }, + "utm_content": { + "description": "Used to differentiate your campaign from advertisements.", + "type": "string" + }, + "utm_medium": { + "description": "Name of the marketing medium. (e.g. Email)", + "type": "string" + }, + "utm_source": { + "description": "Name of the referrer source. (e.g. Google, SomeDomain.com, or Marketing Email)", + "type": "string" + }, + "utm_term": { + "description": "Used to identify any paid keywords.", + "type": "string" + } + }, + "type": "object" + }, + "open_tracking": { + "description": "Allows you to track if the email was opened by including a single pixel image in the body of the content. When the pixel is loaded, Twilio SendGrid can log that the email was opened.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + }, + "substitution_tag": { + "description": "Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel.", + "type": "string" + } + }, + "type": "object" + }, + "subscription_tracking": { + "description": "Allows you to insert a subscription management link at the bottom of the text and HTML bodies of your email. If you would like to specify the location of the link within your email, you may use the `substitution_tag`.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + }, + "html": { + "description": "HTML to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>", + "type": "string" + }, + "substitution_tag": { + "description": "A tag that will be replaced with the unsubscribe URL. for example: `[unsubscribe_url]`. If this parameter is used, it will override both the `text` and `html` parameters. The URL of the link will be placed at the substitution tag’s location with no additional formatting.", + "type": "string" + }, + "text": { + "description": "Text to be appended to the email with the subscription tracking link. You may control where the link is by using the tag <% %>", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "personalizations", + "from", + "subject", + "content" + ], + "type": "object" + } + } + } + }, + "responses": { + "202": { + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_mailSendErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "413": { + "$ref": "#/components/responses/trait_mailSendErrors_413" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "v3 Mail Send", + "tags": [ + "Mail Send" + ], + "x-stoplight": { + "id": "POST_mail-send", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all mail settings.**\n\nEach setting will be returned with an `enabled` status set to `true` or `false` and a short description that explains what the setting does.", + "operationId": "GET_mail_settings", + "parameters": [ + { + "description": "The number of settings to return.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "Where in the list of results to begin displaying settings.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "description": "Address / domains that should never have email suppressed.", + "enabled": false, + "name": "address_whitelist", + "title": "Address Whitelist" + }, + { + "description": "Allows you to automatically purge bounce records from SendGrid after a specified number of days.", + "enabled": false, + "name": "bounce_purge", + "title": "Bounce Purge" + }, + { + "description": "Controls notifications for events, such as bounces, clicks, and opens.", + "enabled": true, + "name": "event_notify", + "title": "Event Notification" + }, + { + "description": "Allows you to add a custom footer to outgoing email.", + "enabled": false, + "name": "footer", + "title": "Footer" + }, + { + "description": "Allows you to forward bounces to a specific email address.", + "enabled": true, + "name": "forward_bounce", + "title": "Forward Bounce" + }, + { + "description": "Allows for a copy of spam reports to be forwarded to an email address.", + "enabled": false, + "name": "forward_spam", + "title": "Forward Spam" + }, + { + "description": "Allows you to customize your outgoing HTML emails.", + "enabled": true, + "name": "template", + "title": "Legacy Email Template" + }, + { + "description": "Convert your plain text emails to HTML.", + "enabled": false, + "name": "plain_content", + "title": "Plain Content" + }, + { + "description": "Check outbound messages for spam content.", + "enabled": true, + "name": "spam_check", + "title": "Spam Checker" + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "description": "The list of all mail settings.", + "items": { + "properties": { + "description": { + "description": "A description of the mail setting.", + "type": "string" + }, + "enabled": { + "description": "Indicates if this mail setting is currently enabled.", + "type": "boolean" + }, + "name": { + "description": "The name of the mail setting.", + "type": "string" + }, + "title": { + "description": "The title of the mail setting.", + "type": "string" + } + }, + "required": [ + "title", + "enabled", + "name", + "description" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "result" + ], + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "GET_mailsettings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/address_whitelist": { + "get": { + "description": "**This endpoint allows you to retrieve your current email address whitelist settings.**\n\nThe Address Whitelist setting allows you to specify email addresses or domains for which mail should never be suppressed.\n\nFor example, if you own the domain `example.com`, and one or more of your recipients use `email@example.com` addresses, placing `example.com` in the address whitelist setting instructs Twilio SendGrid to ignore all bounces, blocks, and unsubscribes logged for that domain. In other words, all bounces, blocks, and unsubscribes will still be sent to `example.com` as if they were sent under normal sending conditions.", + "operationId": "GET_mail_settings-address_whitelist", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "list": [ + "example.com", + "jane_doe@example1.com" + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_address_whitelabel" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve address whitelist mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "GET_mailsettings-addresswhitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current email address whitelist settings.**\n\nYou can select whether or not this setting should be enabled by assigning the `enabled` field a `true` or `false` value.\n\nPassing only the `enabled` field to this endpoint will not alter your current `list` of whitelist entries. However, any modifications to your `list` of entries will overwrite the entire list. For this reason, you must included all existing entries you wish to retain in your `list` in addition to any new entries you intend to add. To remove one or more `list` entries, pass a `list` with only the entries you wish to retain.\n\nYou should not add generic domains such as `gmail.com` or `yahoo.com` in your `list` because your emails will not honor recipients' unsubscribes. This may cause a legal violation of [CAN-SPAM](https://sendgrid.com/docs/glossary/can-spam/) and could damage your sending reputation.\n\nThe Address Whitelist setting allows you to specify email addresses or domains for which mail should never be suppressed.\n\nFor example, if you own the domain `example.com`, and one or more of your recipients use `email@example.com` addresses, placing `example.com` in the address whitelist setting instructs Twilio SendGrid to ignore all bounces, blocks, and unsubscribes logged for that domain. In other words, all bounces, blocks, and unsubscribes will still be sent to `example.com` as if they were sent under normal sending conditions.", + "operationId": "PATCH_mail_settings-address_whitelist", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "enabled": true, + "list": [ + "email1@example.com", + "example.com" + ] + }, + "properties": { + "enabled": { + "description": "Indicates if your email address whitelist is enabled.", + "type": "boolean" + }, + "list": { + "description": "Either a single email address that you want whitelisted or a domain, for which all email addresses belonging to this domain will be whitelisted.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "list": [ + "email1@example.com" + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_address_whitelabel" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update address whitelist mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "PATCH_mailsettings-addresswhitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/bounce_purge": { + "get": { + "description": "**This endpoint allows you to retrieve your current bounce and purge settings.**\n\nThe Bounce Perge setting allows you to set a schedule that Twilio SendGrid will use to automatically delete contacts from your soft and hard bounce suppression lists.\n\nA hard bounce occurs when an email message has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown.\n\nA soft bounce occurs when an email message reaches the recipient's mail server but is bounced back undelivered before it actually reaches the recipient. A soft bounce might occur because the recipient's inbox is full.\n\nYou can also manage this setting in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). You can manage your bounces manually using the [Bounces API](https://sendgrid.api-docs.io/v3.0/bounces-api) or the [Bounces menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces).", + "operationId": "GET_mail_settings-bounce_purge", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": false, + "hard_bounces": 5, + "soft_bounces": 5 + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_bounce_purge" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve bounce purge mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "GET_mailsettings-bouncepurge", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current bounce and purge settings.**\n\nThe Bounce Perge setting allows you to set a schedule that Twilio SendGrid will use to automatically delete contacts from your soft and hard bounce suppression lists. The schedule is set in full days by assigning the number of days, an integer, to the `soft_bounces` and/or `hard_bounces` fields.\n\nA hard bounce occurs when an email message has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown.\n\nA soft bounce occurs when an email message reaches the recipient's mail server but is bounced back undelivered before it actually reaches the recipient. A soft bounce might occur because the recipient's inbox is full.\n\nYou can also manage this setting in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). You can manage your bounces manually using the [Bounces API](https://sendgrid.api-docs.io/v3.0/bounces-api) or the [Bounces menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces).", + "operationId": "PATCH_mail_settings-bounce_purge", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/mail_settings_bounce_purge" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": false, + "hard_bounces": 5, + "soft_bounces": 5 + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_bounce_purge" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update bounce purge mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "PATCH_mailsettings-bouncepurge", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/footer": { + "get": { + "description": "**This endpoint allows you to retrieve your current Footer mail settings.**\n\nThe Footer setting will insert a custom footer at the bottom of your text and HTML email message bodies.\n\nYou can insert your HTML or plain text directly using the \"Update footer mail settings\" endpoint, or you can create the footer using the [Mail Settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings).", + "operationId": "GET_mail_settings-footer", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "html_content": "

Ahoy, World!

\n", + "plain_content": "" + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_footer" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve footer mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "GET_mailsettings-footer", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current Footer mail settings.**\n\nThe Footer setting will insert a custom footer at the bottom of your text and HTML email message bodies.\n\nYou can insert your HTML or plain text directly using this endpoint, or you can create the footer using the [Mail Settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings).", + "operationId": "PATCH_mail_settings-footer", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/mail_settings_footer" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "html_content": "

Ahoy, World!

\n", + "plain_content": "" + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_footer" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update footer mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "PATCH_mailsettings-footer", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/forward_bounce": { + "get": { + "description": "**This endpoint allows you to retrieve your current bounce forwarding mail settings.**\n\nEnabling the Forward Bounce setting allows you to specify `email` addresses to which bounce reports will be forwarded. This endpoint returns the email address you have set to receive forwarded bounces and an `enabled` status indicating if the setting is active.", + "operationId": "GET_mail_settings-forward_bounce", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "bounces@example.com", + "enabled": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_forward_bounce" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve forward bounce mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "GET_mailsettings-forwardbounce", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current bounce forwarding mail settings.**\n\nEnabling the Forward Bounce setting allows you to specify an `email` address to which bounce reports will be forwarded.\n\nYou can also configure the Forward Spam mail settings in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings).", + "operationId": "PATCH_mail_settings-forward_bounce", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/mail_settings_forward_bounce" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "bounces@example.com", + "enabled": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_forward_bounce" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update forward bounce mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "PATCH_mailsettings-forwardbounce", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/forward_spam": { + "get": { + "description": "**This endpoint allows you to retrieve your current Forward Spam mail settings.**\n\nEnabling the Forward Spam setting allows you to specify `email` addresses to which spam reports will be forwarded. This endpoint returns any email address(es) you have set to receive forwarded spam and an `enabled` status indicating if the setting is active.", + "operationId": "GET_mail_settings-forward_spam", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "abuse@example.com", + "enabled": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_forward_spam" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve forward spam mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "GET_mailsettings-forwardspam", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current Forward Spam mail settings.**\n\nEnabling the Forward Spam setting allows you to specify `email` addresses to which spam reports will be forwarded. You can set multiple addresses by passing this endpoint a comma separated list of emails in a single string.\n\n```\n{\n \"email\": \"address1@example.com, address2@exapmle.com\",\n \"enabled\": true\n}\n```\n\nThe Forward Spam setting may also be used to receive emails sent to `abuse@` and `postmaster@` role addresses if you have authenticated your domain.\n\nFor example, if you authenticated `example.com` as your root domain and set a custom return path of `sub` for that domain, you could turn on Forward Spam, and any emails sent to `abuse@sub.example.com` or `postmaster@sub.example.com` would be forwarded to the email address you entered in the `email` field.\n\nYou can authenticate your domain using the \"Authenticate a domain\" endpoint or in the [Sender Authentication section of the Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth). You can also configure the Forward Spam mail settings in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings).", + "operationId": "PATCH_mail_settings-forward_spam", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/mail_settings_forward_spam" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "abuse@example.com", + "enabled": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_forward_spam" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update forward spam mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "PATCH_mailsettings-forwardspam", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/template": { + "get": { + "description": "**This endpoint allows you to retrieve your current legacy email template settings.**\n\nThis setting refers to our original email templates. We currently support more fully featured [Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/).\n\nThe legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. For instructions on using legacy templates, see how to [\"Create and Edit Legacy Transactional Templates](https://sendgrid.com/docs/ui/sending-email/create-and-edit-legacy-transactional-templates/). For help migrating to our current template system, see [\"Migrating from Legacy Templates\"](https://sendgrid.com/docs/ui/sending-email/migrating-from-legacy-templates/).", + "operationId": "GET_mail_settings-template", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": false, + "html_content": "

<% body %>Example

\n" + } + } + }, + "schema": { + "$ref": "#/components/schemas/mail_settings_template" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve legacy template mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "GET_mailsettings-template", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current legacy email template settings.**\n\nThis setting refers to our original email templates. We currently support more fully featured [Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/).\n\nThe legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. For instructions on using legacy templates, see how to [\"Create and Edit Legacy Transactional Templates](https://sendgrid.com/docs/ui/sending-email/create-and-edit-legacy-transactional-templates/). For help migrating to our current template system, see [\"Migrating from Legacy Templates\"](https://sendgrid.com/docs/ui/sending-email/migrating-from-legacy-templates/).", + "operationId": "PATCH_mail_settings-template", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "enabled": true, + "html_content": "<% body %>" + }, + "properties": { + "enabled": { + "description": "Indicates if you want to enable the legacy email template mail setting.", + "type": "boolean" + }, + "html_content": { + "description": "The new HTML content for your legacy email template.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": false, + "html_content": "

<% body %>Example

\n" + } + } + }, + "schema": { + "properties": { + "enabled": { + "description": "Indicates if the legacy email template mail setting is enabled.", + "type": "boolean" + }, + "html_content": { + "description": "The HTML content of your legacy email template.", + "type": "string" + } + }, + "required": [ + "enabled", + "html_content" + ], + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_makoErrorResponse_400" + }, + "401": { + "$ref": "#/components/responses/trait_makoErrorResponse_401" + }, + "403": { + "$ref": "#/components/responses/trait_makoErrorResponse_403" + }, + "404": { + "$ref": "#/components/responses/trait_makoErrorResponse_404" + }, + "500": { + "$ref": "#/components/responses/trait_makoErrorResponse_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update template mail settings", + "tags": [ + "Settings - Mail" + ], + "x-stoplight": { + "id": "PATCH_mailsettings-template", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mailbox_providers/stats": { + "get": { + "description": "**This endpoint allows you to retrieve your email statistics segmented by recipient mailbox provider.**\n\n**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.\n\nAdvanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/).", + "operationId": "GET_mailbox_providers-stats", + "parameters": [ + { + "description": "The mail box providers to get statistics for. You can include up to 10 by including this parameter multiple times.", + "in": "query", + "name": "mailbox_providers", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_limit" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_offset" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_aggregated_by" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_start_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_end_date" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2015-10-11", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-12", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-13", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-14", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-15", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-16", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-17", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-18", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-19", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-20", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-21", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 1, + "drops": 0, + "opens": 1, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 1 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-22", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-23", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-24", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-25", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-26", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 2, + "drops": 0, + "opens": 2, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 2 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-27", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-28", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-29", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-30", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-10-31", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-01", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-02", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-03", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-04", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-05", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-06", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-07", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-08", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-09", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + }, + { + "date": "2015-11-10", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "drops": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + } + ] + } + }, + "schema": { + "items": { + "properties": { + "date": { + "description": "The date that the statistics were gathered.", + "type": "string" + }, + "stats": { + "description": "The list of statistics.", + "items": { + "properties": { + "metrics": { + "$ref": "#/components/schemas/advanced_stats_mailbox_provider" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by mailbox provider.", + "tags": [ + "Stats" + ], + "x-stoplight": { + "id": "GET_mailboxproviders-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/contacts": { + "delete": { + "description": "**This endpoint can be used to delete one or more contacts**.\n\nThe query parameter `ids` must set to a comma-separated list of contact IDs for bulk contact deletion.\n\nThe query parameter `delete_all_contacts` must be set to `\"true\"` to delete **all** contacts. \n\nYou must set either `ids` or `delete_all_contacts`.\n\nDeletion jobs are processed asynchronously.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.", + "operationId": "DELETE_mc-contacts", + "parameters": [ + { + "description": "Must be set to `\"true\"` to delete all contacts.", + "in": "query", + "name": "delete_all_contacts", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "A comma-separated list of contact IDs.", + "in": "query", + "name": "ids", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "description": "The deletion job has been accepted and is being processed.", + "properties": { + "job_id": { + "description": "The deletion job ID.", + "type": "object" + } + }, + "required": [ + "job_id" + ], + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Contacts", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "DELETE_mc-contacts", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint will return up to 50 of the most recent contacts uploaded or attached to a list**. \n\nThis list will then be sorted by email address.\n\nThe full contact count is also returned.\n\nPlease note that pagination of the contacts has been deprecated.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.", + "operationId": "GET_mc-contats", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/selfmetadata" + }, + "contact_count": { + "type": "integer" + }, + "result": { + "items": { + "$ref": "#/components/schemas/contact-details3" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Sample Contacts", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "GET_mc-contats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "put": { + "description": "**This endpoint allows the [upsert](https://en.wiktionary.org/wiki/upsert) (insert or update) of up to 30,000 contacts, or 6MB of data, whichever is lower**. \n\nBecause the creation and update of contacts is an asynchronous process, the response will not contain immediate feedback on the processing of your upserted contacts. Rather, it will contain an HTTP 202 response indicating the contacts are queued for processing or an HTTP 4XX error containing validation errors. Should you wish to get the resulting contact's ID or confirm your contacts have been updated or added, you can use the \"Get Contacts by Emails\" endpoint. \n\nPlease note that custom fields need to have been already created if you wish to set their values for the contacts being upserted. To do this, please use the \"Create Custom Field Definition\" endpoint.\n\nYou will see a `job_id` in the response to your request. This can be used to check the status of your upsert job. To do so, please use the \"Import Contacts Status\" endpoint.\n\nIf the contact already exists in the system, any entries submitted via this endpoint will update the existing contact. The contact to update will be determined only by the `email` field and any fields omitted from the request will remain as they were. A contact's ID cannot be used to update the contact.\n\nThe email field will be changed to all lower-case. If a contact is added with an email that exists but contains capital letters, the existing contact with the all lower-case email will be updated.", + "operationId": "PUT_mc-contacts", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "contacts": { + "description": "One or more contacts objects that you intend to upsert. The available fields for a contact, including the required `email` field are described below.", + "items": { + "$ref": "#/components/schemas/contact-request" + }, + "maxItems": 30000, + "minItems": 1, + "type": "array" + }, + "list_ids": { + "description": "An array of List ID strings that this contact will be added to.", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "contacts" + ], + "type": "object" + } + } + } + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "properties": { + "job_id": { + "description": "Indicates that the contacts are queued for processing. Check the job status with the \"Import Contacts Status\" endpoint.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add or Update a Contact", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "PUT_mc-contacts", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/contacts/batch": { + "post": { + "description": "**This endpoint is used to retrieve a set of contacts identified by their IDs.**\n\nThis can be more efficient endpoint to get contacts than making a series of individual `GET` requests to the \"Get a Contact by ID\" endpoint.\n\nYou can supply up to 100 IDs. Pass them into the `ids` field in your request body as an array or one or more strings.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.", + "operationId": "POST_marketing-contacts-batch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "Array of IDs", + "example": { + "ids": [ + "1234", + "1235" + ] + }, + "properties": { + "ids": { + "items": { + "type": "string" + }, + "maxItems": 100, + "type": "array" + } + }, + "required": [ + "ids" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "items": { + "$ref": "#/components/schemas/contact-details3" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "summary": "Get Batched Contacts by IDs", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "POST_marketing-contacts-batch", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/contacts/count": { + "get": { + "description": "**This endpoint returns the total number of contacts you have stored.**\n\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.", + "operationId": "GET_mc-contacts-count", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "billable_breakdown": { + "description": "`billable_breakdown` will only appear to the parent user in an account with subusers.", + "properties": { + "breakdown": { + "description": "A map of each subuser's billable contact usage. Each key is the subuser's ID and each value is the usage thus far this month.", + "minProperties": 0, + "type": "object" + }, + "total": { + "description": "The sum of all the subuser's billable contacts", + "type": "integer" + } + }, + "type": "object" + }, + "billable_count": { + "default": 0, + "description": "The count of contacts this month for billing purposes.", + "minimum": 0, + "type": "integer" + }, + "contact_count": { + "description": "The total number of contacts.", + "type": "integer" + } + }, + "required": [ + "contact_count" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Total Contact Count", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "GET_mc-contacts-count", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/contacts/exports": { + "get": { + "description": "**Use this endpoint to retrieve details of all current exported jobs**.\n\nIt will return an array of objects, each of which records an export job in flight or recently completed. \n\nEach object's `export_type` field will tell you which kind of export it is and its `status` field will indicate what stage of processing it has reached. Exports which are `ready` will be accompanied by a `urls` field which lists the URLs of the export's downloadable files — there will be more than one if you specified a maximum file size in your initial export request.\n\nUse this endpoint if you have exports in flight but do not know their IDs, which are required for the \"Export Contacts Status\" endpoint.", + "operationId": "GET_marketing-contacts-exports", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "_metadata": { + "properties": { + "next": { + "description": "Link to next page.", + "type": "string" + }, + "prev": { + "type": "string" + }, + "self": { + "description": "Link to this page.", + "type": "string" + } + }, + "type": "object" + }, + "result": { + "items": { + "properties": { + "_metadata": { + "properties": { + "next": { + "type": "string" + }, + "prev": { + "type": "string" + }, + "self": { + "type": "string" + } + }, + "type": "object" + }, + "completed_at": { + "description": "This ISO8601 timestamp when the export was completed.", + "type": "string" + }, + "created_at": { + "description": "This ISO8601 timestamp when the export was created.", + "type": "string" + }, + "expires_at": { + "description": "This ISO8601 timestamp when the export expires.", + "type": "string" + }, + "export_type": { + "description": "Allowed types: `contacts_export`, `list_export`, or `segment_export`.", + "type": "string" + }, + "id": { + "description": "Export jobs ID.", + "type": "string" + }, + "lists": { + "items": { + "properties": { + "ID": { + "type": "string" + }, + "Name": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "segments": { + "items": { + "properties": { + "ID": { + "type": "string" + }, + "Name": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "Allowed values: `pending`, `ready`, or `failure`.", + "type": "string" + }, + "urls": { + "description": "One or more download URLs for the contact file(s) if the status is `ready`.", + "items": { + "type": "string" + }, + "type": "array" + }, + "user_id": { + "description": "User ID.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "": { + "type": "string" + }, + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get All Existing Exports", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "GET_marketing-contacts-exports", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**Use this endpoint to export lists or segments of contacts**.\n\nIf you would just like to have a link to the exported list sent to your email set the `notifications.email` option to `true` in the `POST` payload.\n\nIf you would like to download the list, take the `id` that is returned and use the \"Export Contacts Status\" endpoint to get the `urls`. Once you have the list of URLs, make a `GET` request to each URL provided to download your CSV file(s).\n\nYou specify the segements and or/contact lists you wish to export by providing the relevant IDs in, respectively, the `segment_ids` and `list_ids` fields in the request body.\n\nThe lists will be provided in either JSON or CSV files. To specify which of these you would required, set the request body `file_type` field to `json` or `csv`.\n\nYou can also specify a maximum file size (in MB). If the export file is larger than this, it will be split into multiple files.", + "operationId": "POST_mc-contacts-exports", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "file_type": { + "default": "csv", + "description": "File type for export file. Choose from `json` or `csv`.", + "enum": [ + "csv", + "json" + ], + "type": "string" + }, + "list_ids": { + "description": "IDs of the contact lists you want to export.", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + "max_file_size": { + "default": 5000, + "description": "The maximum size of an export file in MB. Note that when this option is specified, multiple output files may be returned from the export.", + "type": "integer" + }, + "notifications": { + "properties": { + "email": { + "type": "boolean" + } + }, + "type": "object" + }, + "segment_ids": { + "description": "IDs of the contact segments you want to export.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/metadata" + }, + "id": { + "description": "The ID of the export job.", + "type": "string" + } + }, + "required": [ + "_metadata" + ], + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Export Contacts", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "POST_mc-contacts-exports", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/contacts/exports/{id}": { + "get": { + "description": "**This endpoint can be used to check the status of a contact export job**. \n\nTo use this call, you will need the `id` from the \"Export Contacts\" call.\n\nIf you would like to download a list, take the `id` that is returned from the \"Export Contacts\" endpoint and make an API request here to get the `urls`. Once you have the list of URLs, make a `GET` request on each URL to download your CSV file(s).\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.", + "operationId": "GET_mc-contacts-exports-id", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact-export" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Export Contacts Status", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "GET_mc-contacts-exports-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/marketing/contacts/imports": { + "put": { + "description": "**This endpoint allows a CSV upload containing up to one million contacts or 5GB of data, whichever is smaller.**\n\nImports take place asynchronously: the endpoint returns a URL (`upload_uri`) and HTTP headers (`upload_headers`) which can subsequently be used to `PUT` a file of contacts to be imported into our system.\n\nUploaded CSV files may also be [gzip-compressed](https://en.wikipedia.org/wiki/Gzip).\n\nIn either case, you must include the field `file_type` with the value `csv` in your request body.\n\nThe `field_mappings` paramter is a respective list of field definition IDs to map the uploaded CSV columns to. It allows you to use CSVs where one or more columns are skipped (`null`) or remapped to the contact field. \n\nFor example, if `field_mappings` is set to `[null, \"w1\", \"_rf1\"]`, this means skip column 0, map column 1 to the custom field with the ID `w1`, and map column 2 to the reserved field with the ID `_rf1`. See the \"Get All Field Definitions\" endpoint to fetch your custom and reserved field IDs to use with `field_mappings`.\n\nOnce you recieve the response body you can then initiate a **second** API call where you use the supplied URL and HTTP header to upload your file. For example:\n\n`curl --upload-file \"file/path.csv\" \"URL_GIVEN\" -H 'HEADER_GIVEN'`\n\nIf you'd like to monitor the status of your import job, use the `job_id` and the \"Import Contacts Status\" endpoint.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.", + "operationId": "PUT_mc-contacts-imports", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "field_mappings": { + "description": "Import file header to reserved/custom field mapping.", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "nullable": true + } + ] + }, + "minItems": 1, + "type": "array", + "uniqueItems": false + }, + "file_type": { + "description": "Upload file type.", + "enum": [ + "csv" + ], + "type": "string" + }, + "list_ids": { + "description": "All contacts will be added to each of the specified lists.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "file_type", + "field_mappings" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "job_id": { + "description": "The ID of the import job.", + "type": "string" + }, + "upload_headers": { + "description": "A list of headers that must be included in PUT request.", + "items": { + "properties": { + "header": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "header", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "upload_uri": { + "description": "The URI to PUT the upload file to.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "description": "If any of the specified lists do not exist.", + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Import Contacts", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "PUT_mc-contacts-imports", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/contacts/imports/{id}": { + "get": { + "description": "**This endpoint can be used to check the status of a contact import job**. \n\nUse the `job_id` from the \"Import Contacts,\" \"Add or Update a Contact,\" or \"Delete Contacts\" endpoints as the `id` in the path parameter.\n\nIf there is an error with your `PUT` request, download the `errors_url` file and open it to view more details.\n\nThe job `status` field indicates whether the job is `pending`, `completed`, `errored`, or `failed`. \n\nPending means not started. Completed means finished without any errors. Errored means finished with some errors. Failed means finshed with all errors, or the job was entirely unprocessable: for example, if you attempt to import file format we do not support.\n\nThe `results` object will have fields depending on the job type.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.", + "operationId": "GET_marketing-contacts-imports-id", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact-import" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "$ref": "#/components/schemas/error" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Import Contacts Status", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "GET_marketing-contacts-imports-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/marketing/contacts/search": { + "post": { + "description": "**Use this endpoint to locate contacts**.\n\nThe request body's `query` field accepts valid [SGQL](https://sendgrid.com/docs/for-developers/sending-email/segmentation-query-language/) for searching for a contact.\n\nBecause contact emails are stored in lower case, using SGQL to search by email address requires the provided email address to be in lower case. The SGQL `lower()` function can be used for this.\n\nOnly the first 50 contacts that meet the search criteria will be returned.\n\nIf the query takes longer than 20 seconds, a `408 Request Timeout` status will be returned.\n\nFormatting the `created_at` and `updated_at` values as Unix timestamps is deprecated. Instead they are returned as ISO format as string.", + "operationId": "POST_mc-contacts-search", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "query": "email LIKE 'ENTER_COMPLETE_OR_PARTIAL_EMAIL_ADDRESS_HERE%' AND CONTAINS(list_ids, 'YOUR_LIST_IDs')" + }, + "properties": { + "query": { + "description": "An SGQL search string or other pattern.", + "type": "string" + } + }, + "required": [ + "query" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/selfmetadata" + }, + "contact_count": { + "description": "The total number of contacts matched.", + "type": "number" + }, + "result": { + "items": { + "$ref": "#/components/schemas/contact-details3" + }, + "type": "array" + } + }, + "required": [ + "contact_count" + ], + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "408": { + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Search Contacts", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "POST_mc-contacts-search", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/contacts/search/emails": { + "post": { + "description": "**This endpoint allows you to retrieve up to 100 contacts matching the searched `email` address(es), including any `alternate_emails`.** \n\nEmail addresses are unique to a contact, meaning this endpoint can treat an email address as a primary key to search by. The contact object associated with the address, whether it is their `email` or one of their `alternate_emails` will be returned if matched.\n\nEmail addresses in the search request do not need to match the case in which they're stored, but the email addresses in the result will be all lower case. Empty strings are excluded from the search and will not be returned.\n\nThis endpoint should be used in place of the \"Search Contacts\" endpoint when you can provide exact email addresses and do not need to include other [Segmentation Query Language (SGQL)](https://sendgrid.com/docs/for-developers/sending-email/segmentation-query-language/) filters when searching.\n\nIf you need to access a large percentage of your contacts, we recommend exporting your contacts with the \"Export Contacts\" endpoint and filtering the results client side.\n\nThis endpoint returns a `200` status code when any contacts match the address(es) you supplied. When searching multiple addresses in a single request, it is possible that some addresses will match a contact while others will not. When a partially successful search like this is made, the matching contacts are returned in an object and an error message is returned for the email address(es) that are not found. \n\nThis endpoint returns a `404` status code when no contacts are found for the provided email address(es).\n\nA `400` status code is returned if any searched addresses are invalid.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.", + "operationId": "POST_marketing-contacts-search-emails", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "", + "example": { + "emails": [ + "jane_doe@example.com", + "john_doe@example.com", + "joann_doe@example.com" + ] + }, + "properties": { + "emails": { + "description": "One or more primary emails and/or alternate emails to search through your contacts for.", + "items": { + "maxLength": 100, + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "emails" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": { + "jane_doe@example.com": { + "contact": { + "_metadata": { + "self": "" + }, + "address_line_1": "", + "address_line_2": "", + "alternate_emails": [ + "janedoe@example1.com" + ], + "city": "", + "country": "", + "created_at": "2021-03-02T15:25:47Z", + "custom_fields": {}, + "email": "jane_doe@example.com", + "facebook": "", + "first_name": "Jane", + "id": "asdf-Jkl-zxCvBNm", + "last_name": "Doe", + "line": "", + "list_ids": [], + "phone_number": "", + "postal_code": "", + "segment_ids": [], + "state_province_region": "", + "unique_name": "", + "updated_at": "2021-03-30T15:26:16Z", + "whatsapp": "" + } + }, + "joann_doe@example.com": { + "error": "contact not found" + }, + "john_doe@example.com": { + "contact": { + "_metadata": { + "self": "" + }, + "address_line_1": "", + "address_line_2": "", + "alternate_emails": [], + "city": "", + "country": "", + "created_at": "2020-01-02T15:25:47Z", + "custom_fields": {}, + "email": "john_doe@example.com", + "facebook": "", + "first_name": "Jane", + "id": "asdf-Jkl-qWeRTy", + "last_name": "Doe", + "line": "", + "list_ids": [], + "phone_number": "", + "postal_code": "", + "segment_ids": [], + "state_province_region": "", + "unique_name": "", + "updated_at": "2020-12-20T15:26:16Z", + "whatsapp": "" + } + } + } + } + } + }, + "schema": { + "properties": { + "result": { + "additionalProperties": false, + "patternProperties": { + "^[A-Za-z0-9\\._%\\+-]+@[A-Za-z0-9\\.-]+\\.[A-Za-z]{2,6}$": { + "description": "This will be one of the specified email adresses.", + "properties": { + "contact": { + "$ref": "#/components/schemas/contact-details3" + }, + "error": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Contacts by Emails", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "POST_marketing-contacts-search-emails", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/contacts/{id}": { + "get": { + "description": "**This endpoint returns the full details and all fields for the specified contact**.\n\nThe \"Get Contacts by Emails\" endpoint can be used to get the ID of a contact.", + "operationId": "GET_mc-contacts-id", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact-details3" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "description": "" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get a Contact by ID", + "tags": [ + "Contacts" + ], + "x-stoplight": { + "id": "GET_mc-contacts-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/marketing/field_definitions": { + "get": { + "description": "**This endpoint retrieves all defined Custom Fields and Reserved Fields.**", + "operationId": "GET_mc-field_definitions", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "self": "https://example.com/marketing/field_definitions" + }, + "custom_fields": [ + { + "field_type": "Number", + "id": "w1", + "name": "num_orders" + }, + { + "field_type": "Date", + "id": "w2", + "name": "dob" + } + ], + "reserved_fields": [ + { + "field_type": "Text", + "id": "_rf0_T", + "name": "first_name" + }, + { + "field_type": "Text", + "id": "_rf1_T", + "name": "last_name" + }, + { + "field_type": "Text", + "id": "_rf2_T", + "name": "email" + }, + { + "field_type": "Text", + "id": "_rf3_T", + "name": "alternate_emails" + }, + { + "field_type": "Text", + "id": "_rf4_T", + "name": "address_line_1" + }, + { + "field_type": "Text", + "id": "_rf5_T", + "name": "address_line_2" + }, + { + "field_type": "Text", + "id": "_rf6_T", + "name": "city" + }, + { + "field_type": "Text", + "id": "_rf7_T", + "name": "state_province_region" + }, + { + "field_type": "Text", + "id": "_rf8_T", + "name": "postal_code" + }, + { + "field_type": "Text", + "id": "_rf9_T", + "name": "country" + }, + { + "field_type": "Text", + "id": "_rf10_T", + "name": "phone_number" + }, + { + "field_type": "Text", + "id": "_rf11_T", + "name": "whatsapp" + }, + { + "field_type": "Text", + "id": "_rf12_T", + "name": "line" + }, + { + "field_type": "Text", + "id": "_rf13_T", + "name": "facebook" + }, + { + "field_type": "Text", + "id": "_rf14_T", + "name": "unique_name" + }, + { + "field_type": "Text", + "id": "_rf15_T", + "name": "email_domains", + "read_only": true + }, + { + "field_type": "Date", + "id": "_rf16_D", + "name": "last_clicked", + "read_only": true + }, + { + "field_type": "Date", + "id": "_rf17_D", + "name": "last_opened", + "read_only": true + }, + { + "field_type": "Date", + "id": "_rf18_D", + "name": "last_emailed", + "read_only": true + }, + { + "field_type": "Text", + "id": "_rf19_T", + "name": "singlesend_id", + "read_only": true + }, + { + "field_type": "Text", + "id": "_rf20_T", + "name": "automation_id", + "read_only": true + }, + { + "field_type": "Date", + "id": "_rf21_D", + "name": "created_at", + "read_only": true + }, + { + "field_type": "Date", + "id": "_rf22_D", + "name": "updated_at", + "read_only": true + }, + { + "field_type": "Text", + "id": "_rf23_T", + "name": "contact_id", + "read_only": true + } + ] + } + } + }, + "schema": { + "maxProperties": 120, + "minProperties": 0, + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + }, + "custom_fields": { + "items": { + "$ref": "#/components/schemas/custom_field_definitions_response" + }, + "type": "array" + }, + "reserved_fields": { + "$ref": "#/components/schemas/reserved_field_definitions_response" + } + }, + "required": [ + "custom_fields", + "reserved_fields" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get All Field Definitions", + "tags": [ + "Custom Fields" + ], + "x-stoplight": { + "id": "GET_mc-field_definitions", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint creates a new custom field definition.**\n\nCustom field definitions are created with the given `name` and `field_type`. Although field names are stored in a case-sensitive manner, all field names must be case-insensitively unique. This means you may create a field named `CamelCase` or `camelcase`, but not both. Additionally, a Custom Field name cannot collide with any Reserved Field names. You should save the returned `id` value in order to update or delete the field at a later date. You can have up to 120 custom fields.\n\nThe custom field name should be created using only alphanumeric characters (A-Z and 0-9) and underscores (\\_). Custom fields can only begin with letters A-Z or underscores (_). The field type can be date, text, or number fields. The field type is important for creating segments from your contact database.\n\n**Note: Creating a custom field that begins with a number will cause issues with sending in Marketing Campaigns.**", + "operationId": "POST_mc-field_definitions", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "field_type": "Text", + "name": "custom_field_name" + }, + "properties": { + "field_type": { + "enum": [ + "Text", + "Number", + "Date" + ], + "type": "string" + }, + "name": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "name", + "field_type" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "self": "https://api.sendgrid.com/v3/marketing/field_definitions/a1_B" + }, + "field_type": "Text", + "id": "a1_T", + "name": "custom_field_name" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/custom_field_definitions_response" + }, + { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + } + }, + "type": "object" + } + ] + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create Custom Field Definition", + "tags": [ + "Custom Fields" + ], + "x-stoplight": { + "id": "POST_mc-field_definitions", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/field_definitions/{custom_field_id}": { + "delete": { + "description": "**This endpoint deletes a defined Custom Field.**\n\nYou cand delete only Custom Fields; Reserved Fields cannot be deleted.", + "operationId": "DELETE_mc-field_definitions-custom_field_id", + "responses": { + "204": { + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Custom Field Definition", + "tags": [ + "Custom Fields" + ], + "x-stoplight": { + "id": "DELETE_mc-field_definitions-custom_field_id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "custom_field_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endopoint allows you to update a defined Custom Field.**\n\nOnly your Custom fields can be modified; Reserved Fields cannot be updated.", + "operationId": "PATCH_mc-field_definitions-custom_field_id", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "new_custom_field_name" + }, + "properties": { + "name": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "self": "https://api.sendgrid.com/v3/marketing/field_definitions/a1_B" + }, + "field_type": "Text", + "id": "a1_T", + "name": "custom_field_name" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/custom_field_definitions_response" + }, + { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + } + }, + "type": "object" + } + ] + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Custom Field Definition", + "tags": [ + "Custom Fields" + ], + "x-stoplight": { + "id": "PATCH_mc-field_definitions-custom_field_id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/lists": { + "get": { + "description": "**This endpoint returns an array of all of your contact lists.**", + "operationId": "GET_mc-lists", + "parameters": [ + { + "description": "Maximum number of elements to return. Defaults to 100, returns 1000 max", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "type": "number" + } + }, + { + "in": "query", + "name": "page_token", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "self": "https://api.sendgrid.com/v3/marketing/lists?page_size=100&page_token=" + }, + "result": [ + { + "_metadata": { + "self": "https://api.sendgrid.com/v3/marketing/lists/abc12312-x3y4-1234-abcd-123qwe456rty" + }, + "contact_count": 0, + "id": "abc12312-x3y4-1234-abcd-123qwe456rty", + "name": "list-name" + } + ] + } + } + }, + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/metadata" + }, + "result": { + "items": { + "$ref": "#/components/schemas/list" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get All Lists", + "tags": [ + "Lists" + ], + "x-stoplight": { + "id": "GET_mc-lists", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint creates a new contacts list.**\n\nOnce you create a list, you can use the UI to [trigger an automation](https://sendgrid.com/docs/ui/sending-email/getting-started-with-automation/#create-an-automation) every time you add a new contact to the list.\n\nA link to the newly created object is in `_metadata`.", + "operationId": "POST_mc-lists", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "list-name" + }, + "properties": { + "name": { + "description": "Your name for your list", + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "self": "https://api.sendgrid.com/v3/marketing/lists/ca7a3796-e8a8-4029-9ccb-df8937940562" + }, + "contact_count": 0, + "id": "ca7a3796-e8a8-4029-9ccb-df8937940562", + "name": "list-name" + } + } + }, + "schema": { + "$ref": "#/components/schemas/list" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create List", + "tags": [ + "Lists" + ], + "x-stoplight": { + "id": "POST_mc-lists", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/lists/{id}": { + "delete": { + "description": "**This endpoint allows you to deletes a specific list.**\n\nOptionally, you can also delete contacts associated to the list. The query parameter, `delete_contacts=true`, will delete the list and start an asynchronous job to delete associated contacts.", + "operationId": "DELETE_lists-id", + "parameters": [ + { + "description": "Flag indicates that all contacts on the list are also to be deleted.", + "in": "query", + "name": "delete_contacts", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "job_id": "abc12312-x3y4-1234-abcd-123qwe456rty" + } + } + }, + "schema": { + "description": "The delete has been accepted and is processing.", + "properties": { + "job_id": { + "description": "job_id of the async job", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "204": { + "content": { + "application/json": { + "schema": { + "description": "The delete has been processed. ", + "type": "string" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a list", + "tags": [ + "Lists" + ], + "x-stoplight": { + "id": "DELETE_lists-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint returns data about a specific list.**\n\nSetting the optional parameter `contact_sample=true` returns the `contact_sample` in the response body. Up to fifty of the most recent contacts uploaded or attached to a list will be returned, sorted alphabetically, by email address.\n\nThe full contact count is also returned.", + "operationId": "GET_mc-lists-id", + "parameters": [ + { + "description": "Setting this parameter to the true will cause the contact_sample to be returned", + "in": "query", + "name": "contact_sample", + "schema": { + "default": false, + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "self": "https://api.sendgrid.com/v3/marketing/lists/199abb98-0af3-4a8d-b371-6811ff85d062" + }, + "contact_count": 2, + "contact_sample": { + "created_at": "2620-06-16T17:03:54.867Z", + "id": "c3445f88-5c69-4237-86e6-9ec9de958050", + "list_ids": [ + "199abb98-0af3-4a8d-b371-6811ff85d062" + ], + "updated_at": "4780-12-06T06:51:30.024Z" + }, + "id": "199abb98-0af3-4a8d-b371-6811ff85d062", + "name": "list-name" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/list" + }, + { + "properties": { + "contact_sample": { + "$ref": "#/components/schemas/contact-details2" + } + }, + "type": "object" + } + ] + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get a List by ID", + "tags": [ + "Lists" + ], + "x-stoplight": { + "id": "GET_mc-lists-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint updates the name of a list.**", + "operationId": "PATCH_mc-lists-id", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "updated-list-name" + }, + "properties": { + "name": { + "description": "Your name for your list.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "self": "https://api.sendgrid.com/v3/marketing/lists/abc12312-x3y4-1234-abcd-123qwe456rty" + }, + "contact_count": 0, + "id": "abc12312-x3y4-1234-abcd-123qwe456rty", + "name": "updated-list-name" + } + } + }, + "schema": { + "$ref": "#/components/schemas/list" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/error" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update List", + "tags": [ + "Lists" + ], + "x-stoplight": { + "id": "PATCH_mc-lists-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/lists/{id}/contacts": { + "delete": { + "description": "**This endpoint allows you to remove contacts from a given list.**\n\nThe contacts will not be deleted. Only their list membership will be changed.", + "operationId": "DELETE_mc-lists-id-contacts", + "parameters": [ + { + "description": "comma separated list of contact ids", + "in": "query", + "name": "contact_ids", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "description": "The removal is accepted and processing.", + "properties": { + "job_id": { + "description": "job_id of the async job", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "description": "If the specified list id does not exist. If the specified contact does not exist." + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove Contacts from a List", + "tags": [ + "Lists" + ], + "x-stoplight": { + "id": "DELETE_mc-lists-id-contacts", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/marketing/lists/{id}/contacts/count": { + "get": { + "description": "**This endpoint returns the number of contacts on a specific list.**", + "operationId": "GET_mc-lists-id-contacts-count", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "billable_count:": 0, + "contact_count": 0 + } + } + }, + "schema": { + "properties": { + "billable_count": { + "type": "integer" + }, + "contact_count": { + "type": "integer" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get List Contact Count", + "tags": [ + "Lists" + ], + "x-stoplight": { + "id": "GET_mc-lists-id-contacts-count", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/marketing/segments": { + "get": { + "description": "**This endpoint allows you to retrieve a list of segments.**\n\nThe query param `parent_list_ids` is treated as a filter. Any match will be returned. 0 matches will return a response code of 200 with an empty `results` array.\n\n`parent_list_ids` | `no_parent_list_id` | `result`\n-----------------:|:--------------------:|:-------------\nempty | false | all segments\nvalues | false | segments filtered by list_ids\nvalues | true | segments filtered by list_ids and segments with no parent list_ids\nempty | true | segments with no parent list_ids", + "operationId": "GET_marketing-segments", + "parameters": [ + { + "description": "A comma separated list of list ids to be used when searching for segments with the specified parent_list_id, no more than 50 is allowed", + "in": "query", + "name": "parent_list_ids", + "schema": { + "type": "string" + } + }, + { + "description": "If set to `true` segments with an empty value of `parent_list_id` will be returned in the filter. If the value is not present it defaults to 'false'.", + "in": "query", + "name": "no_parent_list_id", + "schema": { + "default": false, + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "results": [ + { + "contacts_count": 78434802, + "created_at": "2921-01-27T19:33:36.479Z", + "id": "12099613-91e5-4d09-a900-df7626325288", + "sample_updated_at": "4685-11-26T07:05:04.660Z", + "updated_at": "2883-07-10T13:13:37.697Z" + }, + { + "contacts_count": 34177253, + "created_at": "2575-07-26T23:17:20.984Z", + "id": "60c37015-3734-4c8e-b293-68cfa2ae4fa5", + "name": "amet", + "parent_list_id": "fd38af3d-3f69-4947-8dca-5fa967e7be82", + "sample_updated_at": "3074-09-04T09:49:58.127Z", + "updated_at": "5116-10-15T07:37:40.838Z" + } + ] + } + } + }, + "schema": { + "properties": { + "results": { + "items": { + "$ref": "#/components/schemas/segment_summary" + }, + "minItems": 0, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "results" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get List of Segments", + "tags": [ + "segmenting contacts", + "Segmenting Contacts" + ], + "x-stoplight": { + "id": "GET_marketing-segments", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a segment.**", + "operationId": "POST_marketing-segments", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/segment_write_v2" + }, + { + "properties": { + "parent_list_id": { + "description": "The id of the list if this segment is a child of a list. This implies the query is rewritten as `(${query_dsl}) AND CONTAINS(list_ids, ${parent_list_id})`", + "format": "uuid", + "maxLength": 36, + "minLength": 36, + "type": "string" + } + }, + "type": "object" + } + ] + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "contact_summary": { + "address_line_1": "ut sunt Duis eu", + "address_line_2": "in culpa esse non", + "city": "ÔXƫɋƄř", + "contact_id": "1a541ca7-9fef-42c8-8947-f3f8a3b33ffe", + "country": "eiusmod", + "custom_fields": { + "custom_field_name1": "est mollit officia adipisicing dolo", + "custom_field_name2": "dolore cillum" + }, + "first_name": "exercitation Duis nisi", + "last_name": "aut", + "list_ids": [ + "c856a255-12f1-4b55-8564-218fd7eb34a7", + "130c8813-0d6f-4b9e-b154-736bb9db2ff8", + "c245021d-4444-4086-a498-3ffee7fa8cdf" + ], + "postal_code": -88086402, + "primary_email": "D8OsYF5ok@YtX.kcg", + "state_province_region": "consequat culpa in" + }, + "contacts_count": 0, + "contacts_sample": [ + { + "address_line_1": "in occaecat labore est tempor", + "address_line_2": "magna adipisicing", + "alternate_emails": [ + "dTeJZgU5uN9UYSo@nfIB.ijxg" + ], + "city": "ƞó", + "country": "voluptate in in reprehenderit aliquip", + "custom_fields": { + "custom_field_name1": "amet deserunt mollit", + "custom_field_name2": "minim consequat id" + }, + "email": "KLTF@SurgGzlAxCPOqhOUHYNBLsfpfE.trh", + "first_name": "ullamco esse culpa do", + "id": "e70eac25-1431-4231-bccd-1cfab432301e", + "last_name": "officia laboris veniam consequat", + "postal_code": -75218567, + "state_province_region": "culpa ut" + }, + { + "address_line_1": "labore", + "address_line_2": "non", + "alternate_emails": [ + "gQol@Xcfilli.hc", + "n4K7OdaVQh@YfsnF.ie", + "TdnvS3nMStREn@miFjGzNDCPZWhiswJNxrFnOYdUAZEpesQ.yxpu", + "xRzGDTTzzbYK@eJ.wpgb", + "iI1rOpx2ct@aZhuYGZBxJLZ.phr" + ], + "city": "ĔȸąŸÂ¸ȠɏbɄ", + "country": "do", + "custom_fields": { + "custom_field_name1": "amet deserunt mollit", + "custom_field_name2": "minim consequat id" + }, + "email": "t7N5TjDmKhC0@gfdifW.ua", + "first_name": "ea et eu", + "id": "db637d33-bce1-462c-ae9c-91ec4f761de6", + "last_name": "velit Ut laborum ipsu", + "list_ids": [ + "c712288b-2300-4069-bef4-2e05b5948ec3", + "9003ef29-5eb7-4951-898b-1b102e490d6e" + ], + "postal_code": -95171713, + "state_province_region": "deserunt dolore" + } + ], + "created_at": "2921-01-27T19:33:36.479Z", + "id": "864feb2e-5e93-47bf-b63e-21746c988105", + "name": "aute amet deserunt adipisicing", + "next_sample_update": "culpa sit occaecat fugiat quis", + "query_dsl": "email LIKE %twilio.com", + "sample_updated_at": "3407-09-25T04:25:02.140Z", + "updated_at": "4389-06-21T16:59:51.403Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/full-segment" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create Segment", + "tags": [ + "segmenting contacts", + "Segmenting Contacts" + ], + "x-stoplight": { + "id": "POST_marketing-segments", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 201 + }, + "public": true + } + } + }, + "/marketing/segments/2.0": { + "get": { + "description": "The query param `parent_list_ids` is treated as a filter. Any match will be returned. 0 matches will return a response code of 200 with an empty `results` array.\n\n`parent_list_ids` | `no_parent_list_id` | `result`\n-----------------:|:--------------------:|:-------------\nempty | false | all segments\nvalues | false | segments filtered by list_ids\nvalues | true | segments filtered by list_ids and segments with no parent list_ids\nempty | true | segments with no parent list_ids", + "operationId": "GET_segments", + "parameters": [ + { + "description": "A comma separated list up to 50 in size, to filter segments on. Only segments that have any of these list ids as the parent list will be retrieved. This is different from the parameter of the same name used when creating a segment.", + "in": "query", + "name": "parent_list_ids", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "If set to `true` segments with an empty value of `parent_list_id` will be returned in the filter. If the value is not present it defaults to 'false'.", + "in": "query", + "name": "no_parent_list_id", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/all_segments_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + }, + "404": { + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get List of Segments", + "tags": [ + "Segmenting Contacts V2" + ], + "x-stoplight": { + "id": "GET_segments", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "Segment `name` has to be unique. A user can not create a new segment with an existing segment name.", + "operationId": "POST_segments", + "requestBody": { + "$ref": "#/components/requestBodies/segment_write_v2" + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/segment_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + }, + "404": { + "description": "" + }, + "429": { + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create Segment", + "tags": [ + "Segmenting Contacts V2" + ], + "x-stoplight": { + "id": "POST_segments", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/segments/2.0/{segment_id}": { + "delete": { + "description": "**The Segmentation V2 API is currently in private beta. If you'd like to be added to the beta, please fill out this [form](https://docs.google.com/forms/d/e/1FAIpQLSd5zwC9dRk8lAp1oTWjdGc-aSY69flW_7wnutvKBhpUluSnfQ/viewform)**", + "operationId": "DELETE_segments-segment_id", + "responses": { + "202": { + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + }, + "404": { + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete segment", + "tags": [ + "Segmenting Contacts V2 - Beta" + ], + "x-stoplight": { + "id": "DELETE_segments-segment_id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "", + "operationId": "GET_segments-segment_id", + "parameters": [ + { + "description": "Defaults to `true`. Set to `false` to exclude the contacts_sample in the response.", + "in": "query", + "name": "contacts_sample", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/segment_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Segment by ID", + "tags": [ + "Segmenting Contacts V2" + ], + "x-stoplight": { + "id": "GET_segments-segment_id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "segment_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "Segment `name` has to be unique. A user can not create a new segment with an existing segment name.", + "operationId": "PATCH_segments-segment_id", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/segment_update" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/segment_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + }, + "429": { + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors-seg-v2" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Segment", + "tags": [ + "Segmenting Contacts V2" + ], + "x-stoplight": { + "id": "PATCH_segments-segment_id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/segments/delete": { + "post": { + "description": "This endpoint allows you to delete segments in bulk.\n\nIf the segments are used by automations or the segments do not exist in the database, the segment IDs that could not be deleted along with automation IDs that are associated to those segments will be returned.", + "operationId": "POST_marketing-segments-delete", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "ids": [ + "a14dcc63-d651-4c57-9826-4a3705f5c78d", + "f3de551e-dc5c-4d42-bd08-c7f87f87f0e8", + "1b8107b5-adf4-401c-8865-fa84ba178fb9", + "d7900715-c904-4728-acff-9ab79627579e", + "16641f5b-cfa3-41b9-9626-244488ee85b1" + ] + }, + "properties": { + "ids": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error": { + "description": "error message that indicates why segment cannot be deleted (\"in-use\", \"segment not found\", \"invalid uuid\")", + "type": "string" + }, + "id": { + "description": "Segment ID", + "type": "string" + }, + "resources": { + "description": "resources in which segment is being used", + "properties": { + "ids": { + "description": "the resource ids", + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "description": "the type of resource in use (e.g., \"automation\")", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "202": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Bulk Delete Segments", + "tags": [ + "Segmenting Contacts" + ], + "x-stoplight": { + "id": "POST_marketing-segments-delete", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": false + } + } + }, + "/marketing/segments/{segment_id}": { + "delete": { + "description": "**This endpoint allows you to delete a segment by `segment_id`.**\n\nNote that deleting a segment does not delete the contacts associated with the segment by default. Contacts associated with a deleted segment will remain in your list of all contacts and any other segments they belong to.", + "operationId": "DELETE_marketing-segments-segment_id", + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "field" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Segment", + "tags": [ + "segmenting contacts", + "Segmenting Contacts" + ], + "x-stoplight": { + "id": "DELETE_marketing-segments-segmentid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 202 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a single segment by ID.**", + "operationId": "GET_marketing-segments-segment_id", + "parameters": [ + { + "description": "Defaults to `false`. Set to `true` to return the parsed SQL AST as a JSON object in the field `query_json`", + "in": "query", + "name": "query_json", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "contacts_count": -83213117, + "contacts_sample": [ + { + "address_line_1": "in occaecat labore est tempor", + "address_line_2": "magna adipisicing", + "alternate_emails": [ + "dTeJZgU5uN9UYSo@nfIB.ijxg" + ], + "city": "ƞó", + "country": "voluptate in in reprehenderit aliquip", + "custom_fields": { + "custom_field_name1": "amet deserunt mollit", + "custom_field_name2": "minim consequat id" + }, + "email": "KLTF@SurgGzlAxCPOqhOUHYNBLsfpfE.trh", + "first_name": "ullamco esse culpa do", + "id": "e70eac25-1431-4231-bccd-1cfab432301e", + "last_name": "officia laboris veniam consequat", + "postal_code": -75218567, + "state_province_region": "culpa ut" + }, + { + "address_line_1": "labore", + "address_line_2": "non", + "alternate_emails": [ + "gQol@Xcfilli.hc", + "n4K7OdaVQh@YfsnF.ie", + "TdnvS3nMStREn@miFjGzNDCPZWhiswJNxrFnOYdUAZEpesQ.yxpu", + "xRzGDTTzzbYK@eJ.wpgb", + "iI1rOpx2ct@aZhuYGZBxJLZ.phr" + ], + "city": "ĔȸąŸÂ¸ȠɏbɄ", + "country": "do", + "custom_fields": { + "custom_field_name1": "amet deserunt mollit", + "custom_field_name2": "minim consequat id" + }, + "email": "t7N5TjDmKhC0@gfdifW.ua", + "first_name": "ea et eu", + "id": "db637d33-bce1-462c-ae9c-91ec4f761de6", + "last_name": "velit Ut laborum ipsu", + "list_ids": [ + "c712288b-2300-4069-bef4-2e05b5948ec3", + "9003ef29-5eb7-4951-898b-1b102e490d6e" + ], + "postal_code": -95171713, + "state_province_region": "deserunt dolore" + } + ], + "created_at": "2921-01-27T19:33:36.479Z", + "id": "3b049926-0a54-4a91-83f0-086ace63c530", + "name": "enim et anim", + "query_dsl": "nostrud", + "sample_updated_at": "3407-09-25T04:25:02.140Z", + "updated_at": "4389-06-21T16:59:51.403Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/full-segment" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "field" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Segment by ID", + "tags": [ + "segmenting contacts", + "Segmenting Contacts" + ], + "x-stoplight": { + "id": "GET_marketing-segments-segmentid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "segment_id", + "required": true, + "schema": { + "format": "uuid", + "maxLength": 36, + "minLength": 36, + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update a segment.**\n\nSegment `name` needs to be unique. A user can not update a segment name to an existing one.", + "operationId": "PATCH_marketing-segments-segment_id", + "requestBody": { + "$ref": "#/components/requestBodies/segment_write_v2" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "contacts_count": -35493018, + "contacts_sample": [ + { + "address_line_1": "deserunt cillum aliqua nostrud ullamco", + "address_line_2": "sint", + "alternate_emails": [ + "qXP-RD97fLl@oEDaUynqnNRHJHdoJAWVGXwvI.qlv", + "W0ngFWmR@WcQuSbPFVPZvLrjCFadfimFi.eqf", + "mYBC0ea5UxFI@qwO.jh", + "Nhf1OmY@KCSjTQsXYpbKrBUsQFHrnLuY.oef" + ], + "city": "ŷ(ç", + "country": "consectetur quis voluptate", + "custom_fields": { + "custom_field_name1": "dolor aute irure Excepteur" + }, + "email": "exmS@KIzibBSmaUUHQa.uvv", + "first_name": "consequat nulla in", + "id": "4cff9fdf-1bee-44f7-95dc-a101f9ed3cfe", + "last_name": "irure nostrud elit eu", + "list_ids": [ + "f9d5987d-7a01-4a66-b77e-1f08a392304b", + "b4e3b028-01d4-428b-9ef5-24bcd90fa02c", + "fedab84f-9aa5-449d-99e2-7b1361f8ee61" + ], + "postal_code": 62721676, + "state_province_region": "minim" + }, + { + "address_line_1": "culpa eu eiusmod sint", + "address_line_2": "sed velit sint", + "alternate_emails": [ + "Zs6vnQbMU@XTamDsXEGJWBMMEacOc.hitv", + "Epl@ySBrQCFJZnjggkAYLu.ppta" + ], + "city": "BĊJ", + "country": "in laboris Excepteur consequat", + "custom_fields": { + "custom_field_name1": "esse magna Ut", + "custom_field_name2": "culpa Excepteur" + }, + "email": "atNeYGC4nbF42@VOCUWuGaYr.ystm", + "first_name": "est", + "id": "093a66b8-bca8-4d8a-b32a-091d939c1928", + "last_name": "in", + "postal_code": 33736880, + "state_province_region": "Lorem Ut aliqua elit" + }, + { + "address_line_1": "occaecat aute enim", + "address_line_2": "ipsum quis in", + "alternate_emails": [ + "S8u@ZVGjHsXdSWtlhhad.ximc", + "GA1MN72v3uA@MPDvMUmTYjwFCsEaGnFnvVzJVqUTl.ehws" + ], + "city": "ɌſĕĝȤ¶Ǖ", + "country": "occaecat veniam", + "custom_fields": { + "custom_field_name1": "dolor aute irure Excepteur" + }, + "email": "Jx660QHClqRrC@SavQvcdRpJlLqepwoEUCm.ar", + "first_name": "sed eu veli", + "id": "08939f9c-2c87-4639-bd07-16d41f90a5eb", + "last_name": "aliqua sit culpa", + "postal_code": -66445052, + "state_province_region": "ut nisi sed esse" + }, + { + "address_line_1": "et incididunt", + "address_line_2": "veniam quis non exercitation Duis", + "alternate_emails": [ + "F5WhHCA3oL6Ix@wOKzwIsvHbFi.mrlc" + ], + "city": "DzƐȹŲdž", + "country": "reprehenderit", + "custom_fields": { + "custom_field_name1": "dolor aute irure Excepteur" + }, + "email": "AnoFtJq@IolRDmfj.njt", + "first_name": "do mollit velit", + "id": "0667ed97-7b7b-44aa-a115-0301067660d7", + "last_name": "voluptate dolor", + "list_ids": [ + "ffd225a8-2008-4457-87af-1cffff5b1ccb" + ], + "postal_code": -19694583, + "state_province_region": "occaecat" + }, + { + "address_line_1": "dolor", + "address_line_2": "elit ex labore sunt aliquip", + "alternate_emails": [ + "ksqbx6BInlB@ouWBjjxwFBwVQjdnEKXy.xi", + "TAe7F2m8dFlF@SirYykzbe.aj", + "T9c2Y@HjVQY.zz", + "p7ShfET@vMMnTUqoqngPSEqbpyoeWN.jlqn", + "0VJSIhIUT2k@mJXVtdZVKKswW.xoca" + ], + "city": "ÝǘźƝǝƉ‘Ɲ", + "country": "id sunt nisi", + "custom_fields": { + "custom_field_name1": "amet", + "custom_field_name2": "enim quis" + }, + "email": "kF4@gYYdAxzetJrWszLAHuBUTu.rzq", + "first_name": "irure laboris minim", + "id": "449767ca-d446-45f1-aa9b-432f441b5ca1", + "last_name": "id nostrud aliqua sit", + "list_ids": [ + "2870627c-b9ea-4dcf-bde0-36c3e0e3eca9", + "575d86aa-4dcc-4b7d-b7de-ded856913198", + "fb82a17f-5777-439d-9b8c-2c565c8ddf20" + ], + "postal_code": 60466925, + "state_province_region": "nostrud Duis non nulla laborum" + } + ], + "created_at": "2014-12-23T17:18:52.907Z", + "id": "5fff6250-b766-4959-a183-2e1fa565c4ce", + "name": "List Name", + "query_dsl": "Email LIKE %twilio.com", + "sample_updated_at": "2146-04-13T16:46:32.328Z", + "updated_at": "4389-06-21T16:59:51.403Z" + } + } + }, + "schema": { + "$ref": "#/components/schemas/full-segment" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "field" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Segment", + "tags": [ + "segmenting contacts", + "Segmenting Contacts" + ], + "x-stoplight": { + "id": "PATCH_marketing-segments-segmentid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/senders": { + "post": { + "description": "**This endpoint allows you to create a new sender identity.**\n\n*You may create up to 100 unique sender identities.*\n\nSender identities are required to be verified before use. If your domain has been authenticated, a new sender identity will auto verify on creation. Otherwise an email will be sent to the `from.email`.", + "operationId": "POST_marketing-senders", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "address": "1234 Fake St.", + "address_2": "", + "city": "San Francisco", + "country": "United States", + "from": { + "email": "orders@example.com", + "name": "Example Orders" + }, + "nickname": "Example Orders", + "reply_to": { + "email": "support@example.com", + "name": "Example Support" + }, + "state": "CA", + "zip": "94105" + }, + "properties": { + "address": { + "description": "The physical address of the sender identity.", + "type": "string" + }, + "address_2": { + "description": "Additional sender identity address information.", + "type": "string" + }, + "city": { + "description": "The city of the sender identity.", + "type": "string" + }, + "country": { + "description": "The country of the sender identity.", + "type": "string" + }, + "from": { + "properties": { + "email": { + "description": "This is where the email will appear to originate from for your recipient", + "type": "string" + }, + "name": { + "description": "This is the name appended to the from email field. IE - Your name or company name.", + "type": "string" + } + }, + "required": [ + "email", + "name" + ], + "type": "object" + }, + "nickname": { + "description": "A nickname for the sender identity. Not used for sending.", + "type": "string" + }, + "reply_to": { + "properties": { + "email": { + "description": "This is the email that your recipient will reply to.", + "type": "string" + }, + "name": { + "description": "This is the name appended to the reply to email field. IE - Your name or company name.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + }, + "state": { + "description": "The state of the sender identity.", + "type": "string" + }, + "zip": { + "description": "The zipcode of the sender identity.", + "type": "string" + } + }, + "required": [ + "nickname", + "from", + "address", + "city", + "country" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/senderID" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Sender Identity", + "tags": [ + "Senders" + ], + "x-stoplight": { + "id": "POST_marketing-senders", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/singlesends": { + "delete": { + "description": "**This endpoint allows you to delete multiple Single Sends using an array of Single Sends IDs.**\n\nTo first retrieve all your Single Sends' IDs, you can make a GET request to the `/marketing/singlensends` endpoint.\n\nPlease note that a DELETE request is permanent, and your Single Sends will not be recoverable after deletion.", + "operationId": "DELETE_marketing-singlesends", + "parameters": [ + { + "description": "Single Send IDs to delete", + "explode": false, + "in": "query", + "name": "ids", + "schema": { + "items": { + "type": "string" + }, + "maxItems": 50, + "minItems": 1, + "type": "array" + }, + "style": "form" + } + ], + "responses": { + "204": { + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Bulk Delete Single Sends", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "DELETE_marketing-singlesends", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve all your Single Sends.**\n\nReturns all of your Single Sends with condensed details about each, including the Single Sends' IDs. For more details about an individual Single Send, pass the Single Send's ID to the `/marketing/singlesends/{id}` endpoint.", + "operationId": "GET_marketing-singlesends", + "parameters": [ + { + "in": "query", + "name": "page_size", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "page_token", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + }, + "result": { + "items": { + "$ref": "#/components/schemas/singlesend_response_short" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get All Single Sends", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "GET_marketing-singlesends", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new Single Send.**\n\nPlease note that if you are migrating from the previous version of Single Sends, you no longer need to pass a template ID with your request to this endpoint. Instead, you will pass all template data in the `email_config` object.", + "operationId": "POST_marketing-singlesends", + "requestBody": { + "$ref": "#/components/requestBodies/singlesend_request" + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [ + "unique opens" + ], + "created_at": "2020-05-18T17:28:27.272Z", + "email_config": { + "custom_unsubscribe_url": null, + "editor": "code", + "generate_plain_content": true, + "html_content": "", + "ip_pool": null, + "plain_content": "", + "sender_id": null, + "subject": "", + "suppression_group_id": null + }, + "id": "27c21bbf-a12c-440b-b8bf-c526975328ca", + "name": "Example API Created Single Send", + "send_at": "2020-06-16T00:19:55.106Z", + "send_to": { + "list_ids": [ + "f2fe66a1-43f3-4e3a-87b1-c6a600d805f0" + ] + }, + "status": "scheduled" + } + } + }, + "schema": { + "$ref": "#/components/schemas/singlesend_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create Single Send", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "POST_marketing-singlesends", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/singlesends/categories": { + "get": { + "description": "**This endpoint allows you to retrieve all the categories associated with your Single Sends.**\n\nThis endpoint will return your latest 1,000 categories.", + "operationId": "GET_marketing-singlesends-categories", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "categories": [ + "equipment", + "shoes", + "sports" + ] + } + } + }, + "schema": { + "properties": { + "categories": { + "description": "list of latest one thousand unique categories associated with all Single Sends in ascending order", + "items": { + "type": "string" + }, + "maxItems": 1000, + "type": "array", + "uniqueItems": true + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get All Categories", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "GET_marketing-singlesends-categories", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/singlesends/search": { + "post": { + "description": "**This endpoint allows you to search for Single Sends based on specified criteria.**\n\nYou can search for Single Sends by passing a combination of values using the `name`, `status`, and `categories` request body fields.\n\nFor example, if you want to search for all Single Sends that are \"drafts\" or \"scheduled\" and also associated with the category \"shoes,\" your request body may look like the example below.\n\n```javascript\n{\n \"status\": [\n \"draft\",\n \"scheduled\"\n ],\n \"categories\": [\n \"shoes\"\n ],\n}\n```", + "operationId": "POST_marketing-singlesends-search", + "parameters": [ + { + "in": "query", + "name": "page_size", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "page_token", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/singlesend_search" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "count": 1, + "next": "https://a/DYEsTUDww9-", + "prev": "https://a/P0Enoayd", + "self": "https://a/nwNSrPSWt7d" + }, + "result": [ + { + "abtest": null, + "categories": [ + "shoes" + ], + "created_at": "4739-10-29T07:11:32.476Z", + "id": "df25ffdf-6a96-458a-9419-6d87d3094c6b", + "is_abtest": true, + "name": "single-send-1", + "send_at": "2471-05-31T15:46:18.797Z", + "status": "triggered", + "updated_at": "3263-04-09T09:05:08.193Z" + } + ] + } + } + }, + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + }, + "result": { + "items": { + "$ref": "#/components/schemas/singlesend_response_short" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Single Sends Search", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "POST_marketing-singlesends-search", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/singlesends/{id}": { + "delete": { + "description": "**This endpoint allows you to delete one Single Send using a Single Send ID.**\n\nTo first retrieve all your Single Sends' IDs, you can make a GET request to the `/marketing/singlensends` endpoint.\n\nPlease note that a `DELETE` request is permanent, and your Single Send will not be recoverable after deletion.", + "operationId": "DELETE_marketing-singlesends-id", + "responses": { + "204": { + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Single Send by ID", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "DELETE_marketing-singlesends-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve details about one Single Send using a Single Send ID.**\n\nYou can retrieve all of your Single Sends by making a GET request to the `/marketing/singlesends` endpoint.", + "operationId": "GET_marketing-singlesends-id", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "created_at": "2020-12-13T16:24:42.013Z", + "id": "2f6dec81-43b9-4c67-a890-3a38cb63b54a", + "name": "single-send-1", + "send_to": { + "all": true, + "segment_ids": [ + "dad84de3-bec4-4e04-b132-2cbfd4bb3789", + "7dce758d-1155-4102-88d2-ca65565ac98b" + ] + }, + "status": "scheduled" + } + } + }, + "schema": { + "$ref": "#/components/schemas/singlesend_response" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Single Send by ID", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "GET_marketing-singlesends-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update a Single Send using a Single Send ID.**\n\nYou only need to pass the fields you want to update. Any blank/missing fields will remain unaltered.", + "operationId": "PATCH_marketing-singlesends-id", + "requestBody": { + "$ref": "#/components/requestBodies/singlesend_request" + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/singlesend_response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Single Send", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "PATCH_marketing-singlesends-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to duplicate an existing Single Send using its Single Send ID.**\n\nDuplicating a Single Send is useful when you want to create a Single Send but don't want to start from scratch. Once duplicated, you can update or edit the Single Send by making a PATCH request to the `/marketing/singlesends/{id}` endpoint.\n \nIf you leave the `name` field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text “Copy of ” prepended to it. The `name` field length is limited to 100 characters, so the end of the new Single Send name, including “Copy of ”, will be trimmed if the name exceeds this limit.", + "operationId": "POST_marketing-singlesends-id", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "The name of the duplicate Single Send. If you choose to leave the name field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text 'Copy of ' prepended to it. The end of the new Single Send name, including 'Copy of ', will be trimmed if the name exceeds the character limit.", + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/singlesend_response" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Duplicate Single Send", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "POST_marketing-singlesends-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/singlesends/{id}/schedule": { + "delete": { + "description": "**This endpoint allows you to cancel a scheduled Single Send using a Single Send ID.**\n\nMaking a DELETE request to this endpoint will cancel the scheduled sending of a Single Send. The request will not delete the Single Send itself. Deleting a Single Send can be done by passing a DELETE request to `/marketing/singlesends/{id}`.", + "operationId": "DELETE_marketing-singlesends-id-schedule", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/singlesend_schedule" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Single Send Schedule", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "DELETE_marketing-singlesends-id-schedule", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "put": { + "description": "**This endpoint allows you to schedule a Single Send for future delivery using a Single Send ID.**\n\nTo schedule a Single Send, you must pass a date string in ISO 8601 time format (yyyy-MM-ddTHH:mm:ssZ) using the required `send_at` field. For example, the ISO 8601 format for 9:00 AM UTC on May 6, 2020 would be `2020-05-06T09:00:00Z`. You may also pass the string `\"now\"` to send the Single Send immediately.", + "operationId": "PUT_marketing-singlesends-id-schedule", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "send_at": "3752-01-28T23:21:52.575Z" + }, + "properties": { + "send_at": { + "description": "This is the ISO 8601 time at which to send the Single Send; must be in future, or the string \"now\"", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "send_at" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "send_at": "3752-01-28T23:21:52.575Z", + "status": "scheduled" + } + } + }, + "schema": { + "properties": { + "send_at": { + "description": "", + "format": "date-time", + "type": "string" + }, + "status": { + "enum": [ + "scheduled" + ], + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Schedule Single Send", + "tags": [ + "Single Sends" + ], + "x-stoplight": { + "id": "PUT_marketing-singlesends-id-schedule", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/stats/automations": { + "get": { + "description": "**This endpoint allows you to retrieve stats for all your Automations.**\n\nBy default, all of your Automations will be returned, but you can specify a selection by passing in a comma-separated list of Automation IDs as the value of the query string parameter `automation_ids`.\n\nResponses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 50, but you specify a value between 1 and 100.\n\nYou can retrieve a specific page of responses with the `page_token` query string parameter.", + "operationId": "getall-automation-stats", + "parameters": [ + { + "description": "This endpoint returns all automation IDs if no `automation_ids` are specified.", + "explode": false, + "in": "query", + "name": "automation_ids", + "schema": { + "items": { + "type": "string" + }, + "maxItems": 25, + "minItems": 1, + "type": "array" + }, + "style": "form" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_size" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_token" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/automations-response" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get All Automation Stats", + "tags": [ + "Marketing Campaigns Stats" + ], + "x-stoplight": { + "id": "getall-automation-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/stats/automations/export": { + "get": { + "description": "**This endpoint allows you to export Automation stats as CSV data**.\n\nYou can specify one Automation or many: include as many Automation IDs as you need, separating them with commas, as the value of the `ids` query string paramter.\n\nThe data is returned as plain text response but in CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a `.csv` file.", + "operationId": "get-automations-stats-export", + "parameters": [ + { + "description": "The IDs of Automations for which to export stats.", + "explode": false, + "in": "query", + "name": "ids", + "schema": { + "items": { + "type": "string" + }, + "maxItems": 50, + "minItems": 1, + "type": "array" + }, + "style": "form" + }, + { + "description": "The [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones) string representing the timezone in which the stats are to be presented; i.e. `\"America/Chicago\"`. This parameter changes the timezone format only; it does not alter which stats are returned.", + "in": "query", + "name": "timezone", + "schema": { + "default": "UTC", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "CSV data", + "type": "string" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Export Automation Stats", + "tags": [ + "Marketing Campaigns Stats" + ], + "x-stoplight": { + "id": "get-automations-stats-export", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/stats/automations/{id}": { + "get": { + "description": "**This endpoint allows you to retrieve stats for a single Automation using its ID.**\n\nMultiple Automation IDs can be retrieved using the \"Get All Automation Stats\" endpoint. Once you have an ID, this endpoint will return detailed stats for the single automation specified.\n\nYou may constrain the stats returned using the `start_date` and `end_date` query string parameters. You can also use the `group_by` and `aggregated_by` query string parameters to further refine the stats returned.", + "operationId": "get-automation-stat", + "parameters": [ + { + "$ref": "#/components/parameters/trait_automationQueryParams_group_by" + }, + { + "$ref": "#/components/parameters/trait_automationQueryParams_step_ids" + }, + { + "$ref": "#/components/parameters/trait_baseParams_aggregated_by" + }, + { + "$ref": "#/components/parameters/trait_baseParams_start_date" + }, + { + "$ref": "#/components/parameters/trait_baseParams_end_date" + }, + { + "$ref": "#/components/parameters/trait_baseParams_timezone" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_size" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_token" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/automations-response" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_errorResponse_400" + }, + "404": { + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Automation Stats by ID", + "tags": [ + "Marketing Campaigns Stats" + ], + "x-stoplight": { + "id": "get-automation-stat", + "mock": { + "dynamic": false, + "enabled": true, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/marketing/stats/automations/{id}/links": { + "get": { + "description": "**This endpoint lets you retrieve click-tracking stats for a single Automation**.\n\nThe stats returned list the URLs embedded in your Automation and the number of clicks each one received.\n\nResponses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 50, but you specify a value between 1 and 100.\n\nYou can retrieve a specific page of responses with the `page_token` query string parameter.", + "operationId": "get-automation-link-stat", + "parameters": [ + { + "$ref": "#/components/parameters/trait_automationQueryParams_group_by" + }, + { + "$ref": "#/components/parameters/trait_automationQueryParams_step_ids" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_size" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_token" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/automations-link-stats-response" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_errorResponse_400" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Automation Click Tracking Stats by ID", + "tags": [ + "Marketing Campaigns Stats" + ], + "x-stoplight": { + "id": "get-automation-link-stat", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the Automation you want to get click tracking stats for. ", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ] + }, + "/marketing/stats/singlesends": { + "get": { + "description": "**This endpoint allows you to retrieve stats for all your Single Sends.**\n\nBy default, all of your Single Sends will be returned, but you can specify a selection by passing in a comma-separated list of Single Send IDs as the value of the query string parameter `singlesend_ids`.\n\nResponses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 50, but you specify a value between 1 and 100.\n\nYou can retrieve a specific page of responses with the `page_token` query string parameter.", + "operationId": "getall-singlesend-stats", + "parameters": [ + { + "description": "This endpoint returns all Single Send IDs if no IDs are included in `singlesend_ids`.", + "explode": false, + "in": "query", + "name": "singlesend_ids", + "schema": { + "items": { + "type": "string" + }, + "maxItems": 25, + "minItems": 1, + "type": "array" + }, + "style": "form" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_size" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_token" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/singlesends-response" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_errorResponse_400" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get All Single Sends Stats", + "tags": [ + "Marketing Campaigns Stats" + ], + "x-stoplight": { + "id": "getall-singlesend-stats", + "mock": { + "dynamic": false, + "enabled": true, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/stats/singlesends/export": { + "get": { + "description": "**This endpoint allows you to export Single Send stats as .CSV data**.\n\nYou can specify one Single Send or many: include as many Single Send IDs as you need, separating them with commas, as the value of the `ids` query string paramter.\n\nThe data is returned as plain text response but in .CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a .csv file.", + "operationId": "get-singlesend-stats-export", + "parameters": [ + { + "description": "The IDs of Single Sends for which to export stats.", + "explode": false, + "in": "query", + "name": "ids", + "schema": { + "items": { + "type": "string" + }, + "maxItems": 50, + "minItems": 1, + "type": "array" + }, + "style": "form" + }, + { + "description": "The [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones) string representing the timezone in which the stats are to be presented; i.e. `\"America/Chicago\"`. This parameter changes the timezone format only; it does not alter which stats are returned.", + "in": "query", + "name": "timezone", + "schema": { + "default": "UTC", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "CSV data", + "type": "string" + } + } + }, + "description": "" + }, + "400": { + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Export Single Send Stats", + "tags": [ + "Marketing Campaigns Stats" + ], + "x-stoplight": { + "id": "get-singlesend-stats-export", + "mock": { + "dynamic": false, + "enabled": true, + "statusCode": 200 + }, + "public": true + } + } + }, + "/marketing/stats/singlesends/{id}": { + "get": { + "description": "**This endpoint allows you to retrieve stats for an individual Single Send using a Single Send ID.**\n\nMultiple Single Send IDs can be retrieved using the \"Get All Single Sends Stats\" endpoint. Once you have an ID, this endpoint will return detailed stats for the Single Send specified.\n\nYou may constrain the stats returned using the `start_date` and `end_date` query string parameters. You can also use the `group_by` and `aggregated_by` query string parameters to further refine the stats returned.", + "operationId": "get-singlesend-stat", + "parameters": [ + { + "$ref": "#/components/parameters/trait_baseParams_aggregated_by" + }, + { + "$ref": "#/components/parameters/trait_baseParams_start_date" + }, + { + "$ref": "#/components/parameters/trait_baseParams_end_date" + }, + { + "$ref": "#/components/parameters/trait_baseParams_timezone" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_size" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_token" + }, + { + "$ref": "#/components/parameters/trait_singlesendQueryParams_group_by" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/singlesends-response" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_errorResponse_400" + }, + "404": { + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Single Send Stats by ID", + "tags": [ + "Marketing Campaigns Stats" + ], + "x-stoplight": { + "id": "get-singlesend-stat", + "mock": { + "dynamic": false, + "enabled": true, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/marketing/stats/singlesends/{id}/links": { + "get": { + "description": "**This endpoint lets you retrieve click-tracking stats for one Single Send**.\n\nThe stats returned list the URLs embedded in the specified Single Send and the number of clicks each one received.\n\nResponses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 50, but you specify a value between 1 and 100.\n\nYou can retrieve a specific page of responses with the `page_token` query string parameter.", + "operationId": "get-singlesend-link-stat", + "parameters": [ + { + "$ref": "#/components/parameters/trait_pagination_page_size" + }, + { + "$ref": "#/components/parameters/trait_pagination_page_token" + }, + { + "$ref": "#/components/parameters/trait_singlesendQueryParams2_group_by" + }, + { + "$ref": "#/components/parameters/trait_singlesendQueryParams2_ab_variation_id" + }, + { + "$ref": "#/components/parameters/trait_singlesendQueryParams2_ab_phase_id" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/singlesends-link-stats-response" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_errorResponse_400" + }, + "404": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Single Send Click Tracking Stats by ID", + "tags": [ + "Marketing Campaigns Stats" + ], + "x-stoplight": { + "id": "get-singlesend-link-stat", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/marketing/test/send_email": { + "post": { + "description": "**This endpoint allows you to send a test marketing email to a list of email addresses**.\n\nBefore sending a marketing message, you can test it using this endpoint. You may specify up to **10 contacts** in the `emails` request body field. You must also specify a `template_id` and include either a `from_address` or `sender_id`. You can manage your templates with the [Twilio SendGrid App](https://mc.sendgrid.com/dynamic-templates) or the [Transactional Templates API](https://sendgrid.api-docs.io/v3.0/transactional-templates).\n\n> Please note that this endpoint works with Dynamic Transactional Templates only. Legacy Transactional Templates will not be delivered.\n\nFor more information about managing Dynamic Transactional Templates, see [How to Send Email with Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/).\n\nYou can also test your Single Sends in the [Twilio SendGrid Marketing Campaigns UI](https://mc.sendgrid.com/single-sends).", + "operationId": "POST_marketing-test-send_email", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "custom_unsubscribe_url": "https://example.com/unsubscribe", + "emails": [ + "janedoe@example.com", + "tiramisu@example.com", + "bundt@example.com" + ], + "sender_id": 6060664, + "suppression_group_id": 21865513, + "template_id": "f8f77db8-b9fa-4b3c-9ee8-de3d582016b8", + "version_id_override": "7734f757-8eb8-4d22-b7f0-779a72f32986" + }, + "properties": { + "custom_unsubscribe_url": { + "description": "A custom unsubscribe URL.", + "type": "string" + }, + "emails": { + "description": "An array of email addresses you want to send the test message to.", + "items": { + "format": "email", + "type": "string" + }, + "maxItems": 10, + "minItems": 1, + "type": "array", + "uniqueItems": true + }, + "from_address": { + "description": "You can either specify this address or specify a verified sender ID.", + "format": "email", + "type": "string" + }, + "sender_id": { + "description": "This ID must belong to a verified sender. Alternatively, you may supply a `from_address` email.", + "type": "integer" + }, + "suppression_group_id": { + "type": "integer" + }, + "template_id": { + "description": "The ID of the template that you would like to use. If you use a template that contains a subject and content (either text or HTML), then those values specified at the personalizations or message level will not be used.", + "format": "uuid", + "type": "string" + }, + "version_id_override": { + "description": " You can override the active template with an alternative template version by passing the version ID in this field. If this field is blank, the active template version will be used.", + "format": "uuid", + "type": "string" + } + }, + "required": [ + "template_id", + "emails" + ], + "type": "object" + } + } + } + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_errorResponse_400" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Send a Test Marketing Email", + "tags": [ + "Send Test Email" + ], + "x-stoplight": { + "id": "POST_marketing-test-sendemail", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/messages": { + "get": { + "description": "This is **BETA** functionality. You may not have access, and we reserve the right to change functionality without notice.\n\nFilter all messages to search your Email Activity. All queries need to be [URL encoded](https://meyerweb.com/eric/tools/dencoder/), and have this format:\n\n`query={query_type}=\"{query_content}\"`\n\nencoded, this would look like this:\n\n`query=type%3D%22query_content%22`\n\nfor example:\n\nFilter by a specific email - `query=to_email%3D%22example%40example.com%22`\n\nFilter by subject line - `query=subject%3d%22A%20Great%20Subject%22`\n\n**Full list of basic query types and examples:**\n\n\n| **Filter query** | **Unencoded Example** (put this one into the try it out query - it'll automatically encode it for you) | **Encoded Example** (use this one in your code) |\n|-----------------|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|\n| msg_id | msg_id=“filter0307p1las1-16816-5A023E36-1.0” | msg_id%3D%22filter0307p1las1-16816-5A023E36-1.0%22 |\n| from_email | from_email=“testing@sendgrid.net” | from_email%3D%22testing%40sendgrid.net%22 |\n| subject | subject=\"This is a subject test\" | subject%22This%20is%20a%20subject%20test%22 |\n| to_email | to_email=\"example@example.com\" | to_email%3D%22example%40example.com%22 |\n| status | | status%22processed%22 |\n| template_id | | |\n| asm_group_id | | |\n| api_key_id | | |\n| events | status=\"processed\" | status%3D%22processed%22 |\n| originating_ip | | |\n| categories | | |\n| unique_args | | |\n| outbound_ip | | |\n| last_event_time | last_event_time=“2017-11-07T23:13:58Z” | last_event_time%3D%E2%80%9C2017-11-07T23%3A13%3A58Z%E2%80%9D |\n| clicks | clicks=\"0\" | clicks%3D%220%22 |\n\nFor information about building compound queries, and for the full query language functionality, see the [query language reference](https://docs.google.com/a/sendgrid.com/document/d/1fWoKTFNfg5UUsB6t9KuIcSo9CetKF_T0bGfWJ_gdPCs/edit?usp=sharing).\n\nComing soon, example compound queries: limit + to email + date", + "operationId": "GET-messages", + "parameters": [ + { + "description": "Use the query syntax to filter your email activity.", + "in": "query", + "name": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The number of messages returned. This parameter must be greater than 0 and less than or equal to 1000", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 10, + "maximum": 1000, + "minimum": 1, + "type": "number" + } + }, + { + "in": "header", + "name": "X-Query-Id", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Cursor", + "required": false, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_authorizationHeader_Authorization" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "messages": [ + { + "clicks_count": 0, + "from_email": "from@test.com", + "last_event_time": "2017-10-13T18:56:21Z", + "last_timestamp": 1495064728, + "msg_id": "abc123", + "opens_count": 0, + "status": "processed", + "subject": "something profound", + "to_email": "to@test.com" + }, + { + "clicks_count": 200, + "from_email": "yeah@test.com", + "last_event_time": "2017-10-13T18:56:21Z", + "last_timestamp": 1495064793, + "msg_id": "321befe", + "opens_count": 500, + "status": "delivered", + "subject": "something profound", + "to_email": "nah@test.com" + }, + { + "clicks_count": 0, + "from_email": "sad@test.com", + "last_event_time": "2017-10-13T18:56:21Z", + "last_timestamp": 1495064993, + "msg_id": "434512dfg", + "opens_count": 0, + "status": "not_delivered", + "subject": "something sad", + "to_email": "reject@test.com" + } + ] + } + } + }, + "schema": { + "properties": { + "messages": { + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/email-activity-response-common-fields" + }, + { + "properties": { + "clicks_count": { + "description": "The number of times links in the message were clicked.", + "type": "integer" + }, + "last_event_time": { + "description": "A timestamp of the last event received for the specific message in iso 8601 format.", + "type": "string" + }, + "opens_count": { + "description": "The number of times the message was opened.", + "type": "integer" + } + }, + "type": "object" + } + ], + "example": { + "clicks_count": 2, + "from_email": "from@test.com", + "last_event_time": "2017-10-13T18:56:21Z", + "msg_id": "abc123", + "opens_count": 1, + "status": "processed", + "subject": "anim Duis sint veniam", + "to_email": "test@test.com" + }, + "properties": { + "clicks_count": { + "type": "integer" + }, + "from_email": { + "type": "string" + }, + "last_event_time": { + "description": "iso 8601 format", + "type": "string" + }, + "msg_id": { + "type": "string" + }, + "opens_count": { + "type": "integer" + }, + "status": { + "enum": [ + "processed", + "delivered", + "not_delivered" + ], + "type": "string" + }, + "subject": { + "type": "string" + }, + "to_email": { + "type": "string" + } + }, + "required": [ + "from_email", + "msg_id", + "subject", + "to_email", + "status", + "opens_count", + "clicks_count", + "last_event_time" + ], + "title": "Abbv. Message", + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "invalid syntax: 'bad_field' is not a known field" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "429": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "too many requests" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Filter all messages", + "tags": [ + "Query", + "Messages" + ], + "x-stoplight": { + "id": "GET-messages", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/messages/download": { + "post": { + "description": "This is BETA functionality. You may not have access, and we reserve the right to change functionality without notice.\n\nThis request will kick off a backend process to generate a CSV file. Once generated, the worker will then send an email for the user download the file. The link will expire in 3 days.\n\nThe CSV fill contain the last 1 million messages. This endpoint will be rate limited to 1 request every 12 hours (rate limit may change).\n\nThis endpoint is similar to the GET Single Message endpoint - the only difference is that /download is added to indicate that this is a CSV download requests but the same query is used to determine what the CSV should contain.", + "operationId": "POST_v3-messages-download", + "parameters": [ + { + "description": "Uses a SQL like syntax to indicate which messages to include in the CSV", + "in": "query", + "name": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_authorizationHeader_Authorization" + } + ], + "responses": { + "202": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "message": "An email will be sent to jane_doe@example.com when the CSV is ready to download.", + "status": "pending" + } + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + }, + "status": { + "enum": [ + "pending" + ], + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "some error" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "429": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "", + "message": "too many requests" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "internal server error" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Request CSV", + "tags": [ + "CSV (UI only)", + "V3" + ], + "x-stoplight": { + "id": "POST_v3-messages-download", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/messages/download/{download_uuid}": { + "get": { + "description": "**This endpoint will return a presigned URL that can be used to download the CSV that was requested from the \"Request a CSV\" endpoint.**", + "operationId": "GET_v3-messages-download-download_uuid", + "parameters": [ + { + "$ref": "#/components/parameters/trait_authorizationHeader_Authorization" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "csv": "https://s3-us-west-2.amazonaws.com/sendgrid-rts-development-queries/013c31af-7c9a-49e6-922c-d990f4aff151.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Credential=AKIAI4NOW7APZHRFYGWQ%2F20170728%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Date=20170728T223936Z&X-Amz-Signature=5c13ede58b211799ab1a556280bd316c404eac3aef1450c47906a077166c4ab4", + "presigned_url": "https://example.com" + } + } + }, + "schema": { + "properties": { + "csv": { + "description": "Returns the aws signed link to the csv file which mako UI should perform a get on to trigger the csv download for the user", + "minLength": 5, + "pattern": "^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$", + "type": "string" + }, + "presigned_url": { + "description": "A signed link that will allow you to download the CSV file requested by the Request a CSV endpoint.", + "format": "uri", + "type": "string" + } + }, + "required": [ + "csv" + ], + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "", + "message": "download token is invalid or expired" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "internal server error" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Download CSV", + "tags": [ + "CSV (UI only)", + "V3" + ], + "x-stoplight": { + "id": "GET_v3-messages-download-download_uuid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "UUID used to locate the download csv request entry in the DB.\n\nThis is the UUID provided in the email sent to the user when their csv file is ready to download", + "in": "path", + "name": "download_uuid", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ] + }, + "/messages/{msg_id}": { + "get": { + "description": "This is BETA functionality. You may not have access, and we reserve the right to change functionality without notice.\n\nGet all of the details about the specified message.", + "operationId": "GET-v3-messages-msg_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_authorizationHeader_Authorization" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "api_key_id": "bUshz3LGa3coToxA2sWViYAEJJmYZJRyY9BCQY", + "asm_group_id": 5464443, + "categories": [ + "dolor", + "pie" + ], + "events": [ + { + "attempt_num": 8, + "bounce_type": "soft", + "event_name": "unsubscribe", + "http_user_agent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0", + "mx_server": "s", + "processed": "2017-10-13T18:56:21Z", + "url": "G_3c-1HtUkN4`puC&&!u>0OiStFG.ZoRi2=j%fUVa]&re6k{hKqD-8vWE12Fb5JC6z>S@@'cWS~w5KtuIwv$8/JDD94CXx1n5yjC_I2lQ66zDj4MXe/4bqlcqqQ7evnQWTYx5roaEYMapyuzb/USpsyalh/HcYc9PmQfF8ND_C7bXnwFQ_fb_BHMXbIV8JN28/NjZdawDJ6kSWxLykSVTHzcISGPBRfs_rt3Uc65Vzj6LDSSMN8WRs70m0tAWs/fkDvjvm_7ZeV08YZeB9j9mS9BcE089Fn5UzDlTJW9vqDF5uipjlIVrNbM7oWE/MIJcjg2vJO20jA24WHrchrEXCvKcxriviSDl3tuyDxqdqRSekpm2aH6yW7_ylXj/nWsex4jm3rKvYw1uLq3Tp7qb9edhj8B_TnwLv1yjHSkgbA5jKI4BTqxugmwVTnFf2OFCFp/ZILLkoKgfwOyIK4reUIkhCjuhkwp/cqGaFAkeCFQXPB6DLYesLZ2M3KPuBsBrs3pr3HRbTtwaOzdKtGc8e0C0VTjrJ3GwljStMPrSuQWh6/vigHRasZ4P9kFv5DPVbHWZzPvtwUw0AMByt44YH678WpbAXXy4I/IVOHmErZTbw1mJ/3vd4uI5rr2zEO_YA9qJZLJT/wmBimbOyaMtmTNYr_FhgfkKMN3_1la7RCK8CIP3p26mbuHbdJV1j/5sTIKibInM5l2BoWdEi49bPqzagsfjKpGVbg0YQ8mjrLhI92/qy0eVYi34kBGVuLzxK2FLC8vwYUrbupjUYE23Mc_6nmHYRK1HF1QmZDZG1hw96I3MPbTZqeJOWGch230qDNxOgnHRNNM52k/3c7FeuRr88RwZGpif/4FaSAbdqkUNvJ9J9qX2tJS9x5vZlgD8k4YHIXDztrnwg2VPquj/uo_2MjbWybIF/NGJM2RFAsKV1S5iOejuTV4p12KlH1p0Dt5EpxCSIl0XoWuvyLYar77f_hzqNdWAyL0FDxGfj4ma4jwqdTTLNyeZEtguYoCHTFfY/HgJkpHx/yO23G7gLhKPvD459ceffHidFh7LipTxNF0GFXhIAPrWfhv7PkPmVofBoFFlo6/rMcHQ82d5VS8i1CCyLtfuT5WH9GqrsOY7xo3lxi7BNL93/PLRdQT3SObRFRERw68V5ZFvIuEQqFOFZQ848rWPLXYDGY658dyjZALf/Ug4EROi_ehNtzPwecer_RGBHxeMnpxrPAFZEL6YXNKzm8hh3HY4Uc4fgkjge5fXsR4CeTSkS66/FOD00deDKmN7XcHEj1LGlAmd4XlV8vFpXg2VazX4OLW8z6vXn5vntNGYO6eBCEKUwupRz9nQSMeZ/Pbmjoopyt6TxQBUfPkHBdgCIhqA1zDV72ARqGlK_ao9KVjvgbB98YeiieIyogkuOa4y0E5iUEdBopzovVgtY88yLijh9ww/tl0R5rI2P2_OxguTbv_wrfEm8jRjISEIqSE9q29RB3n8PeD4hu24rcsaEuTMCqniiLN0a2OtZiKxHnbsNB660Aq3/tEo2SHZBkkIFYXBbDNE7gLfvFz9ZaC_E2oV2quyK1Id5SkNkJBVRRgROWBc_XEOXktc4vRUKxy1MQ526Xilyo8/uI67lHH1Vlr4V3GVmweT4A16KMqzmVzvRDRFLpkBv2iu3Okc1vIqkC/426aOqeUm6SXIx16d8BWVRcmqKqizxDEF3JkLFgX0ab73CZ4GdJ9YaakJO7y4adFGzzIVLcn08UZ/pwDQ9BAuwuMc2yMnKihdvmLKbnAa1ATk9jFXQ9QAEMBHZLbPNvtS3pkpk0s6fyh2ceHa9Myy3fL/oqvPmq_14KzLgPZHaOlyb3tUoQM52fv/I78TqTGyB4WYD_vkm8gYHZcCF0dFIXsiXUbAbwR90Ldk8lsgxSL6rBvjPSlQq7N66NPzUVRYr3zSISupG_66uS4rJszHwmxmmraT3/zfVKxHXFHgxUDRmnwIMfdFKm4sf/qnRRccOLExJYGcZy8u65jo4gHDvO6vnpsdf0YtVWqDBJXa95/Y/qL7EYS73_t6/2xnWra9TTO0OtQNXEQ1XXLSLt6vPw1FTlE2aYCitDgUo7DyxiwuGtvmMKUkYCo/lqXouo2TGXZFF80lrCu1vKdxBgOOerlrsKrOJawGEzL8XzXdxkOMUT8HOzHPNOvDwsxc47mvpVzXEbX5DRaioOlm2U4flTG/6bZfLqJqHNtrKwC5U5NNG6_yNOW5Jg_bLmzUosi86IXxn7i04vRXXn92JmdE70TcdujehT1n15wtiD8ld5A65IV2W1801/wr0XcDIGiUSmxFfCozUCtBTFwln0uJ0cquSDXhj7JQADhYDGyz8WhqcPE7CP9xN93EUBrWczINbA4IsfckY8CZh68/Tak5dEhw8i_3rz/8U39D/iML1G_A8TsnKQ9/_S8o89fFc7Wx/f1nXF8H6OLVbPpp5IZg7UTZ2K0bSe3iBpsmkkJpxY_6zEHTJE3LbIANwF9Ik5Tu0ZJpjck7I07xlHR8mDW9FXclSQC/qJUGL5qByf2SY2Wd24hqKGrahLfqApQuRI8_DtU/Y8kH6DDif5kD6as3sIe6VbKYnU9c1URq/npTlE72m107FXxW9zktdzbBJAxt4udMFzjt2LPcBpqrMKGkrg4BHqKXwhFTspCWyYCjxJ/eFb3fd3BB5kb9D0yl3oOjeWtbJBqsboyzdLisRBn2MCtXO2O8eo4Hkm/2uJDoRjRCyIi2GNRkH0B3EkN6Z3vG40C985bAtM8eqHABzP2QRcKCz4ICOw_Xz249bJk8qM0/m4EeIWnx2ISf9TBU6_0KZ5QJ0VPOCPXxV9jCeK5W5/RV5nd7GUUXG0btDqUAa3DzpaRHX3klMAqL73hK4AGD3ItikmxF8vnSaqtsgOCpEePERt9qcUOJJP2aR0scPAf_1TkGSrgr5VF/XLM2i7YhC_3J9fA2Qwa0dbTedY/xGayjimEkuWSWvh7P5FNOum_l7qJPnA31lQq6ixqR0NKhO328rWfijqKHF6WR/5O0MJ4WNuIXk6xBtTOA9mK7CGUgWjaF5mB72PVnDpN8G6ERO39GqO/fCO96/A1mwIPWedF6HklU8jaQ_M5EUzwCsBE3/7FW2hbcD3GCOFCiLvObjn59o6CKoYlmTop/PZw2CLzvARAr5KaLhjIuZRSKTGlmYjvSoSELuvWi/QHUV7SJ0kF_1O3b_3a88cm/z7qD3Rp6MmoQdGPSyu1lXTpoETypgOMywfsr4ycV2LQr5XaE3UrQP/RzobA4rI_I3ceCUaRASmil2rV1TUiyljhdCFt8zmi1o2NyTzSBRNGP0lXU5Qtm6dKKp7lGRC19P2oSSFrxt85vWRNo1mv8odcL/TF7/MN1Ev7gY20MqlRSBrlwg5LZ4_Az7QnBnpbU3LkTC/oVb743VFtXMW4cK/3lw6wfBJZe_8DobxT_6/gCXp6QOs/LuqmrQHMQvTS6jfbqVFnPfLjrQ01Mb_F4lr3md6m87wpc1CYd9hdzgUL/aqz68HMDCxjGauC00Rajq9wGVYcWJ3j6rIaHIPwclftjARXFDg0yH8v/L6qDgIgGwbB3eZfjOXHAMXRFNMMihseZxYkcFAzLtYr94q9XpQeK4bKi9h_rWAMwcEHnS8/MHHlySbgy8azGEA0u9xsY96MRi45Qe74kZ9xlsI1t4Yutx8/gsjIiu7vNsKEyeTwd88BMExjWNcJHOSHRff57pJBMEAtPdbMETYorvUkRyErsqprxX0W45n0RRQ85w/JCOsYaxZOAFfzO0AdLpMCguFwl01fkFOKYrQeXfNn8w0KF4XS0k/fPx02fU7fFjUoXcPH7_9xo755WL8DNIU2ne4b6DpiROe473yUfD8_zSNUI1tpxzVYNA7GvVSYt8UtqHn3/_QwuOc4VeAI6RiAG5O5bcAxzQl96Q35emNwtTT_CYqHORCmyPj6By2hT_SCLf8m_xFxxe3YzvnxDZGq3qf__pq7Tw181/GosBAJy3MotiIxcYDASbY9sV4T2V/KoGHyJ64spdkQbJOHJ216JMSKj8ii5m8gxqJ2ypL81p5hbjWtjbUgSc8M_KTLuc0Owf1R/3vr/dKbQ2pJ4XEfXhnZTBQY7ZrClnVCnd5cMe9ic/aNF0yyOSQVVOecUFkK9IYFVR8VHdVf4/Nfu3nOEskHki1_r3At1HLOMniS6qNTvhS0hfqIuBiQBsd5aB7OdfVpYy1HdIR72gMToBlpHPsE5GrVO0J9/gcyB2xcyZ3UpTom8G3V48LUkk6kcJ6l1SL5Fgzbst0z3pDA4dzBfswbC8dW57_MkswDANNd8atPrOBSU5m2z66dP/mIYQ8iq/DcmBexkARDI47VzYuw5gwy8Lvym2_B2gxBokU9_T/fHCPjlpqjTsY6SgBOz1nlDh_HcSWYAqnyrZxbEO2erVJ4WPKNzjM3KaPXGH/dZryna1E28wxCrMqLCs9aL9oVBlDMjUcEryAyRh7xwN0uWGopdpkd7Du6O9EPjAj37sHkUiVs7WL6JyexoDF_n67MICvQnJ9FK/FVrp1uMZnmr7ijkMW87moNRBkXbVc2EA_hHOHmpbVGqr6WgNtJ7bBk1LrAPT8sKtE75vbe_L9VYqBHJ/njk.WIIj-V23pwC7ZahcIL0XnDPupL7ltwEc779Ofhrk9dt_wIOFsA8XwnCjrYqH2ty.F0XdS\"*;@kDYgfL4dwE/5I@>k|u0D:wGz\"_8=}RJM!Ybbwd}eN=ZB*esF&(iQ%FW]_FSA:3Ze4O*6&tG-Fe**/j^a&S8zIa#6gxL2NmnNMSVGF-Bf3z08tt0ug_UfNshhs4HJh0l1o24gjAN-Uck1OvWkGQSXH0glB7CnOm0gI" + }, + { + "attempt_num": 3, + "bounce_type": "hard", + "event_name": "dropped", + "http_user_agent": "quis re", + "mx_server": "laborum nisi", + "processed": "2017-10-13T18:56:21Z", + "url": "G_3c-1HtUkN4`puC&&!u>0OiStFG.ZoRi2=j%fUVa]&re6k{hKqD-8vWE12Fb5JC6z>S@@'cWS~w5KtuIwv$8/JDD94CXx1n5yjC_I2lQ66zDj4MXe/4bqlcqqQ7evnQWTYx5roaEYMapyuzb/USpsyalh/HcYc9PmQfF8ND_C7bXnwFQ_fb_BHMXbIV8JN28/NjZdawDJ6kSWxLykSVTHzcISGPBRfs_rt3Uc65Vzj6LDSSMN8WRs70m0tAWs/fkDvjvm_7ZeV08YZeB9j9mS9BcE089Fn5UzDlTJW9vqDF5uipjlIVrNbM7oWE/MIJcjg2vJO20jA24WHrchrEXCvKcxriviSDl3tuyDxqdqRSekpm2aH6yW7_ylXj/nWsex4jm3rKvYw1uLq3Tp7qb9edhj8B_TnwLv1yjHSkgbA5jKI4BTqxugmwVTnFf2OFCFp/ZILLkoKgfwOyIK4reUIkhCjuhkwp/cqGaFAkeCFQXPB6DLYesLZ2M3KPuBsBrs3pr3HRbTtwaOzdKtGc8e0C0VTjrJ3GwljStMPrSuQWh6/vigHRasZ4P9kFv5DPVbHWZzPvtwUw0AMByt44YH678WpbAXXy4I/IVOHmErZTbw1mJ/3vd4uI5rr2zEO_YA9qJZLJT/wmBimbOyaMtmTNYr_FhgfkKMN3_1la7RCK8CIP3p26mbuHbdJV1j/5sTIKibInM5l2BoWdEi49bPqzagsfjKpGVbg0YQ8mjrLhI92/qy0eVYi34kBGVuLzxK2FLC8vwYUrbupjUYE23Mc_6nmHYRK1HF1QmZDZG1hw96I3MPbTZqeJOWGch230qDNxOgnHRNNM52k/3c7FeuRr88RwZGpif/4FaSAbdqkUNvJ9J9qX2tJS9x5vZlgD8k4YHIXDztrnwg2VPquj/uo_2MjbWybIF/NGJM2RFAsKV1S5iOejuTV4p12KlH1p0Dt5EpxCSIl0XoWuvyLYar77f_hzqNdWAyL0FDxGfj4ma4jwqdTTLNyeZEtguYoCHTFfY/HgJkpHx/yO23G7gLhKPvD459ceffHidFh7LipTxNF0GFXhIAPrWfhv7PkPmVofBoFFlo6/rMcHQ82d5VS8i1CCyLtfuT5WH9GqrsOY7xo3lxi7BNL93/PLRdQT3SObRFRERw68V5ZFvIuEQqFOFZQ848rWPLXYDGY658dyjZALf/Ug4EROi_ehNtzPwecer_RGBHxeMnpxrPAFZEL6YXNKzm8hh3HY4Uc4fgkjge5fXsR4CeTSkS66/FOD00deDKmN7XcHEj1LGlAmd4XlV8vFpXg2VazX4OLW8z6vXn5vntNGYO6eBCEKUwupRz9nQSMeZ/Pbmjoopyt6TxQBUfPkHBdgCIhqA1zDV72ARqGlK_ao9KVjvgbB98YeiieIyogkuOa4y0E5iUEdBopzovVgtY88yLijh9ww/tl0R5rI2P2_OxguTbv_wrfEm8jRjISEIqSE9q29RB3n8PeD4hu24rcsaEuTMCqniiLN0a2OtZiKxHnbsNB660Aq3/tEo2SHZBkkIFYXBbDNE7gLfvFz9ZaC_E2oV2quyK1Id5SkNkJBVRRgROWBc_XEOXktc4vRUKxy1MQ526Xilyo8/uI67lHH1Vlr4V3GVmweT4A16KMqzmVzvRDRFLpkBv2iu3Okc1vIqkC/426aOqeUm6SXIx16d8BWVRcmqKqizxDEF3JkLFgX0ab73CZ4GdJ9YaakJO7y4adFGzzIVLcn08UZ/pwDQ9BAuwuMc2yMnKihdvmLKbnAa1ATk9jFXQ9QAEMBHZLbPNvtS3pkpk0s6fyh2ceHa9Myy3fL/oqvPmq_14KzLgPZHaOlyb3tUoQM52fv/I78TqTGyB4WYD_vkm8gYHZcCF0dFIXsiXUbAbwR90Ldk8lsgxSL6rBvjPSlQq7N66NPzUVRYr3zSISupG_66uS4rJszHwmxmmraT3/zfVKxHXFHgxUDRmnwIMfdFKm4sf/qnRRccOLExJYGcZy8u65jo4gHDvO6vnpsdf0YtVWqDBJXa95/Y/qL7EYS73_t6/2xnWra9TTO0OtQNXEQ1XXLSLt6vPw1FTlE2aYCitDgUo7DyxiwuGtvmMKUkYCo/lqXouo2TGXZFF80lrCu1vKdxBgOOerlrsKrOJawGEzL8XzXdxkOMUT8HOzHPNOvDwsxc47mvpVzXEbX5DRaioOlm2U4flTG/6bZfLqJqHNtrKwC5U5NNG6_yNOW5Jg_bLmzUosi86IXxn7i04vRXXn92JmdE70TcdujehT1n15wtiD8ld5A65IV2W1801/wr0XcDIGiUSmxFfCozUCtBTFwln0uJ0cquSDXhj7JQADhYDGyz8WhqcPE7CP9xN93EUBrWczINbA4IsfckY8CZh68/Tak5dEhw8i_3rz/8U39D/iML1G_A8TsnKQ9/_S8o89fFc7Wx/f1nXF8H6OLVbPpp5IZg7UTZ2K0bSe3iBpsmkkJpxY_6zEHTJE3LbIANwF9Ik5Tu0ZJpjck7I07xlHR8mDW9FXclSQC/qJUGL5qByf2SY2Wd24hqKGrahLfqApQuRI8_DtU/Y8kH6DDif5kD6as3sIe6VbKYnU9c1URq/npTlE72m107FXxW9zktdzbBJAxt4udMFzjt2LPcBpqrMKGkrg4BHqKXwhFTspCWyYCjxJ/eFb3fd3BB5kb9D0yl3oOjeWtbJBqsboyzdLisRBn2MCtXO2O8eo4Hkm/2uJDoRjRCyIi2GNRkH0B3EkN6Z3vG40C985bAtM8eqHABzP2QRcKCz4ICOw_Xz249bJk8qM0/m4EeIWnx2ISf9TBU6_0KZ5QJ0VPOCPXxV9jCeK5W5/RV5nd7GUUXG0btDqUAa3DzpaRHX3klMAqL73hK4AGD3ItikmxF8vnSaqtsgOCpEePERt9qcUOJJP2aR0scPAf_1TkGSrgr5VF/XLM2i7YhC_3J9fA2Qwa0dbTedY/xGayjimEkuWSWvh7P5FNOum_l7qJPnA31lQq6ixqR0NKhO328rWfijqKHF6WR/5O0MJ4WNuIXk6xBtTOA9mK7CGUgWjaF5mB72PVnDpN8G6ERO39GqO/fCO96/A1mwIPWedF6HklU8jaQ_M5EUzwCsBE3/7FW2hbcD3GCOFCiLvObjn59o6CKoYlmTop/PZw2CLzvARAr5KaLhjIuZRSKTGlmYjvSoSELuvWi/QHUV7SJ0kF_1O3b_3a88cm/z7qD3Rp6MmoQdGPSyu1lXTpoETypgOMywfsr4ycV2LQr5XaE3UrQP/RzobA4rI_I3ceCUaRASmil2rV1TUiyljhdCFt8zmi1o2NyTzSBRNGP0lXU5Qtm6dKKp7lGRC19P2oSSFrxt85vWRNo1mv8odcL/TF7/MN1Ev7gY20MqlRSBrlwg5LZ4_Az7QnBnpbU3LkTC/oVb743VFtXMW4cK/3lw6wfBJZe_8DobxT_6/gCXp6QOs/LuqmrQHMQvTS6jfbqVFnPfLjrQ01Mb_F4lr3md6m87wpc1CYd9hdzgUL/aqz68HMDCxjGauC00Rajq9wGVYcWJ3j6rIaHIPwclftjARXFDg0yH8v/L6qDgIgGwbB3eZfjOXHAMXRFNMMihseZxYkcFAzLtYr94q9XpQeK4bKi9h_rWAMwcEHnS8/MHHlySbgy8azGEA0u9xsY96MRi45Qe74kZ9xlsI1t4Yutx8/gsjIiu7vNsKEyeTwd88BMExjWNcJHOSHRff57pJBMEAtPdbMETYorvUkRyErsqprxX0W45n0RRQ85w/JCOsYaxZOAFfzO0AdLpMCguFwl01fkFOKYrQeXfNn8w0KF4XS0k/fPx02fU7fFjUoXcPH7_9xo755WL8DNIU2ne4b6DpiROe473yUfD8_zSNUI1tpxzVYNA7GvVSYt8UtqHn3/_QwuOc4VeAI6RiAG5O5bcAxzQl96Q35emNwtTT_CYqHORCmyPj6By2hT_SCLf8m_xFxxe3YzvnxDZGq3qf__pq7Tw181/GosBAJy3MotiIxcYDASbY9sV4T2V/KoGHyJ64spdkQbJOHJ216JMSKj8ii5m8gxqJ2ypL81p5hbjWtjbUgSc8M_KTLuc0Owf1R/3vr/dKbQ2pJ4XEfXhnZTBQY7ZrClnVCnd5cMe9ic/aNF0yyOSQVVOecUFkK9IYFVR8VHdVf4/Nfu3nOEskHki1_r3At1HLOMniS6qNTvhS0hfqIuBiQBsd5aB7OdfVpYy1HdIR72gMToBlpHPsE5GrVO0J9/gcyB2xcyZ3UpTom8G3V48LUkk6kcJ6l1SL5Fgzbst0z3pDA4dzBfswbC8dW57_MkswDANNd8atPrOBSU5m2z66dP/mIYQ8iq/DcmBexkARDI47VzYuw5gwy8Lvym2_B2gxBokU9_T/fHCPjlpqjTsY6SgBOz1nlDh_HcSWYAqnyrZxbEO2erVJ4WPKNzjM3KaPXGH/dZryna1E28wxCrMqLCs9aL9oVBlDMjUcEryAyRh7xwN0uWGopdpkd7Du6O9EPjAj37sHkUiVs7WL6JyexoDF_n67MICvQnJ9FK/FVrp1uMZnmr7ijkMW87moNRBkXbVc2EA_hHOHmpbVGqr6WgNtJ7bBk1LrAPT8sKtE75vbe_L9VYqBHJ/njk.WIIj-V23pwC7ZahcIL0XnDPupL7ltwEc779Ofhrk9dt_wIOFsA8XwnCjrYqH2ty.F0XdS\"*;@kDYgfL4dwE/5I@>k|u0D:wGz\"_8=}RJM!Ybbwd}eN=ZB*esF&(iQ%FW]_FSA:3Ze4O*6&tG-Fe**/j^a&S8zIa#6gxL2NmnNMSVGF-Bf3z08tt0ug_UfNshhs4HJh0l1o24gjAN-Uck1OvWkGQSXH0glB7CnOm0gI" + } + ], + "from_email": "LKb.pOGYIZbfxMgi7Le0K1YWym%e5pz2PiuGbwByM2tR+wRPqfoFg1__35DaWF8CDhzYJg@ZTSFDjbgdxD23oq34Lun1NUnyymoGT4G.5i1IEzQpXWAvNwx.BNckAJiBCnwEVnwBfrbMlouoOPmtTSEbdPp", + "id": "2mMUdxV2HRfAeDiBTYs2IP", + "msg_id": "hznSfJ1RfKeIKS1B4mShNnkRMpdt5IXXKf", + "originating_ip": "204.173.18.0", + "outbound_ip": "181.40.184.87", + "outbound_ip_type": "dedicated", + "status": "delivered", + "subject": "culpa aute amet magna sint", + "teammate": "9a8F0EP88wSSJeuOyXtbfc7BkK", + "template_id": "d674d9b7-e8e5-4e30-87be-1b3b026235fd", + "to_email": "+lOnUtHodefMsuBw.kunNalfcxRos5USSRoR@r5uEXYPP6wrQGRQ-vBg33fLY6MVkkMd-DKT8Z1iqt4qnrL23xMOZ8GWd.fyghGEFceTHIUpgwNGlwEtFHJikSaPzsnYfrJPKydPVPAlItJtqykRHZSGW", + "unique_args": "eu" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/email-activity-response-common-fields" + }, + { + "example": { + "api_key_id": "sdfsdfsdf123", + "asm_group_id": 11376349, + "categories": [ + "hi", + "bye" + ], + "events": [ + { + "bounce_type": "soft", + "event_name": "bounced", + "http_user_agent": "in tempor ex dolore est", + "mx_server": "quis proident", + "processed": "2017-10-13T18:56:21Z", + "server_response": "some error message" + } + ], + "from_email": "jane_doe@example.com", + "msg_id": "in aliquip id aliqua", + "originating_ip": "2.3.4.5", + "outbound_ip": "1.2.3.4", + "outbound_ip_type": "dedicated", + "status": "not_delivered", + "subject": "est incididunt adipisicing pariatur", + "teammate": "", + "template_id": "123e4567-e89b-12d3-a456-426655440000", + "to_email": "send@test.com", + "unique_args": "{'key': 'value'}" + }, + "properties": { + "api_key_id": { + "description": "The ID of the API Key used to authenticate the sending request for the message.", + "maxLength": 50, + "minLength": 3, + "pattern": "^[A-Za-z0-9]+", + "type": "string" + }, + "asm_group_id": { + "description": "The unsubscribe group associated with this email.", + "minimum": 1, + "type": "integer" + }, + "categories": { + "description": "Categories users associated to the message", + "items": { + "type": "string" + }, + "type": "array" + }, + "events": { + "description": "List of events related to email message", + "items": { + "example": { + "bounce_type": "soft", + "event_name": "bounced", + "http_user_agent": "in tempor ex dolore est", + "mx_server": "quis proident", + "processed": "2017-10-13T18:56:21Z", + "reason": "some reason", + "url": "http://3LX,MU}N=B8'd,K}>bEma{l~!ad%peIF}y>qHfLPWQ$l9b\\!6.1H?$Z9H\"il-_gZD>/JPYsGqH4x4_3v090TCtnFalXGFiAdooDxgrDAYNXShUywSxwYr8gKeyc/4sal4VJ3IxEWsG74V5MYQ0mz27jhy7n5DHsUtApQ6zXHS13uO5vYBlJHpJRfuT6/F5nIpkHre2w3eTtN7M6pg9V5stjnnsavKkzQxyTv15CMSDLFwR_BTZwofhWpyBU7B9ypYL79vT97N3LDZyoaM/fNsOLPIqfGBer_Mx9_StergbQYANyOmOSjR6pZof01ky/ZcNDhpu3CkSl4MTtQ3NMCX780pOKQ5SYIPigyvz9IC9WtrCNcOkTxdOPdY0_4MJU4EuTTPmGvO/14KaJCDjIjgrbIqpzuUEL5mET0t2VeVlwvtnOnlHaBE8sic20ze2E0Xt3ETqXyzVJRjLDKh/LWkW8OVp_xkLBCCW7LQngRukKcOiWjMXeCEhYI9HoZ0RsMEWZC8KzRaHc4OI0uXPD4M9pav1LGrI/_0t_RnBnfnqGKsBJr0kdQi/Y6QN_aeawIqX5hDNIU3MF/wWKVWLS0ZFbDfK6KVv5oAid83EpwKoazAMA8MTfEXvHQLO7k7XYWX1Il3eGXL6/wCA96I1SOabzJkZHo2HsFpIC/VBk52Lnpp0xtDH/OCdlQ5e4PpxXQeklp70LPOndr7QKSYEQNUc48n36ixvTjhgpgO8wHsFFYqGcuBMHg9oaCARppQomiQDWYuVPVDynJHdsM1_gWl4/NSs8Y9PL7DrQXOu0UiFRRE0TUsvgqyUgJzlGjUnRziyYeROO75D0K_3aTtbGbCmhaxecos40a1w0PDCNkFp1W/iHwY7922drhsoM6ShwqqwGpAh5HLuU6Q5gqyckeai6YN7HCh9DdHPhhJcatgtMHZDKfQUBVt9ecUlDgiCFF_OnRX/GpzttcsL8E2FoXL9_eAWvSqjodROqx7MZCA/ORdnR/IssPCYP1kTHTIL5mZxv4UGEpyNjUzt4GdSJJTm0nztltWDYX8_Ezl2JvpLVnGVTJxobb4yQIJhe3n64khbOFyFLKHWEniIolm/AxpZQYmseWlVqrIz3YXU59XaSbTTrdCHNhvwF1ogXiiggN6TZ2B3QY_mBEtAp/SD0ONPVqEUkTNAFWTgnnlv6ZIMdMbTw5uZwtFRlB7qDvQouml9kujGmRu6k7zZMTOwWowRNtpboLUcL2NzkVgK6N1Zi2vq/Nt4NJvM5_l1dpIIbwJv_CIcZQZOqPtRWULa2iVxfmJJQaqgLQPwSHQH1zuRJMhraEsPjqVQRC0pZpSt/24VBDN8y31Ye/y_ekWxMdZCvr978C/WrdcTi29kxjJLyT9BII7BsgT5vLuI2l7ntqRAhAUWMs/h9JR0i8RbX5OfB46q41/TfmSdgi97bCR2HfgflyypXwKhRfKYU2MVpu2Dd90WQUlm7hZV8dSfGusuMj/nPMpRVWcbnvlAdsehJCPbLv6n4qdLSPeoMBo32acAGgu1BwBG8JsBgbH43yYi5X7UdGRWKqm_ZbqaDEKH3ncU/uA8EOJb41VfGho4LUeOi1IeYwVAhFEyO6YbteYZecEubrNFZrWWjZUqhzouzY95TeWU8E4StCXVPKlYPiFiwUSX20kG0lVtDbAy/7u4f4x0cYlFOvI1UN1qoOExmNxnxzQQFeM5exWfW2JrRXq5e0UdAJr4q2o9Y_0WaGfhL/nP6Ei06YajDKr11dK5H0LX/9CGTC37HFZeopyopzP_7fvGFkqIRoGTS48pLaIFz3gwpQNlWXUFCsd/PnRlsqJ3SBQSgp_AQe2cP6iBNy2bJI8lkxwY5YVDDdjxusuCcafdjfs2aUa/4tr_iMnNBnd27GxjQI28_JGJlfbOaajVJOxuPMT4ELpYCfPiFjdSbJyE0/gCwtj0rgDKSLWJnOPJ5TAJ935gCqeIsBhOhfcZX413GdilBZRRYEjCVKfOuWzHZ3GW/8yjyk5e_WMNv5F6xggl07w90DBwpx/Q/iWfncqMuSfoeFeqHQkDL9F5W19j1cGuAcyfIYMAXztHXpgTKh9vZcsLYC7LcgKr4FQj3JjEvtnDG2PjcMjGF/MnbCRCz22Ho410_vE9M1Hpq0wdk_i5DbZKNoSwlPgey9URkpuX146TcDdsx_VWDenCepY5HwMr9CPOY9hzUs/c5AWeUMXk/gvsI81Jkv5rHpEnNBUZXYzfqkwQfffhmrc/StLCtzRRlja8dpsEWdkzoKR9Kdxq1qAs5f0sdrGjVRLTT_s1Q2P59zhA/QmS4bubi64cYot3gSIgdNnkjA2GjCp1ETVa548_U9B6boTKDVmaKJlVIDvqL84RC3WI7Er/8opi2lZ48W83Ur47BRh38oOnI0agrCyZz8bp1w_gfVRlSO8PS0i/l_/qxq5xpLbhPkdxVoyZVsNAZchfnmkIHyIk5IK6EUDXdMR21y6OvKW50ZbooAtk9ymynBj4dAYMsd25RV7FE1I1vRTsiDw52/.E5WC0Ymo2zn.qelSbhzr-4laArYiWP.dwJB6qm_6rs0Rm5UXYaYtUNbh76_jJp_X1xQUCDSgbr2KOkDU0\"Q/-4dV\"Yk3QGg[(O86=Pf\"e17K4'r{)kicofHSXcMmP@>VF^`~4j4F*L/1]tD+Lw!WI!@]*OZm6C`M$u96}*ObEma{l~!ad%peIF}y>qHfLPWQ$l9b\\!6.1H?$Z9H\"il-_gZD>/JPYsGqH4x4_3v090TCtnFalXGFiAdooDxgrDAYNXShUywSxwYr8gKeyc/4sal4VJ3IxEWsG74V5MYQ0mz27jhy7n5DHsUtApQ6zXHS13uO5vYBlJHpJRfuT6/F5nIpkHre2w3eTtN7M6pg9V5stjnnsavKkzQxyTv15CMSDLFwR_BTZwofhWpyBU7B9ypYL79vT97N3LDZyoaM/fNsOLPIqfGBer_Mx9_StergbQYANyOmOSjR6pZof01ky/ZcNDhpu3CkSl4MTtQ3NMCX780pOKQ5SYIPigyvz9IC9WtrCNcOkTxdOPdY0_4MJU4EuTTPmGvO/14KaJCDjIjgrbIqpzuUEL5mET0t2VeVlwvtnOnlHaBE8sic20ze2E0Xt3ETqXyzVJRjLDKh/LWkW8OVp_xkLBCCW7LQngRukKcOiWjMXeCEhYI9HoZ0RsMEWZC8KzRaHc4OI0uXPD4M9pav1LGrI/_0t_RnBnfnqGKsBJr0kdQi/Y6QN_aeawIqX5hDNIU3MF/wWKVWLS0ZFbDfK6KVv5oAid83EpwKoazAMA8MTfEXvHQLO7k7XYWX1Il3eGXL6/wCA96I1SOabzJkZHo2HsFpIC/VBk52Lnpp0xtDH/OCdlQ5e4PpxXQeklp70LPOndr7QKSYEQNUc48n36ixvTjhgpgO8wHsFFYqGcuBMHg9oaCARppQomiQDWYuVPVDynJHdsM1_gWl4/NSs8Y9PL7DrQXOu0UiFRRE0TUsvgqyUgJzlGjUnRziyYeROO75D0K_3aTtbGbCmhaxecos40a1w0PDCNkFp1W/iHwY7922drhsoM6ShwqqwGpAh5HLuU6Q5gqyckeai6YN7HCh9DdHPhhJcatgtMHZDKfQUBVt9ecUlDgiCFF_OnRX/GpzttcsL8E2FoXL9_eAWvSqjodROqx7MZCA/ORdnR/IssPCYP1kTHTIL5mZxv4UGEpyNjUzt4GdSJJTm0nztltWDYX8_Ezl2JvpLVnGVTJxobb4yQIJhe3n64khbOFyFLKHWEniIolm/AxpZQYmseWlVqrIz3YXU59XaSbTTrdCHNhvwF1ogXiiggN6TZ2B3QY_mBEtAp/SD0ONPVqEUkTNAFWTgnnlv6ZIMdMbTw5uZwtFRlB7qDvQouml9kujGmRu6k7zZMTOwWowRNtpboLUcL2NzkVgK6N1Zi2vq/Nt4NJvM5_l1dpIIbwJv_CIcZQZOqPtRWULa2iVxfmJJQaqgLQPwSHQH1zuRJMhraEsPjqVQRC0pZpSt/24VBDN8y31Ye/y_ekWxMdZCvr978C/WrdcTi29kxjJLyT9BII7BsgT5vLuI2l7ntqRAhAUWMs/h9JR0i8RbX5OfB46q41/TfmSdgi97bCR2HfgflyypXwKhRfKYU2MVpu2Dd90WQUlm7hZV8dSfGusuMj/nPMpRVWcbnvlAdsehJCPbLv6n4qdLSPeoMBo32acAGgu1BwBG8JsBgbH43yYi5X7UdGRWKqm_ZbqaDEKH3ncU/uA8EOJb41VfGho4LUeOi1IeYwVAhFEyO6YbteYZecEubrNFZrWWjZUqhzouzY95TeWU8E4StCXVPKlYPiFiwUSX20kG0lVtDbAy/7u4f4x0cYlFOvI1UN1qoOExmNxnxzQQFeM5exWfW2JrRXq5e0UdAJr4q2o9Y_0WaGfhL/nP6Ei06YajDKr11dK5H0LX/9CGTC37HFZeopyopzP_7fvGFkqIRoGTS48pLaIFz3gwpQNlWXUFCsd/PnRlsqJ3SBQSgp_AQe2cP6iBNy2bJI8lkxwY5YVDDdjxusuCcafdjfs2aUa/4tr_iMnNBnd27GxjQI28_JGJlfbOaajVJOxuPMT4ELpYCfPiFjdSbJyE0/gCwtj0rgDKSLWJnOPJ5TAJ935gCqeIsBhOhfcZX413GdilBZRRYEjCVKfOuWzHZ3GW/8yjyk5e_WMNv5F6xggl07w90DBwpx/Q/iWfncqMuSfoeFeqHQkDL9F5W19j1cGuAcyfIYMAXztHXpgTKh9vZcsLYC7LcgKr4FQj3JjEvtnDG2PjcMjGF/MnbCRCz22Ho410_vE9M1Hpq0wdk_i5DbZKNoSwlPgey9URkpuX146TcDdsx_VWDenCepY5HwMr9CPOY9hzUs/c5AWeUMXk/gvsI81Jkv5rHpEnNBUZXYzfqkwQfffhmrc/StLCtzRRlja8dpsEWdkzoKR9Kdxq1qAs5f0sdrGjVRLTT_s1Q2P59zhA/QmS4bubi64cYot3gSIgdNnkjA2GjCp1ETVa548_U9B6boTKDVmaKJlVIDvqL84RC3WI7Er/8opi2lZ48W83Ur47BRh38oOnI0agrCyZz8bp1w_gfVRlSO8PS0i/l_/qxq5xpLbhPkdxVoyZVsNAZchfnmkIHyIk5IK6EUDXdMR21y6OvKW50ZbooAtk9ymynBj4dAYMsd25RV7FE1I1vRTsiDw52/.E5WC0Ymo2zn.qelSbhzr-4laArYiWP.dwJB6qm_6rs0Rm5UXYaYtUNbh76_jJp_X1xQUCDSgbr2KOkDU0\"Q/-4dV\"Yk3QGg[(O86=Pf\"e17K4'r{)kicofHSXcMmP@>VF^`~4j4F*L/1]tD+Lw!WI!@]*OZm6C`M$u96}*ObEma{l~!ad%peIF}y>qHfLPWQ$l9b\\!6.1H?$Z9H\"il-_gZD>/JPYsGqH4x4_3v090TCtnFalXGFiAdooDxgrDAYNXShUywSxwYr8gKeyc/4sal4VJ3IxEWsG74V5MYQ0mz27jhy7n5DHsUtApQ6zXHS13uO5vYBlJHpJRfuT6/F5nIpkHre2w3eTtN7M6pg9V5stjnnsavKkzQxyTv15CMSDLFwR_BTZwofhWpyBU7B9ypYL79vT97N3LDZyoaM/fNsOLPIqfGBer_Mx9_StergbQYANyOmOSjR6pZof01ky/ZcNDhpu3CkSl4MTtQ3NMCX780pOKQ5SYIPigyvz9IC9WtrCNcOkTxdOPdY0_4MJU4EuTTPmGvO/14KaJCDjIjgrbIqpzuUEL5mET0t2VeVlwvtnOnlHaBE8sic20ze2E0Xt3ETqXyzVJRjLDKh/LWkW8OVp_xkLBCCW7LQngRukKcOiWjMXeCEhYI9HoZ0RsMEWZC8KzRaHc4OI0uXPD4M9pav1LGrI/_0t_RnBnfnqGKsBJr0kdQi/Y6QN_aeawIqX5hDNIU3MF/wWKVWLS0ZFbDfK6KVv5oAid83EpwKoazAMA8MTfEXvHQLO7k7XYWX1Il3eGXL6/wCA96I1SOabzJkZHo2HsFpIC/VBk52Lnpp0xtDH/OCdlQ5e4PpxXQeklp70LPOndr7QKSYEQNUc48n36ixvTjhgpgO8wHsFFYqGcuBMHg9oaCARppQomiQDWYuVPVDynJHdsM1_gWl4/NSs8Y9PL7DrQXOu0UiFRRE0TUsvgqyUgJzlGjUnRziyYeROO75D0K_3aTtbGbCmhaxecos40a1w0PDCNkFp1W/iHwY7922drhsoM6ShwqqwGpAh5HLuU6Q5gqyckeai6YN7HCh9DdHPhhJcatgtMHZDKfQUBVt9ecUlDgiCFF_OnRX/GpzttcsL8E2FoXL9_eAWvSqjodROqx7MZCA/ORdnR/IssPCYP1kTHTIL5mZxv4UGEpyNjUzt4GdSJJTm0nztltWDYX8_Ezl2JvpLVnGVTJxobb4yQIJhe3n64khbOFyFLKHWEniIolm/AxpZQYmseWlVqrIz3YXU59XaSbTTrdCHNhvwF1ogXiiggN6TZ2B3QY_mBEtAp/SD0ONPVqEUkTNAFWTgnnlv6ZIMdMbTw5uZwtFRlB7qDvQouml9kujGmRu6k7zZMTOwWowRNtpboLUcL2NzkVgK6N1Zi2vq/Nt4NJvM5_l1dpIIbwJv_CIcZQZOqPtRWULa2iVxfmJJQaqgLQPwSHQH1zuRJMhraEsPjqVQRC0pZpSt/24VBDN8y31Ye/y_ekWxMdZCvr978C/WrdcTi29kxjJLyT9BII7BsgT5vLuI2l7ntqRAhAUWMs/h9JR0i8RbX5OfB46q41/TfmSdgi97bCR2HfgflyypXwKhRfKYU2MVpu2Dd90WQUlm7hZV8dSfGusuMj/nPMpRVWcbnvlAdsehJCPbLv6n4qdLSPeoMBo32acAGgu1BwBG8JsBgbH43yYi5X7UdGRWKqm_ZbqaDEKH3ncU/uA8EOJb41VfGho4LUeOi1IeYwVAhFEyO6YbteYZecEubrNFZrWWjZUqhzouzY95TeWU8E4StCXVPKlYPiFiwUSX20kG0lVtDbAy/7u4f4x0cYlFOvI1UN1qoOExmNxnxzQQFeM5exWfW2JrRXq5e0UdAJr4q2o9Y_0WaGfhL/nP6Ei06YajDKr11dK5H0LX/9CGTC37HFZeopyopzP_7fvGFkqIRoGTS48pLaIFz3gwpQNlWXUFCsd/PnRlsqJ3SBQSgp_AQe2cP6iBNy2bJI8lkxwY5YVDDdjxusuCcafdjfs2aUa/4tr_iMnNBnd27GxjQI28_JGJlfbOaajVJOxuPMT4ELpYCfPiFjdSbJyE0/gCwtj0rgDKSLWJnOPJ5TAJ935gCqeIsBhOhfcZX413GdilBZRRYEjCVKfOuWzHZ3GW/8yjyk5e_WMNv5F6xggl07w90DBwpx/Q/iWfncqMuSfoeFeqHQkDL9F5W19j1cGuAcyfIYMAXztHXpgTKh9vZcsLYC7LcgKr4FQj3JjEvtnDG2PjcMjGF/MnbCRCz22Ho410_vE9M1Hpq0wdk_i5DbZKNoSwlPgey9URkpuX146TcDdsx_VWDenCepY5HwMr9CPOY9hzUs/c5AWeUMXk/gvsI81Jkv5rHpEnNBUZXYzfqkwQfffhmrc/StLCtzRRlja8dpsEWdkzoKR9Kdxq1qAs5f0sdrGjVRLTT_s1Q2P59zhA/QmS4bubi64cYot3gSIgdNnkjA2GjCp1ETVa548_U9B6boTKDVmaKJlVIDvqL84RC3WI7Er/8opi2lZ48W83Ur47BRh38oOnI0agrCyZz8bp1w_gfVRlSO8PS0i/l_/qxq5xpLbhPkdxVoyZVsNAZchfnmkIHyIk5IK6EUDXdMR21y6OvKW50ZbooAtk9ymynBj4dAYMsd25RV7FE1I1vRTsiDw52/.E5WC0Ymo2zn.qelSbhzr-4laArYiWP.dwJB6qm_6rs0Rm5UXYaYtUNbh76_jJp_X1xQUCDSgbr2KOkDU0\"Q/-4dV\"Yk3QGg[(O86=Pf\"e17K4'r{)kicofHSXcMmP@>VF^`~4j4F*L/1]tD+Lw!WI!@]*OZm6C`M$u96}*O" + }, + "properties": { + "enabled": { + "description": "Indicates if the certificate is enabled.", + "type": "boolean" + }, + "integration_id": { + "description": "An ID that matches a certificate to a specific IdP integration. This is the `id` returned by the \"Get All SSO Integrations\" endpoint.", + "type": "string" + }, + "public_certificate": { + "description": "This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes.", + "type": "string" + } + }, + "required": [ + "public_certificate", + "integration_id" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 66138975, + "intergration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312", + "not_after": 1621289880, + "not_before": 1621289880, + "public_certificate": "" + } + } + }, + "schema": { + "$ref": "#/components/schemas/sso-certificate-body" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Create an SSO Certificate", + "tags": [ + "Certificates" + ], + "x-stoplight": { + "id": "POST_sso-certificates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/sso/certificates/{cert_id}": { + "delete": { + "description": "**This endpoint allows you to delete an SSO certificate.**\n\nYou can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint.", + "operationId": "DELETE_sso-certificates-cert_id", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 66138975, + "intergration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312", + "not_after": 1621289880, + "not_before": 1621289880, + "public_certificate": "" + } + } + }, + "schema": { + "$ref": "#/components/schemas/sso-certificate-body" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Delete an SSO Certificate", + "tags": [ + "Certificates" + ], + "x-stoplight": { + "id": "DELETE_sso-certificates-certid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve an individual SSO certificate.**", + "operationId": "GET_sso-certificates-cert_id", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 66138975, + "intergration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312", + "not_after": 1621289880, + "not_before": 1621289880, + "public_certificate": "" + } + } + }, + "schema": { + "$ref": "#/components/schemas/sso-certificate-body" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Get an SSO Certificate", + "tags": [ + "Certificates" + ], + "x-stoplight": { + "id": "GET_sso-certificates-certid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "cert_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update an existing certificate by ID.**\n\nYou can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint.", + "operationId": "PATCH_sso-certificates-cert_id", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "enabled": false, + "intergration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312", + "public_certificate": "" + }, + "properties": { + "enabled": { + "description": "Indicates whether or not the certificate is enabled.", + "type": "boolean" + }, + "integration_id": { + "description": "An ID that matches a certificate to a specific IdP integration.", + "type": "string" + }, + "public_certificate": { + "description": "This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Update SSO Certificate", + "tags": [ + "Certificates" + ], + "x-stoplight": { + "id": "PATCH_sso-certificates-certid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/sso/integrations": { + "get": { + "description": "**This endpoint allows you to retrieve all SSO integrations tied to your Twilio SendGrid account.**\n\nThe IDs returned by this endpoint can be used by the APIs additional endpoints to modify your SSO integrations.", + "operationId": "GET_sso-integrations", + "parameters": [ + { + "description": "If this parameter is set to `true`, the response will include the `completed_integration` field.", + "in": "query", + "name": "si", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "audience_url": "https://api.sendgrid.com/v3/public/sso/saml/response/id/b0b98502-9408-4b24-9e3d-31ed7cb15312", + "completed_integration": true, + "enabled": true, + "entity_id": "http://www.okta.com/${org.externalKey}", + "id": "b0b98502-9408-4b24-9e3d-31ed7cb15312", + "last_updated": 1621288520, + "name": "Twilio SendGrid", + "signin_url": "https://example.okta.com/home/examplecompany/yokpGWsmpRUcuvXFb4x6/nfaVADNhuHvvReAEV4x6", + "signout_url": "https://example.okta.com/login/signout?fromURI=exampleappurl", + "single_signon_url": "https://api.sendgrid.com/v3/public/sso/saml/response/id/b0b98502-9408-4b24-9e3d-31ed7cb15312" + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/sso-integration" + }, + "type": "array" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Get All SSO Integrations", + "tags": [ + "Single Sign-On Settings" + ], + "x-stoplight": { + "id": "GET_sso-integrations", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create an SSO integration.**", + "operationId": "POST_sso-integrations", + "requestBody": { + "$ref": "#/components/requestBodies/create-integration-request" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "entity_id": "http://www.okta.com/${org.externalKey}", + "last_updated": 1621288964, + "name": "Twilio SendGrid", + "signin_url": "https://example.okta.com/home/examplecompany/yokpGWsmpRUcuvXFb4x6/nfaVADNhuHvvReAEV4x6", + "signout_url": "https://example.okta.com/login/signout?fromURI=exampleappurl" + } + } + }, + "schema": { + "$ref": "#/components/schemas/sso-integration" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Create an SSO Integration", + "tags": [ + "Single Sign-On Settings" + ], + "x-stoplight": { + "id": "POST_sso-integrations", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/sso/integrations/{id}": { + "delete": { + "description": "**This endpoint allows you to delete an IdP configuration by ID.**\n\nYou can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint.", + "operationId": "DELETE_sso-integrations-id", + "responses": { + "204": { + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Delete an SSO Integration", + "tags": [ + "Single Sign-On Settings" + ], + "x-stoplight": { + "id": "DELETE_sso-integrations-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve an SSO integration by ID.**\n\nYou can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint.", + "operationId": "GET_sso-integrations-id", + "parameters": [ + { + "description": "If this parameter is set to `true`, the response will include the `completed_integration` field.", + "in": "query", + "name": "si", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "audience_url": "https://api.sendgrid.com/v3/public/sso/saml/response/id/b0b98502-9408-4b24-9e3d-31ed7cb15312", + "completed_integration": true, + "enabled": true, + "entity_id": "http://www.okta.com/${org.externalKey}", + "id": "b0b98502-9408-4b24-9e3d-31ed7cb15312", + "last_updated": 1621288964, + "name": "Twilio SendGrid", + "signin_url": "https://example.okta.com/home/examplecompany/yokpGWsmpRUcuvXFb4x6/nfaVADNhuHvvReAEV4x6", + "signout_url": "https://example.okta.com/login/signout?fromURI=exampleappurl" + } + } + }, + "schema": { + "$ref": "#/components/schemas/sso-integration" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Get an SSO Integration", + "tags": [ + "Single Sign-On Settings" + ], + "x-stoplight": { + "id": "GET_sso-integrations-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to modify an exisiting SSO integration.**\n\nYou can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint.", + "operationId": "PATCH_sso-integrations-id", + "parameters": [ + { + "description": "If this parameter is set to `true`, the response will include the `completed_integration` field.", + "in": "query", + "name": "si", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/create-integration-request" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "audience_url": "https://api.sendgrid.com/v3/public/sso/saml/response/id/b0b98502-9408-4b24-9e3d-31ed7cb15312", + "enabled": true, + "entity_id": "http://www.okta.com/${org.externalKey}", + "id": "b0b98502-9408-4b24-9e3d-31ed7cb15312", + "last_updated": 1621288964, + "name": "Twilio SendGrid", + "signin_url": "https://example.okta.com/home/examplecompany/yokpGWsmpRUcuvXFb4x6/nfaVADNhuHvvReAEV4x6", + "signout_url": "https://example.okta.com/login/signout?fromURI=exampleappurl", + "single_signon_url": "https://api.sendgrid.com/v3/public/sso/saml/response/id/b0b98502-9408-4b24-9e3d-31ed7cb15312" + } + } + }, + "schema": { + "$ref": "#/components/schemas/sso-integration" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Update an SSO Integration", + "tags": [ + "Single Sign-On Settings" + ], + "x-stoplight": { + "id": "PATCH_sso-integrations-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/sso/integrations/{integration_id}/certificates": { + "get": { + "description": "**This endpoint allows you to retrieve all your IdP configurations by configuration ID.**\n\nThe `integration_id` expected by this endpoint is the `id` returned in the response by the \"Get All SSO Integrations\" endpoint.", + "operationId": "GET_sso-integrations-integration_id-certificates", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "id": 66138975, + "intergration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312", + "not_after": 1621289880, + "not_before": 1621289880, + "public_certificate": "" + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/sso-certificate-body" + }, + "type": "array" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Get All SSO Certificates by Integration", + "tags": [ + "Certificates" + ], + "x-stoplight": { + "id": "GET_sso-integrations-integrationid-certificates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "An ID that matches a certificate to a specific IdP integration.", + "in": "path", + "name": "integration_id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/sso/teammates": { + "post": { + "description": "**This endpoint allows you to create an SSO Teammate.**\n\nThe email provided for this user will also function as the Teammate’s username.", + "operationId": "POST_sso-teammates", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sso-teammate-request" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "jane_doe@example.com", + "first_name": "Jane", + "is_read_only": true, + "is_sso": true, + "last_name": "Doe", + "username": "jane_doe@example.com" + } + } + }, + "schema": { + "$ref": "#/components/schemas/sso-teammate-response" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Create SSO Teammate", + "tags": [ + "Single Sign-On Teammates" + ], + "x-stoplight": { + "id": "POST_sso-teammates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/sso/teammates/{username}": { + "parameters": [ + { + "description": "This email address must be the same address assigned to the teammate in your IdP", + "in": "path", + "name": "username", + "required": true, + "schema": { + "format": "email", + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to modify an existing SSO Teammate.**\n\nTo turn a teammate into an admin, the request body should contain the `is_admin` field set to `true`. Otherwise, set `is_admin` to false and pass in all the scopes that a teammate should have.\n\nOnly the parent user and Teammates with admin permissions can update another Teammate’s permissions. Admin users can only update permissions.", + "operationId": "PATCH_sso-teammates-username", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "email": "jane_doe@example.com", + "first_name": "Jane", + "is_admin": false, + "last_name": "Doe", + "scopes": [ + "mail.batch.create", + "mail.batch.delete", + "mail.batch.read", + "mail.batch.update", + "mail.send" + ] + }, + "properties": { + "first_name": { + "type": "string" + }, + "is_admin": { + "type": "boolean" + }, + "last_name": { + "type": "string" + }, + "scopes": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "Country": "United States", + "address": "1234 Fake St.", + "address2": "Suite 5", + "city": "San Francisco", + "email": "jane_doe@example.com", + "first_name": "Jane", + "is_admin": false, + "is_sso": true, + "last_name": "Doe", + "phone": "+15555555555", + "state": "CA", + "user_type": "teammate", + "username": "jane_doe@example.com", + "zip": "94105" + } + } + }, + "schema": { + "$ref": "#/components/schemas/sso-teammates-patch-response" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_400" + }, + "401": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_401" + }, + "403": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_403" + }, + "429": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_429" + }, + "500": { + "$ref": "#/components/responses/trait_singleSignOnErrorsTrait_500" + } + }, + "summary": "Edit an SSO Teammate", + "tags": [ + "Single Sign-On Teammates" + ], + "x-stoplight": { + "id": "PATCH_sso-teammates-username", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/stats": { + "get": { + "description": "**This endpoint allows you to retrieve all of your global email statistics between a given date range.**\n\nParent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats.", + "operationId": "GET_stats", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_limit" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_offset" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_aggregated_by" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_start_date" + }, + { + "$ref": "#/components/parameters/trait_statsAdvancedQueryStringsLimitOffset_end_date" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2015-11-03", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + } + } + ] + }, + { + "date": "2015-11-04", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + } + } + ] + }, + { + "date": "2015-11-05", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + } + } + ] + }, + { + "date": "2015-11-06", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + } + } + ] + }, + { + "date": "2015-11-07", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + } + } + ] + }, + { + "date": "2015-11-08", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + } + } + ] + }, + { + "date": "2015-11-09", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + } + } + ] + } + ] + } + }, + "schema": { + "items": { + "properties": { + "date": { + "description": "The date the stats were gathered.", + "type": "string" + }, + "stats": { + "description": "The individual email activity stats.", + "items": { + "properties": { + "metrics": { + "$ref": "#/components/schemas/stats-advanced-global-stats" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "date", + "stats" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve global email statistics", + "tags": [ + "Stats" + ], + "x-stoplight": { + "id": "GET_stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/subusers": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all of your subusers.**\n\nYou can choose to retrieve specific subusers as well as limit the results that come back from the API.", + "operationId": "GET_subusers", + "parameters": [ + { + "description": "The username of this subuser.", + "in": "query", + "name": "username", + "schema": { + "type": "string" + } + }, + { + "description": "The number of results you would like to get in each request.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "The number of subusers to skip.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "disabled": false, + "email": "example@example.com", + "id": 1234, + "username": "example_subuser" + }, + { + "disabled": false, + "email": "example2@example.com", + "id": 1234, + "username": "example_subuser2" + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/subuser" + }, + "type": "array" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "Unexpected error in API call. See HTTP response body for details." + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "List all Subusers", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "id": "GET_subusers", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new subuser.**", + "operationId": "POST_subusers", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "email": "John@example.com", + "ips": [ + "1.1.1.1", + "2.2.2.2" + ], + "password": "johns_password", + "username": "John@example.com" + }, + "properties": { + "email": { + "description": "The email address of the subuser.", + "format": "email", + "type": "string" + }, + "ips": { + "description": "The IP addresses that should be assigned to this subuser.", + "items": { + "format": "ipv4", + "type": "string" + }, + "type": "array" + }, + "password": { + "description": "The password this subuser will use when logging into SendGrid.", + "type": "string" + }, + "username": { + "description": "The username for this subuser.", + "type": "string" + } + }, + "required": [ + "username", + "email", + "password", + "ips" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "authorization_token": "", + "credit_allocation": { + "type": "unlimited" + }, + "email": "example@example.com", + "signup_session_token": "", + "user_id": 1234, + "username": "example_subuser" + } + } + }, + "schema": { + "$ref": "#/components/schemas/subuser_post" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "username exists" + }, + { + "message": "unable to validate IPs at this time" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "403": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "you dont have permission to access this resource" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "unable to validate IPs at this time" + } + ] + } + } + }, + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create Subuser", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "id": "POST_subusers", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/subusers/reputations": { + "get": { + "description": "**This endpoint allows you to request the reputations for your subusers.**\n\nSubuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will affect your sender rating.", + "operationId": "GET_subusers-reputations", + "parameters": [ + { + "in": "query", + "name": "usernames", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "reputation": 99, + "username": "example_subuser" + }, + { + "reputation": 95.2, + "username": "example_subuser2" + } + ] + } + }, + "schema": { + "items": { + "properties": { + "reputation": { + "description": "The sender reputation this subuser has attained.", + "type": "number" + }, + "username": { + "description": "The subuser that has this reputation.f", + "type": "string" + } + }, + "required": [ + "reputation", + "username" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Subuser Reputations", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "id": "GET_subusers-reputations", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/subusers/stats": { + "get": { + "description": "**This endpoint allows you to retrieve the email statistics for the given subusers.**\n\nYou may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser.", + "operationId": "GET_subusers-stats", + "parameters": [ + { + "description": "Limits the number of results returned per page.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "description": "The point in the list to begin retrieving results from.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "in": "query", + "name": "aggregated_by", + "required": false, + "schema": { + "enum": [ + "day", + "week", + "month" + ], + "type": "string" + } + }, + { + "description": "The subuser you want to retrieve statistics for. You may include this parameter up to 10 times to retrieve statistics for multiple subusers.", + "in": "query", + "name": "subusers", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end date of the statistics to retrieve. Defaults to today.", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2015-10-01", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-02", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-03", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-04", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-05", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-06", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-07", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-08", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-09", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + }, + { + "date": "2015-10-10", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 0, + "processed": 0, + "requests": 0, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "Matt_subuser", + "type": "subuser" + } + ] + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/category_stats" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics for your subusers.", + "tags": [ + "Subuser Statistics" + ], + "x-stoplight": { + "id": "GET_subusers-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/subusers/stats/monthly": { + "get": { + "description": "**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.**\n\nWhen using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:\n`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.", + "operationId": "GET_subusers-stats-monthly", + "parameters": [ + { + "description": "The date of the month to retrieve statistics for. Must be formatted YYYY-MM-DD", + "in": "query", + "name": "date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "A substring search of your subusers.", + "in": "query", + "name": "subuser", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.'", + "in": "query", + "name": "sort_by_metric", + "required": false, + "schema": { + "default": "delivered", + "enum": [ + "blocks", + "bounces", + "clicks", + "delivered", + "opens", + "requests", + "unique_clicks", + "unique_opens", + "unsubscribes" + ], + "type": "string" + } + }, + { + "description": "The direction you want to sort.", + "in": "query", + "name": "sort_by_direction", + "required": false, + "schema": { + "default": "desc", + "enum": [ + "desc", + "asc" + ], + "type": "string" + } + }, + { + "description": "Optional field to limit the number of results returned.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 5, + "type": "integer" + } + }, + { + "description": "Optional beginning point in the list to retrieve from.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "date": "2016-02-01", + "stats": [ + { + "first_name": "John", + "last_name": "Doe", + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 1, + "processed": 0, + "requests": 100, + "spam_report_drops": 0, + "spam_reports": 99, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "user1", + "type": "subuser" + }, + { + "first_name": "Jane", + "last_name": "Doe", + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 5, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 10, + "processed": 10, + "requests": 10, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "user2", + "type": "subuser" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/subuser_stats" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve monthly stats for all subusers", + "tags": [ + "Subuser Statistics" + ], + "x-stoplight": { + "id": "GET_subusers-stats-monthly", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/subusers/stats/sums": { + "get": { + "description": "**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.**", + "operationId": "GET_subusers-stats-sums", + "parameters": [ + { + "description": "The direction you want to sort. ", + "in": "query", + "name": "sort_by_direction", + "required": false, + "schema": { + "default": "desc", + "enum": [ + "desc", + "asc" + ], + "type": "string" + } + }, + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Limits the number of results returned per page.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 5, + "type": "integer" + } + }, + { + "description": "The point in the list to begin retrieving results from.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "type": "integer" + } + }, + { + "description": "How to group the statistics. Defaults to today. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "aggregated_by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "The metric that you want to sort by. Must be a single metric.", + "in": "query", + "name": "sort_by_metric", + "required": false, + "schema": { + "default": "delivered", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "date": "2015-10-11", + "stats": [] + } + } + }, + "schema": { + "$ref": "#/components/schemas/category_stats" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the totals for each email statistic metric for all subusers.", + "tags": [ + "Subuser Statistics" + ], + "x-stoplight": { + "id": "GET_subusers-stats-sums", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/subusers/{subuser_name}": { + "delete": { + "description": "**This endpoint allows you to delete a subuser.**\n\nThis is a permanent action. Once deleted, a subuser cannot be retrieved.", + "operationId": "DELETE_subusers-subuser_name", + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a subuser", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "id": "DELETE_subusers-subusername", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "subuser_name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to enable or disable a subuser.**", + "operationId": "PATCH_subusers-subuser_name", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "disabled": false + }, + "properties": { + "disabled": { + "description": "Whether or not this subuser is disabled. True means disabled, False means enabled.", + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "invalid username" + }, + { + "message": "no fields provided" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "unable to enable user" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Enable/disable a subuser", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "id": "PATCH_subusers-subusername", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/subusers/{subuser_name}/ips": { + "parameters": [ + { + "in": "path", + "name": "subuser_name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "put": { + "description": "**This endpoint allows you update your subusers' assigned IP.**\n\nEach subuser should be assigned to an IP address from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have one or more of their own IP addresses as well. \n\nMore information:\n\n* [How to request more IPs](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/)\n* [Setup Reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/)", + "operationId": "PUT_subusers-subuser_name-ips", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "The IP addresses you would like to assign to the subuser.", + "example": [ + "127.0.0.1" + ], + "items": { + "format": "ipv4", + "type": "string" + }, + "type": "array" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "ips": [ + "127.0.0.1" + ] + } + } + }, + "schema": { + "properties": { + "ips": { + "description": "The IP addresses that are assigned to the subuser.", + "items": { + "format": "ipv4", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update IPs assigned to a subuser", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "id": "PUT_subusers-subusername-ips", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/subusers/{subuser_name}/monitor": { + "delete": { + "operationId": "DELETE_subusers-subuser_name-monitor", + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "No monitor settings for this user" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete monitor settings", + "tags": [ + "Subuser Monitor Settings" + ], + "x-stoplight": { + "id": "DELETE_subusers-subusername-monitor", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "operationId": "GET_subusers-subuser_name-monitor", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "example@example.com", + "frequency": 500 + } + } + }, + "schema": { + "$ref": "#/components/schemas/monitor" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "No monitor settings for this user" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve monitor settings for a subuser", + "tags": [ + "Subuser Monitor Settings" + ], + "x-stoplight": { + "id": "GET_subusers-subusername-monitor", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The name of the subuser for which to retrieve monitor settings.", + "in": "path", + "name": "subuser_name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "operationId": "POST_subusers-subuser_name-monitor", + "requestBody": { + "$ref": "#/components/requestBodies/monitor" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "example@example.com", + "frequency": 50000 + } + } + }, + "schema": { + "$ref": "#/components/schemas/monitor" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "User already has a monitor" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create monitor settings", + "tags": [ + "Subuser Monitor Settings" + ], + "x-stoplight": { + "id": "POST_subusers-subusername-monitor", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "put": { + "operationId": "PUT_subusers-subuser_name-monitor", + "requestBody": { + "$ref": "#/components/requestBodies/monitor" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "example@example.com", + "frequency": 500 + } + } + }, + "schema": { + "$ref": "#/components/schemas/monitor" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "email", + "message": "Email is required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Monitor Settings for a subuser", + "tags": [ + "Subuser Monitor Settings" + ], + "x-stoplight": { + "id": "PUT_subusers-subusername-monitor", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/subusers/{subuser_name}/stats/monthly": { + "get": { + "description": "**This endpoint allows you to retrive the monthly email statistics for a specific subuser.**\n\nWhen using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:\n`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.", + "operationId": "GET_subusers-subuser_name-stats-monthly", + "parameters": [ + { + "description": "The date of the month to retrieve statistics for. Must be formatted YYYY-MM-DD", + "in": "query", + "name": "date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.'", + "in": "query", + "name": "sort_by_metric", + "required": false, + "schema": { + "default": "delivered", + "type": "string" + } + }, + { + "description": "The direction you want to sort.", + "in": "query", + "name": "sort_by_direction", + "required": false, + "schema": { + "default": "desc", + "enum": [ + "desc", + "asc" + ], + "type": "string" + } + }, + { + "description": "Optional field to limit the number of results returned.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 5, + "type": "integer" + } + }, + { + "description": "Optional beginning point in the list to retrieve from.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "date": "2016-02-01", + "stats": [ + { + "first_name": "John", + "last_name": "Doe", + "metrics": { + "blocks": 0, + "bounce_drops": 0, + "bounces": 0, + "clicks": 5, + "deferred": 0, + "delivered": 0, + "invalid_emails": 0, + "opens": 10, + "processed": 10, + "requests": 10, + "spam_report_drops": 0, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0, + "unsubscribe_drops": 0, + "unsubscribes": 0 + }, + "name": "user1", + "type": "subuser" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/subuser_stats" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the monthly email statistics for a single subuser", + "tags": [ + "Subuser Statistics" + ], + "x-stoplight": { + "id": "GET_subusers-subusername-stats-monthly", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "subuser_name", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/suppression/blocks": { + "delete": { + "description": "**This endpoint allows you to delete all email addresses on your blocks list.**\n\nThere are two options for deleting blocked emails: \n\n1. You can delete all blocked emails by setting `delete_all` to `true` in the request body. \n2. You can delete a selection of blocked emails by specifying the email addresses in the `emails` array of the request body.", + "operationId": "DELETE_suppression-blocks", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] + }, + "properties": { + "delete_all": { + "description": "Indicates if you want to delete all blocked email addresses.", + "type": "boolean" + }, + "emails": { + "description": "The specific blocked email addresses that you want to delete.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete blocks", + "tags": [ + "Blocks API" + ], + "x-stoplight": { + "id": "DELETE_suppression-blocks", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve all email addresses that are currently on your blocks list.**", + "operationId": "GET_suppression-blocks", + "parameters": [ + { + "description": "The start of the time range when a blocked email was created (inclusive). This is a unix timestamp.", + "in": "query", + "name": "start_time", + "schema": { + "type": "integer" + } + }, + { + "description": "The end of the time range when a blocked email was created (inclusive). This is a unix timestamp.", + "in": "query", + "name": "end_time", + "schema": { + "type": "integer" + } + }, + { + "description": "Limit the number of results to be displayed per page.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "The point in the list to begin displaying results.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1443651154, + "email": "example@example.com", + "reason": "error dialing remote address: dial tcp 10.57.152.165:25: no route to host", + "status": "4.0.0" + }, + { + "created": 1443651155, + "email": "example1@example.com", + "reason": "unable to resolve MX record for example.com: servfail", + "status": "4.0.0" + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/blocks-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all blocks", + "tags": [ + "Blocks API" + ], + "x-stoplight": { + "id": "GET_suppression-blocks", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/suppression/blocks/{email}": { + "delete": { + "description": "**This endpoint allows you to delete a specific email address from your blocks list.**", + "operationId": "DELETE_suppression-blocks-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a specific block", + "tags": [ + "Blocks API" + ], + "x-stoplight": { + "id": "DELETE_suppression-blocks-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific email address from your blocks list.**", + "operationId": "GET_suppression-blocks-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1443651154, + "email": "example@example.com", + "reason": "error dialing remote address: dial tcp 10.57.152.165:25: no route to host", + "status": "4.0.0" + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/blocks-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific block", + "tags": [ + "Blocks API" + ], + "x-stoplight": { + "id": "GET_suppression-blocks-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The email address of the specific block.", + "in": "path", + "name": "email", + "required": true, + "schema": { + "format": "email", + "type": "string" + } + } + ] + }, + "/suppression/bounces": { + "delete": { + "description": "**This endpoint allows you to delete all emails on your bounces list.**\n\nThere are two options for deleting bounced emails: \n\n1. You can delete all bounced emails by setting `delete_all` to `true` in the request body. \n2. You can delete a selection of bounced emails by specifying the email addresses in the `emails` array of the request body.", + "operationId": "DELETE_suppression-bounces", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "delete_all": false, + "emails": [ + "example@example.com", + "example2@example.com" + ] + }, + "properties": { + "delete_all": { + "description": "This parameter allows you to delete **every** email in your bounce list. This should not be used with the emails parameter.", + "type": "boolean" + }, + "emails": { + "description": "Delete multiple emails from your bounce list at the same time. This should not be used with the delete_all parameter.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete bounces", + "tags": [ + "Bounces API" + ], + "x-stoplight": { + "id": "DELETE_suppression-bounces", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve all of your bounces.**", + "operationId": "GET_suppression-bounces", + "parameters": [ + { + "description": "Refers start of the time range in unix timestamp when a bounce was created (inclusive).", + "in": "query", + "name": "start_time", + "schema": { + "type": "integer" + } + }, + { + "description": "Refers end of the time range in unix timestamp when a bounce was created (inclusive).", + "in": "query", + "name": "end_time", + "schema": { + "type": "integer" + } + }, + { + "in": "header", + "name": "Accept", + "required": true, + "schema": { + "default": "application/json", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1250337600, + "email": "example@example.com", + "reason": "550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/answer/6596 o186si2389584ioe.63 - gsmtp ", + "status": "5.1.1" + }, + { + "created": 1250337600, + "email": "example@example.com", + "reason": "550 5.1.1 : Recipient address rejected: User unknown in virtual alias table ", + "status": "5.1.1" + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/bounce_response" + }, + "type": "array" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all bounces", + "tags": [ + "Bounces API" + ], + "x-stoplight": { + "id": "GET_suppression-bounces", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/suppression/bounces/{email}": { + "delete": { + "description": "**This endpoint allows you to remove an email address from your bounce list.**", + "operationId": "DELETE_suppression-bounces-email", + "parameters": [ + { + "description": "The email address you would like to remove from the bounce list.", + "in": "query", + "name": "email_address", + "required": true, + "schema": { + "format": "email", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/DELETE_contactdb-lists-list_idBody" + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a bounce", + "tags": [ + "Bounces API" + ], + "x-stoplight": { + "id": "DELETE_suppression-bounces-email", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific bounce by email address.**", + "operationId": "GET_suppression-bounces-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1443651125, + "email": "bounce1@test.com", + "reason": "550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/answer/6596 o186si2389584ioe.63 - gsmtp ", + "status": "5.1.1" + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/bounce_response" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Bounce", + "tags": [ + "Bounces API" + ], + "x-stoplight": { + "id": "GET_suppression-bounces-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "email", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/suppression/invalid_emails": { + "delete": { + "description": "**This endpoint allows you to remove email addresses from your invalid email address list.**\n\nThere are two options for deleting invalid email addresses: \n\n1) You can delete all invalid email addresses by setting `delete_all` to true in the request body.\n2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body.", + "operationId": "DELETE_suppression-invalid_emails", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] + }, + "properties": { + "delete_all": { + "description": "Indicates if you want to remove all email address from the invalid emails list.", + "type": "boolean" + }, + "emails": { + "description": "The list of specific email addresses that you want to remove.", + "items": { + "format": "email", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete invalid emails", + "tags": [ + "Invalid Emails API" + ], + "x-stoplight": { + "id": "DELETE_suppression-invalidemails", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a list of all invalid email addresses.**", + "operationId": "GET_suppression-invalid_emails", + "parameters": [ + { + "description": "Refers start of the time range in unix timestamp when an invalid email was created (inclusive).", + "in": "query", + "name": "start_time", + "schema": { + "type": "integer" + } + }, + { + "description": "Refers end of the time range in unix timestamp when an invalid email was created (inclusive).", + "in": "query", + "name": "end_time", + "schema": { + "type": "integer" + } + }, + { + "description": "Limit the number of results to be displayed per page.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "Paging offset. The point in the list to begin displaying results.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1449953655, + "email": "user1@example.com", + "reason": "Mail domain mentioned in email address is unknown" + }, + { + "created": 1449939373, + "email": "user2@example.com", + "reason": "Mail domain mentioned in email address is unknown" + } + ] + } + }, + "schema": { + "description": "The list of invalid email addresses.", + "items": { + "$ref": "#/components/schemas/invalid-email" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all invalid emails", + "tags": [ + "Invalid Emails API" + ], + "x-stoplight": { + "id": "GET_suppression-invalidemails", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/suppression/invalid_emails/{email}": { + "delete": { + "description": "**This endpoint allows you to remove a specific email address from the invalid email address list.**", + "operationId": "DELETE_suppression-invalid_emails-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a specific invalid email", + "tags": [ + "Invalid Emails API" + ], + "x-stoplight": { + "id": "DELETE_suppression-invalidemails-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific invalid email addresses.**", + "operationId": "GET_suppression-invalid_emails-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1454433146, + "email": "test1@example.com", + "reason": "Mail domain mentioned in email address is unknown" + } + ] + } + }, + "schema": { + "description": "A specific invalid email.", + "items": { + "$ref": "#/components/schemas/invalid-email" + }, + "maxItems": 1, + "minItems": 0, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific invalid email", + "tags": [ + "Invalid Emails API" + ], + "x-stoplight": { + "id": "GET_suppression-invalidemails-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The specific email address of the invalid email entry that you want to retrieve.", + "in": "path", + "name": "email", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/suppression/spam_reports": { + "delete": { + "description": "**This endpoint allows you to delete your spam reports.**\n\nDeleting a spam report will remove the suppression, meaning email will once again be sent to the previously suppressed address. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required.\n\nThere are two options for deleting spam reports: \n\n1. You can delete all spam reports by setting the `delete_all` field to `true` in the request body.\n2. You can delete a list of select spam reports by specifying the email addresses in the `emails` array of the request body.", + "operationId": "DELETE_suppression-spam_reports", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] + }, + "properties": { + "delete_all": { + "description": "Indicates if you want to delete all email addresses on the spam report list.", + "type": "boolean" + }, + "emails": { + "description": "A list of specific email addresses that you want to remove from the spam report list.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete spam reports", + "tags": [ + "Spam Reports API" + ], + "x-stoplight": { + "id": "DELETE_suppression-spamreports", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve all spam reports.**", + "operationId": "GET_suppression-spam_reports", + "parameters": [ + { + "description": "The start of the time range when a spam report was created (inclusive). This is a unix timestamp.", + "in": "query", + "name": "start_time", + "schema": { + "type": "integer" + } + }, + { + "description": "The end of the time range when a spam report was created (inclusive). This is a unix timestamp.", + "in": "query", + "name": "end_time", + "schema": { + "type": "integer" + } + }, + { + "description": "Limit the number of results to be displayed per page.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "Paging offset. The point in the list to begin displaying results.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1443651141, + "email": "user1@example.com", + "ip": "10.63.202.100" + }, + { + "created": 1443651154, + "email": "user2@example.com", + "ip": "10.63.202.100" + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/spam-reports-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all spam reports", + "tags": [ + "Spam Reports API" + ], + "x-stoplight": { + "id": "GET_suppression-spamreports", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/suppression/spam_reports/{email}": { + "delete": { + "description": "**This endpoint allows you to delete a specific spam report by email address.**\n\nDeleting a spam report will remove the suppression, meaning email will once again be sent to the previously suppressed address. This should be avoided unless a recipient indicates they wish to receive email from you again. You can use our [bypass filters](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) to deliver messages to otherwise suppressed addresses when exceptions are required.", + "operationId": "DELETE_suppression-spam_reports-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a specific spam report", + "tags": [ + "Spam Reports API" + ], + "x-stoplight": { + "id": "DELETE_suppression-spamreports-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific spam report by email address.**", + "operationId": "GET_suppression-spam_reports-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1454433146, + "email": "test1@example.com", + "ip": "10.89.32.5" + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/spam-reports-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific spam report", + "tags": [ + "Spam Reports API" + ], + "x-stoplight": { + "id": "GET_suppression-spamreports-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The email address of a specific spam report that you want to retrieve.", + "in": "path", + "name": "email", + "required": true, + "schema": { + "format": "email", + "type": "string" + } + } + ] + }, + "/suppression/unsubscribes": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all email address that are globally suppressed.**", + "operationId": "GET_suppression-unsubscribes", + "parameters": [ + { + "description": "Refers start of the time range in unix timestamp when an unsubscribe email was created (inclusive).", + "in": "query", + "name": "start_time", + "schema": { + "type": "integer" + } + }, + { + "description": "Refers end of the time range in unix timestamp when an unsubscribe email was created (inclusive).", + "in": "query", + "name": "end_time", + "schema": { + "type": "integer" + } + }, + { + "description": "The number of results to display on each page.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "The point in the list of results to begin displaying global suppressions.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "created": 1443651141, + "email": "user1@example.com" + }, + { + "created": 1443651154, + "email": "user2@example.com" + } + ] + } + }, + "schema": { + "items": { + "properties": { + "created": { + "description": "A Unix timestamp indicating when the recipient was added to the global suppression list.", + "type": "integer" + }, + "email": { + "description": "The email address of the recipient who is globally suppressed.", + "format": "email", + "type": "string" + } + }, + "required": [ + "created", + "email" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all global suppressions", + "tags": [ + "Suppressions - Global Suppressions" + ], + "x-stoplight": { + "id": "GET_suppression-unsubscribes", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/teammates": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all current Teammates.**\n\nYou can limit the number of results returned using the `limit` query paramater. To return results from a specific Teammate, use the `offset` paramter. The Response Headers will include pagination info.", + "operationId": "GET_v3-teammates", + "parameters": [ + { + "description": "Number of items to return", + "in": "query", + "name": "limit", + "schema": { + "default": 500, + "maximum": 500, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Paging offset", + "in": "query", + "name": "offset", + "schema": { + "default": 0, + "minimum": 0, + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "results": [ + { + "address": "123 Acme St", + "address2": "", + "city": "City", + "company": "ACME Inc.", + "country": "USA", + "email": "teammate1@example.com", + "first_name": "Jane", + "is_admin": true, + "last_name": "Doe", + "phone": "123-345-3453", + "state": "CA", + "user_type": "owner", + "username": "teammate1", + "website": "www.example.com", + "zip": "12345" + }, + { + "address": "123 Acme St", + "address2": "", + "city": "City", + "company": "ACME Inc.", + "country": "USA", + "email": "teammate2@example.com", + "first_name": "John", + "is_admin": false, + "last_name": "Doe", + "phone": "123-345-3453", + "state": "CA", + "user_type": "teammate", + "username": "teammate2", + "website": "www.example.com", + "zip": "12345" + }, + { + "address": "123 Acme St", + "address2": "", + "city": "City", + "company": "ACME Inc.", + "country": "USA", + "email": "teammate3@example.com", + "first_name": "Steve", + "is_admin": true, + "last_name": "Doe", + "phone": "123-345-3453", + "state": "CA", + "user_type": "admin", + "username": "teammate3", + "website": "www.example.com", + "zip": "12345" + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "items": { + "properties": { + "address": { + "description": "(optional) Teammate's address", + "type": "string" + }, + "address2": { + "description": "(optional) Teammate's address", + "type": "string" + }, + "city": { + "description": "(optional) Teammate's city", + "type": "string" + }, + "country": { + "description": "(optional) Teammate's country", + "type": "string" + }, + "email": { + "description": "Teammate's email", + "type": "string" + }, + "first_name": { + "description": "Teammate's first name", + "type": "string" + }, + "is_admin": { + "description": "Set to true if teammate has admin privileges", + "type": "boolean" + }, + "last_name": { + "description": "Teammate's last name", + "type": "string" + }, + "phone": { + "description": "(optional) Teammate's phone number", + "type": "string" + }, + "state": { + "description": "(optional) Teammate's state", + "type": "string" + }, + "user_type": { + "description": "Indicate the type of user: owner user, teammate admin user, or normal teammate", + "enum": [ + "admin", + "owner", + "teammate" + ], + "type": "string" + }, + "username": { + "description": "Teammate's username", + "type": "string" + }, + "website": { + "description": "(optional) Teammate's website", + "type": "string" + }, + "zip": { + "description": "(optional) Teammate's zip", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all teammates", + "tags": [ + "Teammates" + ], + "x-stoplight": { + "id": "GET_v3-teammates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to invite a Teammate to your account via email.**\n\nYou 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.\n\n**Note:** A teammate invite will expire after 7 days, but you may resend the invitation at any time to reset the expiration date.", + "operationId": "POST_v3-teammates", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "email": "teammate1@example.com", + "is_admin": false, + "scopes": [ + "user.profile.read", + "user.profile.update" + ] + }, + "properties": { + "email": { + "description": "New teammate's email", + "maxLength": 255, + "minLength": 5, + "pattern": "^.*@.*\\..*", + "type": "string" + }, + "is_admin": { + "default": false, + "description": "Set to true if teammate should be an admin user", + "type": "boolean" + }, + "scopes": { + "description": "Set to specify list of scopes that teammate should have. Should be empty if teammate is an admin.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "email", + "scopes", + "is_admin" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "teammate1@example.com", + "is_admin": false, + "scopes": [ + "user.profile.read", + "user.profile.update" + ] + } + } + }, + "schema": { + "properties": { + "email": { + "description": "Teammate's email address", + "type": "string" + }, + "is_admin": { + "description": "Set to true if teammate should have admin privileges", + "type": "boolean" + }, + "scopes": { + "description": "Initial set of permissions to give to teammate if they accept the invite", + "items": {}, + "type": "array" + }, + "token": { + "description": "Token to identify invite", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Invite teammate", + "tags": [ + "Teammates" + ], + "x-stoplight": { + "id": "POST_v3-teammates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/teammates/pending": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all pending Teammate invitations.**\n\nEach teammate invitation is valid for 7 days. Users may resend the invitation to refresh the expiration date.", + "operationId": "GET_v3-teammates-pending", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "email": "user1@example.com", + "expiration_date": 1456424263, + "is_admin": false, + "pending_id": "abcd123abc", + "scopes": [ + "user.profile.read", + "user.profile.edit" + ] + }, + { + "email": "user2@example.com", + "expiration_date": 1456424263, + "is_admin": true, + "pending_id": "bcde234bcd", + "scopes": [] + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "items": { + "properties": { + "email": { + "description": "Email address teammate invite will be sent to", + "type": "string" + }, + "expiration_date": { + "description": "timestamp indicates when invite will expire. Expiration is 7 days after invite creation", + "type": "integer" + }, + "is_admin": { + "description": "Set to true to indicate teammate should have the same set of permissions as parent user", + "type": "boolean" + }, + "scopes": { + "description": "List of permissions to give teammate if they accept", + "items": { + "type": "string" + }, + "type": "array" + }, + "token": { + "description": "Invitation token used to identify user", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all pending teammates", + "tags": [ + "Teammates" + ], + "x-stoplight": { + "id": "GET_v3-teammates-pending", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/teammates/pending/{token}": { + "delete": { + "description": "**This endpoint allows you to delete a pending teammate invite.**", + "operationId": "DELETE_v3-teammates-pending-token", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete pending teammate", + "tags": [ + "Teammates" + ], + "x-stoplight": { + "id": "DELETE_v3-teammates-pending-token", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The token for the invite you want to delete.", + "in": "path", + "name": "token", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/teammates/pending/{token}/resend": { + "parameters": [ + { + "description": "The token for the invite that you want to resend.", + "in": "path", + "name": "token", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to resend a Teammate invitation.**\n\nTeammate invitations will expire after 7 days. Resending an invitation will reset the expiration date.", + "operationId": "POST_v3-teammates-pending-token-resend", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "teammate1@example.com", + "is_admin": false, + "pending_id": "abc123abc", + "scopes": [ + "user.profile.read", + "user.profile.update" + ] + } + } + }, + "schema": { + "properties": { + "email": { + "description": "Teammate's email address", + "type": "string" + }, + "is_admin": { + "description": "Set to true if teammate should have admin privileges", + "type": "boolean" + }, + "scopes": { + "description": "Initial set of permissions to give to teammate if they accept the invite", + "items": { + "type": "string" + }, + "type": "array" + }, + "token": { + "description": "ID to identify invite", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "pending_key", + "message": "invalid pending key" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Resend teammate invite", + "tags": [ + "Teammates" + ], + "x-stoplight": { + "id": "POST_v3-teammates-pending-token-resend", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/teammates/{username}": { + "delete": { + "description": "**This endpoint allows you to delete a teammate.**\n\n**Only the parent user or an admin teammate can delete another teammate.**", + "operationId": "DELETE_v3-teammates-username", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "username", + "message": "username not found" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete teammate", + "tags": [ + "Teammates" + ], + "x-stoplight": { + "id": "DELETE_v3-teammates-username", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific Teammate by username.**\n\nYou can retrieve the username's for each of your Teammates using the \"Retrieve all Teammates\" endpoint.", + "operationId": "GET_v3-teammates-username", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "address": "123 Acme St", + "address2": "", + "city": "City", + "company": "ACME Inc.", + "country": "USA", + "email": "teammate1@example.com", + "first_name": "Jane", + "is_admin": true, + "last_name": "Doe", + "phone": "123-345-3453", + "scopes": [ + "user.profile.read", + "user.profile.update", + "..." + ], + "state": "CA", + "user_type": "admin", + "username": "teammate1", + "website": "www.example.com", + "zip": "12345" + } + } + }, + "schema": { + "properties": { + "address": { + "description": "(optional) Teammate's address", + "type": "string" + }, + "address2": { + "description": "(optional) Teammate's address", + "type": "string" + }, + "city": { + "description": "(optional) Teammate's city", + "type": "string" + }, + "country": { + "description": "(optional) Teammate's country", + "type": "string" + }, + "email": { + "description": "Teammate's email", + "type": "string" + }, + "first_name": { + "description": "Teammate's first name", + "type": "string" + }, + "is_admin": { + "description": "Set to true if teammate has admin privileges", + "type": "boolean" + }, + "last_name": { + "description": "Teammate's last name", + "type": "string" + }, + "phone": { + "description": "(optional) Teammate's phone number", + "type": "string" + }, + "scopes": { + "description": "Scopes associated to teammate", + "items": {}, + "type": "array" + }, + "state": { + "description": "(optional) Teammate's state", + "type": "string" + }, + "user_type": { + "description": "Indicate the type of user: account owner, teammate admin user, or normal teammate", + "enum": [ + "admin", + "owner", + "teammate" + ], + "type": "string" + }, + "username": { + "description": "Teammate's username", + "type": "string" + }, + "website": { + "description": "(optional) Teammate's website", + "type": "string" + }, + "zip": { + "description": "(optional) Teammate's zip", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve specific teammate", + "tags": [ + "Teammates" + ], + "x-stoplight": { + "id": "GET_v3-teammates-username", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The username of the teammate that you want to retrieve.", + "in": "path", + "name": "username", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update a teammate’s permissions.**\n\nTo 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.\n\n**Only the parent user or other admin teammates can update another teammate’s permissions.**\n\n**Admin users can only update permissions.**", + "operationId": "PATCH_v3-teammates-username", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "is_admin": false, + "scopes": [ + "user.profile.read", + "user.profile.edit" + ] + }, + "properties": { + "is_admin": { + "description": "Set to True if this teammate should be promoted to an admin user. If True, scopes should be an empty array.", + "type": "boolean" + }, + "scopes": { + "description": "Provide list of scopes that should be given to teammate. If specifying list of scopes, is_admin should be set to False.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "scopes", + "is_admin" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "address": "123 Acme St", + "address2": "", + "city": "City", + "company": "ACME Inc.", + "country": "USA", + "email": "teammate1@example.com", + "first_name": "Jane", + "is_admin": false, + "last_name": "Doe", + "phone": "123-345-3453", + "scopes": [ + "user.profile.read", + "user.profile.edit" + ], + "state": "CA", + "user_type": "teammate", + "username": "teammate1", + "website": "www.example.com", + "zip": "12345" + } + } + }, + "schema": { + "properties": { + "address": { + "description": "(optional) Teammate's address", + "type": "string" + }, + "address2": { + "description": "(optional) Teammate's address", + "type": "string" + }, + "city": { + "description": "(optional) Teammate's city", + "type": "string" + }, + "country": { + "description": "(optional) Teammate's country", + "type": "string" + }, + "email": { + "description": "Teammate's email address", + "type": "string" + }, + "first_name": { + "description": "Teammate's first name", + "type": "string" + }, + "is_admin": { + "description": "Set to true if teammate has admin priveleges", + "type": "boolean" + }, + "last_name": { + "description": "Teammate's last name", + "type": "string" + }, + "phone": { + "description": "(optional) Teammate's phone number", + "type": "string" + }, + "scopes": { + "description": "Scopes given to teammate", + "items": { + "type": "string" + }, + "type": "array" + }, + "state": { + "description": "(optional) Teammate's state", + "type": "string" + }, + "user_type": { + "description": "Indicate the type of user: owner user, teammate admin user, or normal teammate", + "enum": [ + "admin", + "owner", + "teammate" + ], + "type": "string" + }, + "username": { + "description": "Teammate's username", + "type": "string" + }, + "website": { + "description": "(optional) Teammate's website", + "type": "string" + }, + "zip": { + "description": "(optional) Teammate's zip", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "scopes", + "message": "one or more of given scopes are invalid" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "username", + "message": "username not found" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update teammate's permissions", + "tags": [ + "Teammates" + ], + "x-stoplight": { + "id": "PATCH_v3-teammates-username", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates": { + "get": { + "description": "**This endpoint allows you to retrieve all transactional templates.**", + "operationId": "GET_templates", + "parameters": [ + { + "description": "Comma-delimited list specifying which generations of templates to return. Options are `legacy`, `dynamic` or `legacy,dynamic`.", + "in": "query", + "name": "generations", + "required": false, + "schema": { + "default": "legacy", + "enum": [ + "legacy", + "dynamic", + "legacy,dynamic" + ], + "type": "string" + } + }, + { + "description": "The number of templates to be returned in each page of results", + "in": "query", + "name": "page_size", + "required": true, + "schema": { + "maximum": 200, + "minimum": 1, + "type": "number" + } + }, + { + "description": "A token corresponding to a specific page of results, as provided by metadata", + "in": "query", + "name": "page_token", + "required": false, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "_metadata": { + "count": 1, + "self": "https://api.sendgrid.com/v3/templates" + }, + "result": [ + { + "generation": "legacy", + "id": "fae7c985-eb92-4b47-9987-28ec29dbc698", + "name": "example_name", + "updated_at ": "2020-11-12 12:00:09", + "versions": [] + } + ] + } + } + }, + "schema": { + "properties": { + "_metadata": { + "$ref": "#/components/schemas/_metadata" + }, + "result": { + "description": "", + "items": { + "$ref": "#/components/schemas/transactional-templates-template-lean" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "": { + "type": "string" + }, + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve paged transactional templates.", + "tags": [ + "Transactional Templates" + ], + "x-stoplight": { + "id": "GET_templates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a transactional template.**", + "operationId": "POST_templates", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "generation": "dynamic", + "name": "example_name" + }, + "properties": { + "generation": { + "default": "legacy", + "description": "Defines whether the template supports dynamic replacement.", + "enum": [ + "legacy", + "dynamic" + ], + "type": "string" + }, + "name": { + "description": "The name for the new transactional template.", + "maxLength": 100, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "generation": "legacy", + "id": "733ba07f-ead1-41fc-933a-3976baa23716", + "name": "example_name", + "updated_at ": "2021-04-28 13:12:46", + "versions": [] + } + } + }, + "schema": { + "$ref": "#/components/schemas/transactional_template" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a transactional template.", + "tags": [ + "Transactional Templates" + ], + "x-stoplight": { + "id": "POST_templates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates/{template_id}": { + "delete": { + "description": "**This endpoint allows you to delete a transactional template.**", + "operationId": "DELETE_templates-template_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a template.", + "tags": [ + "Transactional Templates" + ], + "x-stoplight": { + "id": "DELETE_templates-templateid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a single transactional template.**", + "operationId": "GET_templates-template_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "generation": "legacy", + "id": "40da60e6-66f3-4223-9406-ba58b7f55a62", + "name": "Duis in dolor", + "updated_at ": "2020-12-12 58:26:65", + "versions": [] + } + } + }, + "schema": { + "$ref": "#/components/schemas/transactional_template" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a single transactional template.", + "tags": [ + "Transactional Templates" + ], + "x-stoplight": { + "id": "GET_templates-templateid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "template_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to edit the name of a transactional template.**\n\nTo edit the template itself, [create a new transactional template version](https://sendgrid.api-docs.io/v3.0/transactional-templates-versions/create-a-new-transactional-template-version).", + "operationId": "PATCH_templates-template_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "new_example_name" + }, + "properties": { + "name": { + "description": "The name of the transactional template.", + "maxLength": 100, + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "generation": "legacy", + "id": "733ba07f-ead1-41fc-933a-3976baa23716", + "name": "new_example_name", + "updated_at ": "2021-04-28 13:12:46", + "versions": [] + } + } + }, + "schema": { + "$ref": "#/components/schemas/transactional_template" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Edit a transactional template.", + "tags": [ + "Transactional Templates" + ], + "x-stoplight": { + "id": "PATCH_templates-templateid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to duplicate a transactional template.**", + "operationId": "POST_templates-template_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "name": "example_name" + }, + "properties": { + "name": { + "description": "The name for the new transactional template.", + "maxLength": 100, + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "generation": "dynamic", + "id": "733ba07f-ead1-41fc-933a-3976baa23716", + "name": "example_name", + "updated_at ": "2020-12-12 58:26:65", + "versions": [] + } + } + }, + "schema": { + "$ref": "#/components/schemas/transactional_template" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Duplicate a transactional template.", + "tags": [ + "Transactional Templates" + ], + "x-stoplight": { + "id": "POST_templates-templateid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates/{template_id}/versions": { + "parameters": [ + { + "in": "path", + "name": "template_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to create a new version of a template.**", + "operationId": "POST_templates-template_id-versions", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/transactional_template_version_create" + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "active": 1, + "editor": "code", + "generate_plain_content": true, + "html_content": "<%body%>", + "id": "8aefe0ee-f12b-4575-b5b7-c97e21cb36f3", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "ddb96bbc-9b92-425e-8979-99464621b543", + "updated_at": "2019-03-13 18:56:33" + } + } + }, + "schema": { + "$ref": "#/components/schemas/transactional_template_version_output" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a new transactional template version.", + "tags": [ + "Transactional Templates Versions" + ], + "x-stoplight": { + "id": "POST_templates-templateid-versions", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates/{template_id}/versions/{version_id}": { + "delete": { + "description": "**This endpoint allows you to delete a transactional template version.**", + "operationId": "DELETE_templates-template_id-versions-version_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a transactional template version.", + "tags": [ + "Transactional Templates Versions" + ], + "x-stoplight": { + "id": "DELETE_templates-templateid-versions-versionid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific version of a template.**", + "operationId": "GET_templates-template_id-versions-version_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "active": 1, + "editor": "code", + "generate_plain_content": true, + "html_content": "<%body%>", + "id": "8aefe0ee-f12b-4575-b5b7-c97e21cb36f3", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "ddb96bbc-9b92-425e-8979-99464621b543", + "updated_at": "2019-03-13 18:56:33" + } + } + }, + "schema": { + "$ref": "#/components/schemas/transactional_template_version_output" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific transactional template version.", + "tags": [ + "Transactional Templates Versions" + ], + "x-stoplight": { + "id": "GET_templates-templateid-versions-versionid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": " The ID of the original template", + "in": "path", + "name": "template_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + }, + { + "description": "The ID of the template version", + "in": "path", + "name": "version_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to edit the content of your template version.**", + "operationId": "PATCH_templates-template_id-versions-version_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/transactional_template_version_create" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "active": 1, + "editor": "code", + "generate_plain_content": true, + "html_content": "<%body%>", + "id": "8aefe0ee-f12b-4575-b5b7-c97e21cb36f3", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "ddb96bbc-9b92-425e-8979-99464621b543", + "updated_at": "2019-03-13 18:56:33" + } + } + }, + "schema": { + "$ref": "#/components/schemas/transactional_template_version_output" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Edit a transactional template version.", + "tags": [ + "Transactional Templates Versions" + ], + "x-stoplight": { + "id": "PATCH_templates-templateid-versions-versionid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates/{template_id}/versions/{version_id}/activate": { + "parameters": [ + { + "description": "The ID of the original template", + "in": "path", + "name": "template_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + }, + { + "description": "The ID of the template version", + "in": "path", + "name": "version_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to activate a version of one of your templates.**", + "operationId": "POST_templates-template_id-versions-version_id-activate", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "active": 1, + "editor": "code", + "generate_plain_content": true, + "html_content": "<%body%>", + "id": "8aefe0ee-f12b-4575-b5b7-c97e21cb36f3", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "ddb96bbc-9b92-425e-8979-99464621b543", + "updated_at": "2019-03-13 18:56:33" + } + } + }, + "schema": { + "$ref": "#/components/schemas/transactional_template_version_output" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Activate a transactional template version.", + "tags": [ + "Transactional Templates Versions" + ], + "x-stoplight": { + "id": "POST_templates-templateid-versions-versionid-activate", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/tracking_settings": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all tracking settings on your account.**", + "operationId": "GET_tracking_settings", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "description": "lorem ipsum... .", + "enabled": true, + "name": "open", + "title": "Open Tracking" + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "description": "The list of all tracking settings.", + "items": { + "properties": { + "description": { + "description": "A description about the event that is being tracked.", + "type": "string" + }, + "enabled": { + "description": "Indicates if this tracking setting is currently enabled.", + "type": "boolean" + }, + "name": { + "description": "The name of the event being tracked.", + "type": "string" + }, + "title": { + "description": "The title of the tracking setting.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Tracking Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "GET_trackingsettings", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/tracking_settings/click": { + "get": { + "description": "**This endpoint allows you to retrieve your current click tracking setting.**\n\nClick Tracking overrides all the links and URLs in your emails and points them to either SendGrid’s servers or the domain with which you branded your link. When a customer clicks a link, SendGrid tracks those [clicks](https://sendgrid.com/docs/glossary/clicks/).\n\nClick tracking helps you understand how users are engaging with your communications. SendGrid can track up to 1000 links per email", + "operationId": "GET_tracking_settings-click", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enable_text": false, + "enabled": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/click-tracking" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Click Track Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "GET_trackingsettings-click", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to enable or disable your current click tracking setting.**\n\nClick Tracking overrides all the links and URLs in your emails and points them to either SendGrid’s servers or the domain with which you branded your link. When a customer clicks a link, SendGrid tracks those [clicks](https://sendgrid.com/docs/glossary/clicks/).\n\nClick tracking helps you understand how users are engaging with your communications. SendGrid can track up to 1000 links per email", + "operationId": "PATCH_tracking_settings-click", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "enabled": true + }, + "properties": { + "enabled": { + "description": "The setting you want to use for click tracking.", + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enable_text": false, + "enabled": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/click-tracking" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Click Tracking Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "PATCH_trackingsettings-click", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/tracking_settings/google_analytics": { + "get": { + "description": "**This endpoint allows you to retrieve your current setting for Google Analytics.**\n\n\nGoogle Analytics helps you understand how users got to your site and what they're doing there. For more information about using Google Analytics, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on [\"Best Practices for Campaign Building\"](https://support.google.com/analytics/answer/1037445).\n\nWe default the settings to Google’s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/ui/analytics-and-reporting/google-analytics/).", + "operationId": "GET_tracking_settings-google_analytics", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "utm_campaign": "", + "utm_content": "lotsandlotsofcontent", + "utm_medium": "", + "utm_source": "", + "utm_term": "" + } + } + }, + "schema": { + "$ref": "#/components/schemas/google_analytics_settings" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Google Analytics Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "GET_trackingsettings-googleanalytics", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current setting for Google Analytics.**\n\nGoogle Analytics helps you understand how users got to your site and what they're doing there. For more information about using Google Analytics, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on [\"Best Practices for Campaign Building\"](https://support.google.com/analytics/answer/1037445).\n\nWe default the settings to Google’s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/ui/analytics-and-reporting/google-analytics/).", + "operationId": "PATCH_tracking_settings-google_analytics", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/google_analytics_settings" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "utm_campaign": "", + "utm_content": "lotsandlotsofcontent", + "utm_medium": "", + "utm_source": "", + "utm_term": "" + } + } + }, + "schema": { + "$ref": "#/components/schemas/google_analytics_settings" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Google Analytics Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "PATCH_trackingsettings-googleanalytics", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/tracking_settings/open": { + "get": { + "description": "**This endpoint allows you to retrieve your current settings for open tracking.**\n\nOpen Tracking adds an invisible image at the end of the email which can track email opens.\n\nIf the email recipient has images enabled on their email client, a request to SendGrid’s server for the invisible image is executed and an open event is logged.\n\nThese events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.", + "operationId": "GET_tracking_settings-open", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true + } + } + }, + "schema": { + "properties": { + "enabled": { + "description": "Indicates if open tracking is enabled.", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Open Tracking Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "GET_trackingsettings-open", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current settings for open tracking.**\n\nOpen Tracking adds an invisible image at the end of the email which can track email opens.\n\nIf the email recipient has images enabled on their email client, a request to SendGrid’s server for the invisible image is executed and an open event is logged.\n\nThese events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.", + "operationId": "PATCH_tracking_settings-open", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "enabled": true + }, + "properties": { + "enabled": { + "description": "The new status that you want to set for open tracking.", + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true + } + } + }, + "schema": { + "properties": { + "enabled": { + "description": "Indicates if open tracking is enabled.", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Open Tracking Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "PATCH_trackingsettings-open", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/tracking_settings/subscription": { + "get": { + "description": "**This endpoint allows you to retrieve your current settings for subscription tracking.**\n\nSubscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.", + "operationId": "GET_tracking_settings-subscription", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "html_content": "

Something something unsubscribe <% %> something something

\n", + "landing": "

subscribehere

\n", + "plain_content": "Something something unsubscribe <% %> something something", + "replace": "thetag", + "url": "http://mydomain.com/parse" + } + } + }, + "schema": { + "$ref": "#/components/schemas/subscription_tracking_settings" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Subscription Tracking Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "GET_trackingsettings-subscription", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current settings for subscription tracking.**\n\nSubscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.", + "operationId": "PATCH_tracking_settings-subscription", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/subscription_tracking_settings" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "enabled": true, + "html_content": "html content", + "landing": "landing page html", + "plain_content": "text content", + "replace": "replacement tag", + "url": "http://mydomain.com/parse" + } + } + }, + "schema": { + "$ref": "#/components/schemas/subscription_tracking_settings" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Subscription Tracking Settings", + "tags": [ + "Settings - Tracking" + ], + "x-stoplight": { + "id": "PATCH_trackingsettings-subscription", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/user/account": { + "get": { + "description": "**This endpoint allows you to retrieve your user account details.**\n\nYour user's account information includes the user's account type and reputation.", + "operationId": "GET_user-account", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "reputation": 100, + "type": "paid" + } + } + }, + "schema": { + "properties": { + "reputation": { + "description": "The sender reputation for this user.", + "type": "number" + }, + "type": { + "description": "The type of account for this user.", + "enum": [ + "free", + "paid" + ], + "type": "string" + } + }, + "required": [ + "type", + "reputation" + ], + "title": "GET User Account response", + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get a user's account information.", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "GET_user-account", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/credits": { + "get": { + "description": "**This endpoint allows you to retrieve the current credit balance for your account.**\n\nEach 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](https://sendgrid.com/docs/ui/account-and-settings/billing/).", + "operationId": "GET_user-credits", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "last_reset": "2013-01-01", + "next_reset": "2013-02-01", + "overage": 0, + "remain": 200, + "reset_frequency": "monthly", + "total": 200, + "used": 0 + } + } + }, + "schema": { + "properties": { + "last_reset": { + "description": "The date that your credit balance was last reset.", + "type": "string" + }, + "next_reset": { + "description": "The next date that your credit balance will be reset.", + "type": "string" + }, + "overage": { + "description": "The number of overdrawn credits for your account.", + "type": "integer" + }, + "remain": { + "description": "The remaining number of credits available on your account.", + "type": "integer" + }, + "reset_frequency": { + "description": "The frequency at which your credit balance will be reset.", + "type": "string" + }, + "total": { + "description": "The total number of credits assigned to your account.", + "type": "integer" + }, + "used": { + "description": "The number of credits that you have used.", + "type": "integer" + } + }, + "required": [ + "remain", + "total", + "overage", + "used", + "last_reset", + "next_reset", + "reset_frequency" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve your credit balance", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "GET_user-credits", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/email": { + "get": { + "description": "**This endpoint allows you to retrieve the email address currently on file for your account.**", + "operationId": "GET_user-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "test@example.com" + } + } + }, + "schema": { + "properties": { + "email": { + "description": "The email address currently on file for your account.", + "format": "email", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve your account email address", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "GET_user-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "put": { + "description": "**This endpoint allows you to update the email address currently on file for your account.**", + "operationId": "PUT_user-email", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "email": "example@example.com" + }, + "properties": { + "email": { + "description": "The new email address that you would like to use for your account.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "email": "example@example.com" + } + } + }, + "schema": { + "properties": { + "email": { + "description": "The current email address on file for your account.", + "format": "email", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update your account email address", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "PUT_user-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/password": { + "put": { + "description": "**This endpoint allows you to update your password.**", + "operationId": "PUT_user-password", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "new_password": "new_password", + "old_password": "old_password" + }, + "properties": { + "new_password": { + "description": "The new password you would like to use for your account.", + "type": "string" + }, + "old_password": { + "description": "The old password for your account.", + "type": "string" + } + }, + "required": [ + "new_password", + "old_password" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update your password", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "PUT_user-password", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/profile": { + "get": { + "operationId": "GET_user-profile", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "address": "814 West Chapman Avenue", + "address2": "", + "city": "Orange", + "company": "SendGrid", + "country": "US", + "first_name": "Test", + "last_name": "User", + "phone": "555-555-5555", + "state": "CA", + "website": "http://www.sendgrid.com", + "zip": "92868" + } + } + }, + "schema": { + "properties": { + "address": { + "description": "The user's address.", + "type": "string" + }, + "address2": { + "description": "The second line of the user's address.", + "type": "string" + }, + "city": { + "description": "The user's city.", + "type": "string" + }, + "company": { + "description": "The name of the user's company.", + "type": "string" + }, + "country": { + "description": "The user's country.", + "type": "string" + }, + "first_name": { + "description": "The user's first name.", + "type": "string" + }, + "last_name": { + "description": "The user's last name.", + "type": "string" + }, + "phone": { + "description": "The user's phone number.", + "type": "string" + }, + "state": { + "description": "The user's state.", + "type": "string" + }, + "website": { + "description": "The user's website URL.", + "type": "string" + }, + "zip": { + "description": "The user's zip code.", + "type": "string" + } + }, + "required": [ + "address", + "city", + "company", + "country", + "first_name", + "last_name", + "phone", + "state", + "website", + "zip" + ], + "title": "GET User Profile response", + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get a user's profile", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "GET_user-profile", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current profile details.**\n\nAny 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": "PATCH_user-profile", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user_profile" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "address": "814 West Chapman Avenue", + "address2": "", + "city": "Orange", + "company": "SendGrid", + "country": "US", + "first_name": "Example", + "last_name": "User", + "phone": "555-555-5555", + "state": "CA", + "website": "http://www.sendgrid.com", + "zip": "92868" + } + } + }, + "schema": { + "$ref": "#/components/schemas/user_profile" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + } + }, + "schema": { + "$ref": "#/components/schemas/global_error_response_schema" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a user's profile", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "PATCH_user-profile", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/scheduled_sends": { + "get": { + "description": "**This endpoint allows you to retrieve all cancelled and paused scheduled send information.**\n\nThis endpoint will return only the scheduled sends that are associated with a `batch_id`. If you have scheduled a send using the `/mail/send` endpoint and the `send_at` field but no `batch_id`, the send will be scheduled for delivery; however, it will not be returned by this endpoint. For this reason, you should assign a `batch_id` to any scheduled send you may need to pause or cancel in the future.", + "operationId": "GET_user-scheduled_sends", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "batch_id": "QzZmYzLTVWIwYgYzJlM2NhNWI", + "status": "cancel" + }, + { + "batch_id": "mQzZmYzLTVlM2NhNWIwYgYzJl", + "status": "cancel" + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/user_scheduled_send_status" + }, + "type": "array" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_cancelScheduledSendsErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all scheduled sends", + "tags": [ + "Cancel Scheduled Sends" + ], + "x-stoplight": { + "id": "GET_user-scheduledsends", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to cancel or pause a scheduled send associated with a `batch_id`.**\n\nPassing this endpoint a `batch_id` and status will cancel or pause the scheduled send.\n\nOnce a scheduled send is set to `pause` or `cancel` you must use the \"Update a scheduled send\" endpoint to change its status or the \"Delete a cancellation or pause from a scheduled send\" endpoint to remove the status. Passing a status change to a scheduled send that has already been paused or cancelled will result in a `400` level status code.\n\nIf the maximum number of cancellations/pauses are added to a send, a `400` level status code will be returned.", + "operationId": "POST_user-scheduled_sends", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "batch_id": "YOUR_BATCH_ID", + "status": "pause" + }, + "properties": { + "batch_id": { + "description": "The batch ID is the identifier that your scheduled mail sends share.", + "pattern": "^[a-zA-Z0-9]", + "type": "string" + }, + "status": { + "default": "pause", + "description": "The status of the send you would like to implement. This can be pause or cancel. To delete a pause or cancel status see DELETE /v3/user/scheduled_sends/{batch_id}", + "enum": [ + "pause", + "cancel" + ], + "type": "string" + } + }, + "required": [ + "batch_id", + "status" + ], + "title": "Cancel or pause a scheduled send request", + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user_scheduled_send_status" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_cancelScheduledSendsErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Cancel or pause a scheduled send", + "tags": [ + "Cancel Scheduled Sends" + ], + "x-stoplight": { + "id": "POST_user-scheduledsends", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/user/scheduled_sends/{batch_id}": { + "delete": { + "description": "**This endpoint allows you to delete the cancellation/pause of a scheduled send.**\n\nScheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.", + "operationId": "DELETE_user-scheduled_sends-batch_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_cancelScheduledSendsErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a cancellation or pause from a scheduled send", + "tags": [ + "Cancel Scheduled Sends" + ], + "x-stoplight": { + "id": "DELETE_user-scheduledsends-batchid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.**", + "operationId": "GET_user-scheduled_sends-batch_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi", + "status": "cancel" + }, + { + "batch_id": "IbLdyLYULb7Rj8GKSx7u025ouWVlAiMg", + "status": "pause" + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/user_scheduled_send_status" + }, + "title": "Retrieve scheduled send response", + "type": "array" + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_cancelScheduledSendsErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve scheduled send", + "tags": [ + "Cancel Scheduled Sends" + ], + "x-stoplight": { + "id": "GET_user-scheduledsends-batchid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "batch_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.**\n\nIf you have already set a `cancel` or `pause` status on a scheduled send using the \"Cancel or pause a scheduled send\" endpoint, you can update it's status using this endpoint. Attempting to update a status once it has been set with the \"Cancel or pause a scheduled send\" endpoint will result in a `400` error.", + "operationId": "PATCH_user-scheduled_sends-batch_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "status": "pause" + }, + "properties": { + "status": { + "description": "The status you would like the scheduled send to have.", + "enum": [ + "cancel", + "pause" + ], + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + } + } + }, + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "nullable": true + } + } + }, + "description": "" + }, + "400": { + "$ref": "#/components/responses/trait_cancelScheduledSendsErrors_400" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a scheduled send", + "tags": [ + "Cancel Scheduled Sends" + ], + "x-stoplight": { + "id": "PATCH_user-scheduledsends-batchid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/settings/enforced_tls": { + "get": { + "description": "**This endpoint allows you to retrieve your current Enforced TLS settings.**\n\nThe Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate.\n\nIf either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description.", + "operationId": "GET_user-settings-enforced_tls", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "require_tls": false, + "require_valid_cert": false + } + } + }, + "schema": { + "$ref": "#/components/schemas/enforced-tls-request-response" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve current Enforced TLS settings.", + "tags": [ + "Settings - Enforced TLS" + ], + "x-stoplight": { + "id": "GET_user-settings-enforcedtls", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your Enforced TLS settings.**\n\nTo require TLS from recipients, set `require_tls` to `true`. If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description.\n\n> Twilio SendGrid supports TLS 1.1 and higher and does not support older versions of TLS due to security vulnerabilities.", + "operationId": "PATCH_user-settings-enforced_tls", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/enforced-tls-request-response" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "require_tls": true, + "require_valid_cert": false + } + } + }, + "schema": { + "$ref": "#/components/schemas/enforced-tls-request-response" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Enforced TLS settings", + "tags": [ + "Settings - Enforced TLS" + ], + "x-stoplight": { + "id": "PATCH_user-settings-enforcedtls", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/username": { + "get": { + "description": "**This endpoint allows you to retrieve your current account username.**", + "operationId": "GET_user-username", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "user_id": 1, + "username": "test_username" + } + } + }, + "schema": { + "properties": { + "user_id": { + "description": "The user ID for your account.", + "type": "integer" + }, + "username": { + "description": "Your account username.", + "type": "string" + } + }, + "required": [ + "username", + "user_id" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve your username", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "GET_user-username", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "put": { + "description": "**This endpoint allows you to update the username for your account.**", + "operationId": "PUT_user-username", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "username": "test_username" + }, + "properties": { + "username": { + "description": "The new username you would like to use for your account.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "username": "test_username" + } + } + }, + "schema": { + "properties": { + "username": { + "description": "The current username on file for your account.", + "type": "string" + } + }, + "required": [ + "username" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update your username", + "tags": [ + "Users API" + ], + "x-stoplight": { + "id": "PUT_user-username", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/event/settings": { + "get": { + "description": "**This endpoint allows you to retrieve your current event webhook settings.**\n\nIf an event type is marked as `true`, then the event webhook will include information about that event.\n\nSendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.\n\nCommon 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": "GET_user-webhooks-event-settings", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "bounce": false, + "click": true, + "deferred": false, + "delivered": false, + "dropped": true, + "enabled": false, + "group_resubscribe": false, + "group_unsubscribe": false, + "oauth_client_id": "est fugiat", + "oauth_token_url": "Duis in laborum sunt", + "open": true, + "processed": false, + "spam_report": false, + "unsubscribe": true, + "url": "incididunt reprehenderit" + } + } + }, + "schema": { + "$ref": "#/components/schemas/event-webhook-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Event Webhook settings", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "id": "GET_user-webhooks-event-settings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to update your current event webhook settings.**\n\nIf an event type is marked as `true`, then the event webhook will include information about that event.\n\nSendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.\n\nCommon 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": "PATCH_user-webhooks-event-settings", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/event-webhook-update-oauth-request" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "bounce": true, + "click": false, + "deferred": true, + "delivered": true, + "dropped": true, + "enabled": true, + "group_resubscribe": false, + "group_unsubscribe": true, + "oauth_client_id": "anim sunt", + "oauth_token_url": "ex", + "open": true, + "processed": true, + "spam_report": true, + "unsubscribe": true, + "url": "mollit laborum" + } + } + }, + "schema": { + "$ref": "#/components/schemas/event-webhook-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Event Notification Settings", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "id": "PATCH_user-webhooks-event-settings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/event/settings/signed": { + "get": { + "description": "**This endpoint allows you to retrieve your signed webhook's public key.**\n\nOnce 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.\n\nFor more information about cryptographically signing the Event Webhook, see [Getting Started with the Event Webhook Security Features](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features).", + "operationId": "GET_user-webhooks-event-settings-signed", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "public_key": "anim quis in sint" + } + } + }, + "schema": { + "properties": { + "public_key": { + "description": "The public key you can use to verify the Twilio SendGrid signature.", + "type": "string" + } + }, + "required": [ + "public_key" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Signed Webhook Public Key", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "id": "GET_user-webhooks-event-settings-signed", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "patch": { + "description": "**This endpoint allows you to enable or disable signing of the Event Webhook.**\n\nThis 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.\n\nFor more information about cryptographically signing the Event Webhook, see [Getting Started with the Event Webhook Security Features](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features).", + "operationId": "PATCH_user-webhooks-event-settings-signed", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "enabled": true + }, + "properties": { + "enabled": { + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "public_key": "voluptate id Excepteur proident" + } + } + }, + "schema": { + "properties": { + "public_key": { + "description": "The public key you can use to verify the Twilio SendGrid signature.", + "type": "string" + } + }, + "required": [ + "public_key" + ], + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "anim Ut", + "message": "mollit consequat dolore commodo" + }, + { + "message": "qui" + }, + { + "message": "commodo dolor ipsum" + }, + { + "field": "quis consectetur eiusmod ullamco laboris", + "message": "minim fugiat amet" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "field": "in proident", + "message": "fugiat" + }, + { + "field": "ut", + "message": "adipisicing veniam laboris sunt ullamco" + }, + { + "message": "id sunt consequat Duis irure" + }, + { + "field": "in qui", + "message": "nisi" + }, + { + "message": "tempor in eiusmod elit" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "Excepteur culpa esse ea ut" + }, + { + "message": "enim Excepteur dolore dolore" + }, + { + "message": "dolor occaecat" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "nullable": true, + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Enable/Disable Signed Webhook", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "id": "PATCH_user-webhooks-event-settings-signed", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/event/test": { + "post": { + "description": "**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.**\n\nSendGrid’s Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.\n\nCommon 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.\n\n>**Tip**: Retry logic for this endpoint differs from other endpoints, which use a rolling 24-hour retry.\n\nIf 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": "POST_user-webhooks-event-test", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "oauth_client_id": "nisi", + "oauth_client_secret": "veniam commodo ex sunt", + "oauth_token_url": "dolor Duis", + "url": "mollit non ipsum magna" + }, + "properties": { + "oauth_client_id": { + "description": "The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token. When passing data in this field, you must also include the oauth_client_secret and oauth_token_url fields.", + "type": "string" + }, + "oauth_client_secret": { + "description": "This secret is needed only once to create an access token. SendGrid will store this secret, allowing you to update your Client ID and Token URL without passing the secret to SendGrid again. When passing data in this field, you must also include the oauth_client_id and oauth_token_url fields.", + "type": "string" + }, + "oauth_token_url": { + "description": "The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the oauth_client_id and oauth_client_secret fields.", + "type": "string" + }, + "url": { + "description": "The URL where you would like the test notification to be sent.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "204": { + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Test Event Notification Settings", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "id": "POST_user-webhooks-event-test", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/parse/settings": { + "get": { + "description": "**This endpoint allows you to retrieve all of your current inbound parse settings.**", + "operationId": "GET_user-webhooks-parse-settings", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": [ + { + "hostname": "mail.mydomain.com", + "send_raw": true, + "spam_check": true, + "url": "http://mydomain.com/parse" + } + ] + } + } + }, + "schema": { + "properties": { + "result": { + "description": "The list of your current inbound parse settings.", + "items": { + "$ref": "#/components/schemas/parse-setting" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all parse settings", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "id": "GET_user-webhooks-parse-settings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new inbound parse setting.**\n\nCreating an Inbound Parse setting requires two pieces of information: a `url` and a `hostname`.\n\nThe `hostname` must correspond to a domain authenticated by Twilio SendGrid on your account. If you need to complete domain authentication, you can use the [Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth) or the \"Authenticate a domain\" endpoint. See \"[How to Set Up Domain Authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)\" for instructions.\n\nAny email received by the `hostname` will be parsed when you complete this setup. You must also add a Twilio SendGrid MX record to this domain's DNS records. See \"[Setting up the Inbound Parse Webhook](https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/)\" for full instructions.\n\nThe `url` represents a location where the parsed message data will be delivered. Twilio SendGrid will make an HTTP POST request to this `url` with the message data. The `url` must be publicly reachable, and your application must return a `200` status code to signal that the message data has been received.", + "operationId": "POST_user-webhooks-parse-settings", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/parse-setting" + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "hostname": "myhostname.com", + "send_raw": true, + "spam_check": false, + "url": "http://email.myhostname.com" + } + } + }, + "schema": { + "$ref": "#/components/schemas/parse-setting" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a parse setting", + "tags": [ + "Settings - Inbound Parse" + ], + "x-stoplight": { + "id": "POST_user-webhooks-parse-settings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/parse/settings/{hostname}": { + "delete": { + "description": "**This endpoint allows you to delete a specific inbound parse setting by hostname.**\n\nYou can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint.", + "operationId": "DELETE_user-webhooks-parse-settings-hostname", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a parse setting", + "tags": [ + "Settings - Inbound Parse" + ], + "x-stoplight": { + "id": "DELETE_user-webhooks-parse-settings-hostname", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific inbound parse setting by hostname.**\n\nYou can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint.", + "operationId": "GET_user-webhooks-parse-settings-hostname", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "hostname": "mail.mydomain.com", + "send_raw": true, + "spam_check": true, + "url": "http://mydomain.com/parse" + } + } + }, + "schema": { + "$ref": "#/components/schemas/parse-setting" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific parse setting", + "tags": [ + "Settings - Inbound Parse" + ], + "x-stoplight": { + "id": "GET_user-webhooks-parse-settings-hostname", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The hostname associated with the inbound parse setting that you would like to retrieve.", + "in": "path", + "name": "hostname", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update a specific inbound parse setting by hostname.**\n\nYou can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint.", + "operationId": "PATCH_user-webhooks-parse-settings-hostname", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/parse-setting" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "hostname": "mail.mydomain.com", + "send_raw": true, + "spam_check": true, + "url": "http://mydomain.com/parse" + } + } + }, + "schema": { + "$ref": "#/components/schemas/parse-setting" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a parse setting", + "tags": [ + "Settings - Inbound Parse" + ], + "x-stoplight": { + "id": "PATCH_user-webhooks-parse-settings-hostname", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/parse/stats": { + "get": { + "description": "**This endpoint allows you to retrieve the statistics for your Parse Webhook useage.**\n\nSendGrid'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.\n\nThere 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](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries).", + "operationId": "GET_user-webhooks-parse-stats", + "parameters": [ + { + "description": "The number of statistics to return on each page.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "The number of statistics to skip.", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "How you would like the statistics to by grouped. ", + "in": "query", + "name": "aggregated_by", + "required": false, + "schema": { + "enum": [ + "day", + "week", + "month" + ], + "type": "string" + } + }, + { + "description": "The starting date of the statistics you want to retrieve. Must be in the format YYYY-MM-DD", + "in": "query", + "name": "start_date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end date of the statistics you want to retrieve. Must be in the format YYYY-MM-DD", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "default": "The day the request is made.", + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "date": "2015-10-11", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-12", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-13", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-14", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-15", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-16", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-17", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-18", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-19", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-20", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-21", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-22", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-23", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-24", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-25", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-26", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-27", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-28", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-29", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-30", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-10-31", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-01", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-02", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-03", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-04", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-05", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-06", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-07", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-08", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-09", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + }, + { + "date": "2015-11-10", + "stats": [ + { + "metrics": { + "received": 0 + } + } + ] + } + ] + } + }, + "schema": { + "items": { + "properties": { + "date": { + "description": "The date that the stats were collected.", + "type": "string" + }, + "stats": { + "description": "The Parse Webhook usage statistics.", + "items": { + "properties": { + "metrics": { + "properties": { + "received": { + "description": "The number of emails received and parsed by the Parse Webhook.", + "type": "number" + } + }, + "required": [ + "received" + ], + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "date", + "stats" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieves Inbound Parse Webhook statistics.", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "id": "GET_user-webhooks-parse-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/validations/email": { + "post": { + "description": "**This endpoint allows you to validate an email address.**", + "operationId": "POST_validations-email", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "email": "example@example.com", + "source": "signup" + }, + "properties": { + "email": { + "description": "The email address that you want to validate.", + "type": "string" + }, + "source": { + "description": "A one-word classifier for where this validation originated.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "result": { + "checks": { + "additional": { + "has_known_bounces": false, + "has_suspected_bounces": false + }, + "domain": { + "has_mx_or_a_record": true, + "has_valid_address_syntax": true, + "is_suspected_disposable_address": false + }, + "local_part": { + "is_suspected_role_address": false + } + }, + "email": "cedric@fogowl.com", + "host": "fogowl.com", + "ip_address": "192.168.1.1", + "local": "cedric", + "score": 0.85021, + "verdict": "Valid" + } + } + } + }, + "schema": { + "properties": { + "result": { + "properties": { + "checks": { + "description": "Granular checks for email address validity.", + "properties": { + "additional": { + "description": "Additional checks on the email address.", + "properties": { + "has_known_bounces": { + "description": "WHether email sent to this address from your account has bounced.", + "type": "boolean" + }, + "has_suspected_bounces": { + "description": "Whether our model predicts that the email address might bounce.", + "type": "boolean" + } + }, + "required": [ + "has_known_bounces", + "has_suspected_bounces" + ], + "type": "object" + }, + "domain": { + "description": "Checks on the domain portion of the email address.", + "properties": { + "has_mx_or_a_record": { + "description": "Whether the email has appropriate DNS records to deliver a message. ", + "type": "boolean" + }, + "has_valid_address_syntax": { + "description": "Whether the email address syntax is valid.", + "type": "boolean" + }, + "is_suspected_disposable_address": { + "description": "Whether the domain appears to be from a disposable email address service.", + "type": "boolean" + } + }, + "required": [ + "has_valid_address_syntax", + "has_mx_or_a_record", + "is_suspected_disposable_address" + ], + "type": "object" + }, + "local_part": { + "description": "Checks on the local part of the email address.", + "properties": { + "is_suspected_role_address": { + "description": "Whether the local part of email appears to be a role or group (e.g., hr, admin)", + "type": "boolean" + } + }, + "required": [ + "is_suspected_role_address" + ], + "type": "object" + } + }, + "required": [ + "domain", + "local_part", + "additional" + ], + "type": "object" + }, + "email": { + "description": "The email being validated", + "format": "email", + "type": "string" + }, + "host": { + "description": "The domain of the email address.", + "format": "hostname", + "type": "string" + }, + "ip_address": { + "description": "The IP address associated with this email.", + "type": "string" + }, + "local": { + "description": "The local part of the email address.", + "type": "string" + }, + "score": { + "description": "A numeric representation of the email validity.", + "type": "number" + }, + "source": { + "description": "The source of the validation, as per the API request.", + "type": "string" + }, + "suggestion": { + "description": "A suggested correction in the event of domain name typos (e.g., gmial.com)", + "type": "string" + }, + "verdict": { + "description": "A generic classification of whether or not the email address is valid.", + "enum": [ + "Valid", + "Risky", + "Invalid" + ], + "type": "string" + } + }, + "required": [ + "email", + "verdict", + "score", + "local", + "host", + "checks", + "ip_address" + ], + "type": "object" + } + }, + "required": [ + "result" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate an email", + "tags": [ + "Email Address Validation" + ], + "x-stoplight": { + "id": "POST_validations-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/verified_senders": { + "get": { + "description": "**This endpoint allows you to retrieve all the Sender Identities associated with an account.**\n\nThis endpoint will return both verified and unverified senders.\n\nYou can limit the number of results returned using the `limit`, `lastSeenID`, and `id` query string parameters.\n\n* `limit` allows you to specify an exact number of Sender Identities to return.\n* `lastSeenID` will return senders with an ID number occuring after the passed in ID. In other words, the `lastSeenID` provides a starting point from which SendGrid will iterate to find Sender Identities associated with your account.\n* `id` will return information about only the Sender Identity passed in the request.", + "operationId": "GET_verified_senders", + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "number" + } + }, + { + "in": "query", + "name": "lastSeenID", + "schema": { + "type": "number" + } + }, + { + "in": "query", + "name": "id", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "results": [ + { + "address": "1234 Fake St.", + "address2": "PO Box 1234", + "city": "San Francisco", + "country": "USA", + "from_email": "orders@example.com", + "from_name": "Example Orders", + "id": 1234, + "locked": false, + "nickname": "Example Orders", + "reply_to": "orders@example.com", + "reply_to_name": "Example Orders", + "state": "CA", + "verified": true, + "zip": "94105" + }, + { + "address": "1234 Fake St.", + "address2": "PO Box 1234", + "city": "San Francisco", + "country": "USA", + "from_email": "support@example.com", + "from_name": "Example Support", + "id": 1235, + "locked": false, + "nickname": "Example Support", + "reply_to": "support@example.com", + "reply_to_name": "Example Support", + "state": "CA", + "verified": true, + "zip": "94105" + } + ] + } + } + }, + "schema": { + "properties": { + "results": { + "items": { + "$ref": "#/components/schemas/verified-sender-response-schema" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get All Verified Senders", + "tags": [ + "Sender Verification" + ], + "x-stoplight": { + "id": "GET_verifiedsenders", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new Sender Identify**.\n\nUpon successful submission of a `POST` request to this endpoint, an identity will be created, and a verification email will be sent to the address assigned to the `from_email` field. You must complete the verification process using the sent email to fully verify the sender.\n\nIf you need to resend the verification email, you can do so with the Resend Verified Sender Request, `/resend/{id}`, endpoint.\n\nIf you need to authenticate a domain rather than a Single Sender, see the [Domain Authentication API](https://sendgrid.api-docs.io/v3.0/domain-authentication/authenticate-a-domain).", + "operationId": "POST_verified_senders", + "requestBody": { + "$ref": "#/components/requestBodies/verified-sender-request-schema" + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "address": "1234 Fake St.", + "address2": "PO Box 1234", + "city": "San Francisco", + "country": "USA", + "from_email": "orders@example.com", + "from_name": "Example Orders", + "id": 1234, + "locked": false, + "nickname": "Example Orders", + "reply_to": "orders@example.com", + "reply_to_name": "Example Orders", + "state": "CA", + "verified": true, + "zip": "94105" + } + } + }, + "schema": { + "$ref": "#/components/schemas/verified-sender-response-schema" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create Verified Sender Request", + "tags": [ + "Sender Verification" + ], + "x-stoplight": { + "id": "POST_verifiedsenders", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/verified_senders/domains": { + "get": { + "description": "**This endpoint returns a list of domains known to implement DMARC and categorizes them by failure type — hard failure or soft failure**.\n\nDomains listed as hard failures will not deliver mail when used as a [Sender Identity](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/) due to the domain's DMARC policy settings.\n\nFor example, using a `yahoo.com` email address as a Sender Identity will likely result in the rejection of your mail. For more information about DMARC, see [Everything about DMARC](https://sendgrid.com/docs/ui/sending-email/dmarc/).", + "operationId": "GET_verified_senders-domains", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "results": { + "hard_failures": [ + "yahoo.com" + ], + "soft_failures": [ + "gmail.com" + ] + } + } + } + }, + "schema": { + "properties": { + "results": { + "properties": { + "hard_failures": { + "items": { + "type": "string" + }, + "type": "array" + }, + "soft_failures": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "soft_failures", + "hard_failures" + ], + "type": "object" + } + }, + "required": [ + "results" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Domain Warn List", + "tags": [ + "Sender Verification" + ], + "x-stoplight": { + "id": "GET_verifiedsenders-domains", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/verified_senders/resend/{id}": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to resend a verification email to a specified Sender Identity**.\n\nPassing the `id` assigned to a Sender Identity to this endpoint will resend a verification email to the `from_address` associated with the Sender Identity. This can be useful if someone loses their verification email or needs to have it resent for any other reason.\n\nYou can retrieve the IDs associated with Sender Identities by passing a \"Get All Verified Senders\" endpoint.", + "operationId": "POST_verified_senders-resend-id", + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Resend Verified Sender Request", + "tags": [ + "Sender Verification" + ], + "x-stoplight": { + "id": "POST_verifiedsenders-resend-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/verified_senders/steps_completed": { + "get": { + "description": "**This endpoint allows you to determine which of SendGrid’s verification processes have been completed for an account**.\n\nThis endpoint returns boolean values, `true` and `false`, for [Domain Authentication](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/#domain-authentication), `domain_verified`, and [Single Sender Verification](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/#single-sender-verification), `sender_verified`, for the account.\n\nAn account may have one, both, or neither verification steps completed. If you need to authenticate a domain rather than a Single Sender, see the \"Authenticate a domain\" endpoint.", + "operationId": "GET_verified_senders-steps_completed", + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "results": { + "domain_verified": true, + "sender_verified": true + } + } + } + }, + "schema": { + "properties": { + "results": { + "properties": { + "domain_verified": { + "type": "boolean" + }, + "sender_verified": { + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "$ref": "#/components/responses/trait_globalErrors_404" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Completed Steps", + "tags": [ + "Sender Verification" + ], + "x-stoplight": { + "id": "GET_verifiedsenders-stepscompleted", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/verified_senders/verify/{token}": { + "get": { + "description": "**This endpoint allows you to verify a sender requests.**\n\nThe token is generated by SendGrid and included in a verification email delivered to the address that's pending verification.", + "operationId": "GET_verified_senders-verify-token", + "responses": { + "204": { + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "$ref": "#/components/responses/trait_globalErrors_403" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Verify Sender Request", + "tags": [ + "Sender Verification" + ], + "x-stoplight": { + "id": "GET_verifiedsenders-verify-token", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "token", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/verified_senders/{id}": { + "delete": { + "description": "**This endpoint allows you to delete a Sender Identity**.\n\nPass the `id` assigned to a Sender Identity to this endpoint to delete the Sender Identity from your account.\n\nYou can retrieve the IDs associated with Sender Identities using the \"Get All Verified Senders\" endpoint.", + "operationId": "DELETE_verified_senders-id", + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Verified Sender", + "tags": [ + "Sender Verification" + ], + "x-stoplight": { + "id": "DELETE_verifiedsenders-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update an existing Sender Identity**.\n\nPass the `id` assigned to a Sender Identity to this endpoint as a path parameter. Include any fields you wish to update in the request body in JSON format.\n\nYou can retrieve the IDs associated with Sender Identities by passing a `GET` request to the Get All Verified Senders endpoint, `/verified_senders`.\n\n**Note:** Unlike a `PUT` request, `PATCH` allows you to update only the fields you wish to edit. Fields that are not passed as part of a request will remain unaltered.", + "operationId": "PATCH_verified_senders-id", + "requestBody": { + "$ref": "#/components/requestBodies/verified-sender-request-schema" + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "address": "1234 Fake St.", + "address2": "PO Box 1234", + "city": "San Francisco", + "country": "USA", + "from_email": "orders@example.com", + "from_name": "Example Orders", + "id": 1234, + "locked": false, + "nickname": "Example Orders", + "reply_to": "orders@example.com", + "reply_to_name": "Example Orders", + "state": "CA", + "verified": true, + "zip": "94105" + } + } + }, + "schema": { + "$ref": "#/components/schemas/verified-sender-response-schema" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "401": { + "$ref": "#/components/responses/trait_globalErrors_401" + }, + "403": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "error_id": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message", + "error_id" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "$ref": "#/components/responses/trait_globalErrors_500" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Edit Verified Sender", + "tags": [ + "Sender Verification" + ], + "x-stoplight": { + "id": "PATCH_verifiedsenders-id", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/whitelabel/dns/email": { + "post": { + "description": "**This endpoint is used to share DNS records with a colleagues**\n\nUse this endpoint to send SendGrid-generated DNS record information to a co-worker so they can enter it into your DNS provider to validate your domain and link branding. \n\nWhat type of records are sent will depend on whether you have chosen Automated Security or not. When using Automated Security, SendGrid provides you with three CNAME records. If you turn Automated Security off, you are instead given TXT and MX records.\n\nIf you pass a `link_id` to this endpoint, the generated email will supply the DNS records necessary to complete [Link Branding](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) setup. If you pass a `domain_id` to this endpoint, the generated email will supply the DNS records needed to complete [Domain Authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Passing both IDs will generate an email with the records needed to complete both setup steps.\n\nYou can retrieve all your domain IDs from the returned `id` fields for each domain using the \"List all authenticated domains\" endpoint. You can retrieve all of your link IDs using the \"Retrieve all branded links\" endpoint.", + "operationId": "POST_whitelabel-dns-email", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "domain_id": 46873408, + "email": "my_colleague@example.com", + "link_id": 29719392, + "message": "DNS Record for verification" + }, + "properties": { + "domain_id": { + "description": "The ID of your SendGrid domain record.", + "minimum": 0, + "type": "integer" + }, + "email": { + "description": "The email address to send the DNS information to.", + "format": "email", + "type": "string" + }, + "link_id": { + "description": "The ID of the branded link.", + "minimum": 0, + "type": "integer" + }, + "message": { + "default": "Please set these DNS records in our hosting solution.", + "description": "A custom text block to include in the email body sent with the records.", + "type": "string" + } + }, + "required": [ + "link_id", + "domain_id", + "email" + ], + "type": "object" + } + } + } + }, + "responses": { + "204": { + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "errors": { + "properties": { + "error": { + "type": "string" + }, + "field": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Email DNS records to a co-worker", + "tags": [ + "Email CNAME records" + ], + "x-stoplight": { + "id": "POST_whitelabel-dns-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/whitelabel/domains": { + "get": { + "description": "**This endpoint allows you to retrieve a list of all domains you have authenticated.**", + "operationId": "GET_whitelabel-domains", + "parameters": [ + { + "description": "Number of domains to return.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "Paging offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "description": "Exclude subuser domains from the result.", + "in": "query", + "name": "exclude_subusers", + "schema": { + "type": "boolean" + } + }, + { + "description": "The username associated with an authenticated domain.", + "in": "query", + "name": "username", + "schema": { + "type": "string" + } + }, + { + "description": "Search for authenticated domains.", + "in": "query", + "name": "domain", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "automatic_security": true, + "custom_spf": true, + "default": true, + "dns": { + "dkim1": { + "data": "s1._domainkey.u7.wl.sendgrid.net", + "host": "s1._domainkey.example.com", + "type": "cname", + "valid": true + }, + "dkim2": { + "data": "s2._domainkey.u7.wl.sendgrid.net", + "host": "s2._domainkey.example.com", + "type": "cname", + "valid": true + }, + "mail_cname": { + "data": "u7.wl.sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "ips": [ + "192.168.1.1", + "192.168.1.2" + ], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "jane@example.com", + "valid": true + }, + { + "automatic_security": true, + "custom_spf": false, + "default": true, + "dns": { + "dkim1": { + "data": "k=rsa; t=s; p=publicKey", + "host": "example2.com", + "type": "txt", + "valid": false + }, + "dkim2": { + "data": "k=rsa; t=s p=publicKey", + "host": "example2.com", + "type": "txt", + "valid": false + }, + "mail_cname": { + "data": "sendgrid.net", + "host": "news.example2.com", + "type": "mx", + "valid": false + } + }, + "domain": "example2.com", + "id": 2, + "ips": [], + "legacy": false, + "subdomain": "new", + "user_id": 8, + "username": "john@example2.com", + "valid": false + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/domain-authentication-200-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "List all authenticated domains", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "GET_whitelabel-domains", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to authenticate a domain.**\n\nIf you are authenticating a domain for a subuser, you have two options:\n1. Use the \"username\" parameter. This allows you to authenticate a domain on behalf of your subuser. This means the subuser is able to see and modify the authenticated domain.\n2. Use the Association workflow (see Associate Domain section). This allows you to authenticate a domain created by the parent to a subuser. This means the subuser will default to the assigned domain, but will not be able to see or modify that authenticated domain. However, if the subuser authenticates their own domain it will overwrite the assigned domain.", + "operationId": "POST_whitelabel-domains", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "automatic_security": false, + "custom_spf": true, + "default": true, + "domain": "example.com", + "ips": [ + "192.168.1.1", + "192.168.1.2" + ], + "subdomain": "news", + "username": "john@example.com" + }, + "properties": { + "automatic_security": { + "description": "Whether to allow SendGrid to manage your SPF records, DKIM keys, and DKIM key rotation.", + "type": "boolean" + }, + "custom_dkim_selector": { + "description": "Add a custom DKIM selector. Accepts three letters or numbers.", + "type": "string" + }, + "custom_spf": { + "description": "Specify whether to use a custom SPF or allow SendGrid to manage your SPF. This option is only available to authenticated domains set up for manual security.", + "type": "boolean" + }, + "default": { + "description": "Whether to use this authenticated domain as the fallback if no authenticated domains match the sender's domain.", + "type": "boolean" + }, + "domain": { + "description": "Domain being authenticated.", + "type": "string" + }, + "ips": { + "description": "The IP addresses that will be included in the custom SPF record for this authenticated domain.", + "items": { + "type": "string" + }, + "type": "array" + }, + "subdomain": { + "description": "The subdomain to use for this authenticated domain.", + "type": "string" + }, + "username": { + "description": "The username associated with this domain.", + "type": "string" + } + }, + "required": [ + "domain" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "automatic_security": true, + "custom_spf": false, + "default": true, + "dns": { + "dkim1": { + "data": "s1.domainkey.u1446226.wl.sendgrid.net", + "host": "s1._domainkey.example.com", + "type": "cname", + "valid": false + }, + "dkim2": { + "data": "s2.domainkey.u1446226.wl.sendgrid.net", + "host": "s2._domainkey.example.com", + "type": "cname", + "valid": false + }, + "mail_cname": { + "data": "u1446226.wl.sendgrid.net", + "host": "example.example.com", + "type": "cname", + "valid": false + } + }, + "domain": "example.com", + "id": 302183, + "ips": [], + "legacy": false, + "subdomain": "example", + "user_id": 1446226, + "username": "mbernier", + "valid": false + } + } + }, + "schema": { + "$ref": "#/components/schemas/authentication_domain" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Authenticate a domain", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "POST_whitelabel-domains", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/domains/default": { + "get": { + "description": "**This endpoint allows you to retrieve the default authentication for a domain.**\n\nWhen creating or updating a domain authentication, you can set the domain as a default. The default domain will be used to send all mail. If you have multiple authenticated domains, the authenticated domain matching the domain of the From address will be used, and the default will be overridden.\n\nThis endpoint will return a default domain and its details only if a default is set. You are not required to set a default. If you do not set a default domain, this endpoint will return general information about your domain authentication status.", + "operationId": "GET_whitelabel-domains-default", + "parameters": [ + { + "description": "The domain to find a default authentication.", + "in": "query", + "name": "domain", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "automatic_security": true, + "custom_spf": true, + "default": true, + "dns": { + "dkim1": { + "data": "s1._domainkey.u7.wl.sendgrid.net", + "host": "s1._domainkey.example.com", + "type": "cname", + "valid": true + }, + "dkim2": { + "data": "s2._domainkey.u7.wl.sendgrid.net", + "host": "s2._domainkey.example.com", + "type": "cname", + "valid": true + }, + "mail_cname": { + "data": "u7.wl.sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "ips": [ + "192.168.1.1", + "192.168.1.2" + ], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "jane@example.com", + "valid": true + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/domain-authentication-200-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get the default authentication", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "GET_whitelabel-domains-default", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/domains/subuser": { + "delete": { + "description": "**This endpoint allows you to disassociate a specific authenticated domain from a subuser.**\n\nAuthenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools.", + "operationId": "DELETE_whitelabel-domains-subuser", + "parameters": [ + { + "description": "Username for the subuser to find associated authenticated domain.", + "in": "query", + "name": "username", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Disassociate an authenticated domain from a given user.", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "DELETE_whitelabel-domains-subuser", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve all of the authenticated domains that have been assigned to a specific subuser.**\n\nAuthenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools.", + "operationId": "GET_whitelabel-domains-subuser", + "parameters": [ + { + "description": "Username for the subuser to find associated authenticated domain.", + "in": "query", + "name": "username", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "automatic_security": false, + "custom_spf": true, + "default": false, + "dns": { + "dkim": { + "data": "k=rsa; t=s; p=publicKey", + "host": "s1._domainkey.example.com", + "type": "txt", + "valid": false + }, + "domain_spf": { + "data": "v=spf1 include:mail.example.com -all", + "host": "example.com", + "type": "txt", + "valid": false + }, + "mail_server": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "mx", + "valid": false + }, + "subdomain_spf": { + "data": "v=spf1 ip4:192.168.1.1 ip4:192.168.0.1 -all", + "host": "mail.example.com", + "type": "txt", + "valid": false + } + }, + "domain": "example.com", + "id": 1, + "ips": [], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "mail@example.com", + "valid": false + } + } + }, + "schema": { + "$ref": "#/components/schemas/domain_authentication_domain_spf" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "List the authenticated domain associated with the given user.", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "GET_whitelabel-domains-subuser", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/whitelabel/domains/{domain_id}": { + "delete": { + "description": "**This endpoint allows you to delete an authenticated domain.**", + "operationId": "DELETE_whitelabel-domains-domain_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete an authenticated domain.", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "DELETE_whitelabel-domains-domainid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific authenticated domain.**", + "operationId": "GET_whitelabel-domains-domain_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "automatic_security": true, + "custom_spf": false, + "default": true, + "dns": { + "dkim1": { + "data": "s1._domainkey.u7.wl.sendgrid.net", + "host": "s1._domainkey.example.com", + "type": "cname", + "valid": true + }, + "dkim2": { + "data": "s2._domainkey.u7.wl.sendgrid.net", + "host": "s2._domainkey.example.com", + "type": "cname", + "valid": true + }, + "mail_cname": { + "data": "u7.wl.sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 45373692, + "ips": [ + "127.0.0.1" + ], + "legacy": false, + "subdomain": "sub", + "user_id": 66036447, + "username": "jdoe", + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/authentication_domain" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve an authenticated domain", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "GET_whitelabel-domains-domainid", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "domain_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update the settings for an authenticated domain.**", + "operationId": "PATCH_whitelabel-domains-domain_id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "custom_spf": true, + "default": false + }, + "properties": { + "custom_spf": { + "default": false, + "description": "Indicates whether to generate a custom SPF record for manual security.", + "type": "boolean" + }, + "default": { + "default": false, + "description": "Indicates whether this is the default authenticated domain.", + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "automatic_security": true, + "custom_spf": true, + "default": true, + "dns": { + "dkim1": { + "data": "s1._domainkey.u7.wl.sendgrid.net", + "host": "s1._domainkey.example.com", + "type": "cname", + "valid": true + }, + "dkim2": { + "data": "s2._domainkey.u7.wl.sendgrid.net", + "host": "s2._domainkey.example.com", + "type": "cname", + "valid": true + }, + "mail_cname": { + "data": "u7.wl.sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "ips": [ + "192.168.1.1", + "192.168.1.2" + ], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "jane@example.com", + "valid": true + }, + { + "automatic_security": true, + "custom_spf": false, + "default": true, + "dns": { + "dkim1": { + "data": "k=rsa; t=s; p=publicKey", + "host": "example2.com", + "type": "txt", + "valid": false + }, + "dkim2": { + "data": "k=rsa; t=s p=publicKey", + "host": "example2.com", + "type": "txt", + "valid": false + }, + "mail_cname": { + "data": "sendgrid.net", + "host": "news.example2.com", + "type": "mx", + "valid": false + } + }, + "domain": "example2.com", + "id": 2, + "ips": [], + "legacy": false, + "subdomain": "new", + "user_id": 8, + "username": "john@example2.com", + "valid": false + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/domain-authentication-200-response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update an authenticated domain", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "PATCH_whitelabel-domains-domainid", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/domains/{domain_id}/subuser": { + "parameters": [ + { + "description": "ID of the authenticated domain to associate with the subuser", + "in": "path", + "name": "domain_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "post": { + "description": "**This endpoint allows you to associate a specific authenticated domain with a subuser.**\n\nAuthenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools.", + "operationId": "POST_whitelabel-domains-domain_id-subuser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "username": "jdoe" + }, + "properties": { + "username": { + "description": "Username to associate with the authenticated domain.", + "type": "string" + } + }, + "required": [ + "username" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "automatic_security": false, + "custom_spf": true, + "default": false, + "dns": { + "dkim": { + "data": "k=rsa; t=s; p=publicKey", + "host": "s1._domainkey.example.com", + "type": "txt", + "valid": false + }, + "domain_spf": { + "data": "v=spf1 include:mail.example.com -all", + "host": "example.com", + "type": "txt", + "valid": false + }, + "mail_server": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "mx", + "valid": false + }, + "subdomain_spf": { + "data": "v=spf1 ip4:192.168.1.1 ip4:192.168.0.1 -all", + "host": "mail.example.com", + "type": "txt", + "valid": false + } + }, + "domain": "example.com", + "id": 1, + "ips": [], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "mail@example.com", + "valid": false + } + } + }, + "schema": { + "$ref": "#/components/schemas/domain_authentication_domain_spf" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Associate an authenticated domain with a given user.", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "POST_whitelabel-domains-domainid-subuser", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/domains/{id}/ips": { + "parameters": [ + { + "description": "ID of the domain to which you are adding an IP", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "post": { + "description": "**This endpoint allows you to add an IP address to an authenticated domain.**", + "operationId": "POST_whitelabel-domains-id-ips", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "ip": "192.168.0.1" + }, + "properties": { + "ip": { + "description": "IP to associate with the domain. Used for manually specifying IPs for custom SPF.", + "type": "string" + } + }, + "required": [ + "ip" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "automatic_security": false, + "custom_spf": true, + "default": false, + "dns": { + "dkim": { + "data": "k=rsa; t=s; p=publicKey", + "host": "s1._domainkey.example.com", + "type": "txt", + "valid": false + }, + "domain_spf": { + "data": "v=spf1 include:mail.example.com -all", + "host": "example.com", + "type": "txt", + "valid": false + }, + "mail_server": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "mx", + "valid": false + }, + "subdomain_spf": { + "data": "v=spf1 ip4:192.168.1.1 ip4:192.168.0.1 -all", + "host": "mail.example.com", + "type": "txt", + "valid": false + } + }, + "domain": "example.com", + "id": 1, + "ips": [], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": false + } + } + }, + "schema": { + "$ref": "#/components/schemas/domain_authentication_domain_spf" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add an IP to an authenticated domain", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "POST_whitelabel-domains-id-ips", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/domains/{id}/ips/{ip}": { + "delete": { + "description": "**This endpoint allows you to remove an IP address from that domain's authentication.**", + "operationId": "DELETE_whitelabel-domains-id-ips-ip", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "automatic_security": false, + "custom_spf": true, + "default": false, + "dns": { + "dkim": { + "data": "k=rsa; t=s; p=publicKey", + "host": "s1._domainkey.example.com", + "type": "txt", + "valid": false + }, + "domain_spf": { + "data": "v=spf1 include:mail.example.com -all", + "host": "example.com", + "type": "txt", + "valid": false + }, + "mail_server": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "mx", + "valid": false + }, + "subdomain_spf": { + "data": "v=spf1 ip4:192.168.1.1 ip4:192.168.0.1 -all", + "host": "mail.example.com", + "type": "txt", + "valid": false + } + }, + "domain": "example.com", + "id": 1, + "ips": [], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "mail@example.com", + "valid": false + } + } + }, + "schema": { + "$ref": "#/components/schemas/domain_authentication_domain_spf" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove an IP from an authenticated domain.", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "DELETE_whitelabel-domains-id-ips-ip", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "ID of the domain to delete the IP from.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "IP to remove from the domain.", + "in": "path", + "name": "ip", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/whitelabel/domains/{id}/validate": { + "parameters": [ + { + "description": "ID of the domain to validate.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "post": { + "description": "**This endpoint allows you to validate an authenticated domain. If it fails, it will return an error message describing why the domain could not be validated.**", + "operationId": "POST_whitelabel-domains-id-validate", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1, + "valid": true, + "validation_resuts": { + "dkim1": { + "reason": null, + "valid": true + }, + "dkim2": { + "reason": null, + "valid": true + }, + "mail_cname": { + "reason": "Expected your MX record to be \"mx.sendgrid.net\" but found \"example.com\".", + "valid": false + }, + "spf": { + "reason": null, + "valid": true + } + } + } + } + }, + "schema": { + "properties": { + "id": { + "description": "The ID of the authenticated domain.", + "type": "integer" + }, + "valid": { + "description": "Indicates if this is a valid authenticated domain.", + "type": "boolean" + }, + "validation_results": { + "description": "The individual DNS records that are checked when validating, including the reason for any invalid DNS records.", + "properties": { + "dkim1": { + "description": "A DNS record for this authenticated domain.", + "properties": { + "reason": { + "nullable": true, + "type": "string" + }, + "valid": { + "description": "Indicates if the DNS record is valid.", + "type": "boolean" + } + }, + "type": "object" + }, + "dkim2": { + "description": "A DNS record for this authenticated domain.", + "properties": { + "reason": { + "nullable": true, + "type": "string" + }, + "valid": { + "description": "Indicates if the DNS record is valid.", + "type": "boolean" + } + }, + "type": "object" + }, + "mail_cname": { + "description": "The CNAME record for the authenticated domain.", + "properties": { + "reason": { + "description": "The reason this record is invalid.", + "nullable": true, + "type": "string" + }, + "valid": { + "description": "Indicates if this DNS record is valid.", + "type": "boolean" + } + }, + "type": "object" + }, + "spf": { + "description": "The SPF record for the authenticated domain.", + "properties": { + "reason": { + "nullable": true, + "type": "string" + }, + "valid": { + "description": "Indicates if the SPF record is valid.", + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "internal error getting TXT" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "message": { + "description": "A message explaining the reason for the error.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate a domain authentication.", + "tags": [ + "Domain Authentication" + ], + "x-stoplight": { + "id": "POST_whitelabel-domains-id-validate", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/ips": { + "get": { + "description": "**This endpoint allows you to retrieve all of the Reverse DNS records created by this account.**\n\nYou may include a search key by using the `ip` query string parameter. This enables you to perform a prefix search for a given IP segment (e.g., `?ip=\"192.\"`).\n\nUse the `limit` query string parameter to reduce the number of records returned. All records will be returned if you have fewer records than the specified limit.\n\nThe `offset` query string parameter allows you to specify a non-zero index from which records will be returned. For example, if you have ten records, `?offset=5` will return the last five records (at indexes 5 through 9). The list starts at index zero.", + "operationId": "GET_whitelabel-ips", + "parameters": [ + { + "description": "The maximum number of results to retrieve.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "The point in the list of results to begin retrieving IP addresses from.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "description": "The IP address segment that you'd like to use in a prefix search.", + "in": "query", + "name": "ip", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "a_record": { + "data": "192.168.1.1", + "host": "o1.email.example.com", + "type": "a", + "valid": true + }, + "domain": "example.com", + "id": 1, + "ip": "192.168.1.1", + "legacy": false, + "rdns": "o1.email.example.com", + "subdomain": "email", + "users": [ + { + "user_id": 7, + "username": "john@example.com" + }, + { + "user_id": 8, + "username": "jane@example.com" + } + ], + "valid": true + }, + { + "a_record": { + "data": "192.168.1.2", + "host": "o2.email.example.com", + "type": "a", + "valid": true + }, + "domain": "example.com", + "id": 2, + "ip": "192.168.1.2", + "legacy": false, + "rdns": "o2.email.example.com", + "subdomain": "email", + "users": [ + { + "user_id": 7, + "username": "john@example.com" + }, + { + "user_id": 9, + "username": "jane@example2.com" + } + ], + "valid": true + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/reverse_dns" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all reverse DNS records", + "tags": [ + "Reverse DNS" + ], + "x-stoplight": { + "id": "GET_whitelabel-ips", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to set up reverse DNS.**", + "operationId": "POST_whitelabel-ips", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "domain": "example.com", + "ip": "192.168.1.1", + "subdomain": "email" + }, + "properties": { + "domain": { + "description": "The root, or sending, domain that will be used to send message from the IP address.", + "type": "string" + }, + "ip": { + "description": "The IP address for which you want to set up reverse DNS.", + "type": "string" + }, + "subdomain": { + "description": "The subdomain that will be used to send emails from the IP address. This should be the same as the subdomain used to set up an authenticated domain.", + "type": "string" + } + }, + "required": [ + "ip", + "domain" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "a_record": { + "data": "192.168.1.2", + "host": "o1.email.example.com", + "type": "a", + "valid": true + }, + "domain": "example.com", + "id": 123, + "ip": "192.168.1.2", + "legacy": false, + "rdns": "o1.email.example.com", + "subdomain": "email", + "users": [], + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/reverse_dns" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Set up reverse DNS", + "tags": [ + "Reverse DNS" + ], + "x-stoplight": { + "id": "POST_whitelabel-ips", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/ips/{id}": { + "delete": { + "description": "**This endpoint allows you to delete a reverse DNS record.**\n\nA call to this endpoint will respond with a 204 status code if the deletion was successful.\n\nYou can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint.", + "operationId": "DELETE_whitelabel-ips-id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a reverse DNS record", + "tags": [ + "Reverse DNS" + ], + "x-stoplight": { + "id": "DELETE_whitelabel-ips-id", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a reverse DNS record.**\n\nYou can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint.", + "operationId": "GET_whitelabel-ips-id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "a_record": { + "data": "192.168.1.1", + "host": "o1.email.example.com", + "type": "a", + "valid": true + }, + "domain": "example.com", + "id": 123, + "ip": "192.168.1.1", + "legacy": false, + "rdns": "o1.email.example.com", + "subdomain": "email", + "users": [ + { + "user_id": 7, + "username": "john@example.com" + } + ], + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/reverse_dns" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a reverse DNS record", + "tags": [ + "Reverse DNS" + ], + "x-stoplight": { + "id": "GET_whitelabel-ips-id", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the reverse DNS record that you would like to retrieve.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/whitelabel/ips/{id}/validate": { + "parameters": [ + { + "description": "The ID of the reverse DNS record that you would like to validate.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "**This endpoint allows you to validate a reverse DNS record.**\n\nAlways check the `valid` property of the response’s `validation_results.a_record` object. This field will indicate whether it was possible to validate the reverse DNS record. If the `validation_results.a_record.valid` is `false`, this indicates only that Twilio SendGrid could not determine the validity your reverse DNS record — it may still be valid.\n\nIf validity couldn’t be determined, you can check the value of `validation_results.a_record.reason` to find out why.\n\nYou can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint.", + "operationId": "POST_whitelabel-ips-id-validate", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 123456, + "valid": false, + "validation_results": { + "a_record": { + "reason": "Failed to resolve A Record at o1.ptr4283.example.com: lookup o1.ptr4283.example.com on 192.168.0.10:53: no such host", + "valid": false + } + } + } + } + }, + "schema": { + "properties": { + "id": { + "description": "The ID of the reverse DNS record.", + "type": "integer" + }, + "valid": { + "description": "Indicates if the reverse DNS record is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "validation_results": { + "description": "The specific results of the validation.", + "properties": { + "a_record": { + "properties": { + "reason": { + "description": "The reason the reverse DNS record could not be validated. Is `null` if the reverse DNS record was validated.", + "nullable": true, + "type": "string" + }, + "valid": { + "description": "Indicates if the reverse DNS record could be validated.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "required": [ + "valid", + "reason" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "id", + "valid", + "validation_results" + ], + "type": "object" + } + } + }, + "description": "" + }, + "404": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "Reverse DNS record not found." + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "description": "The error messages for the failed validation.", + "items": { + "properties": { + "message": { + "description": "A message describing why the reverse DNS could not be validated.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Unexpected error in API call. See HTTP response body for details." + }, + "500": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "internal error getting rDNS" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "description": "The error messages for the failed validation.", + "items": { + "properties": { + "message": { + "description": "A message describing why the IP whitelabel could not be validated.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate a reverse DNS record", + "tags": [ + "Reverse DNS" + ], + "x-stoplight": { + "id": "POST_whitelabel-ips-id-validate", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/links": { + "get": { + "description": "**This endpoint allows you to retrieve all branded links**.\n\nYou can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request.", + "operationId": "GET_whitelabel-links", + "parameters": [ + { + "description": "Limits the number of results returned per page.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": [ + { + "default": true, + "dns": { + "domain_cname": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + }, + "owner_cname": { + "data": "sendgrid.net", + "host": "7.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": true + }, + { + "default": false, + "dns": { + "domain_cname": { + "data": "sendgrid.net", + "host": "news.example2.com", + "type": "cname", + "valid": true + }, + "owner_cname": { + "data": "sendgrid.net", + "host": "8.example2.com", + "type": "cname", + "valid": false + } + }, + "domain": "example2.com", + "id": 2, + "legacy": false, + "subdomain": "news", + "user_id": 8, + "username": "john@example.com", + "valid": false + } + ] + } + }, + "schema": { + "items": { + "$ref": "#/components/schemas/link_branding_200_response" + }, + "type": "array" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all branded links", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "GET_whitelabel-links", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "post": { + "description": "**This endpoint allows you to create a new branded link.**\n\nTo create the link branding, supply the root domain and, optionally, the subdomain — these go into separate fields in your request body. The root domain should match your FROM email address. If you provide a subdomain, it must be different from the subdomain you used for authenticating your domain.\n\nYou can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request.", + "operationId": "POST_whitelabel-links", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "default": true, + "domain": "example.com", + "subdomain": "mail" + }, + "properties": { + "default": { + "description": "Indicates if you want to use this link branding as the default or fallback. When setting a new default, the existing default link branding will have its default status removed automatically.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "domain": { + "description": "The root domain for the subdomain that you are creating the link branding for. This should match your FROM email address.", + "type": "string" + }, + "subdomain": { + "description": "The subdomain to create the link branding for. Must be different from the subdomain you used for authenticating your domain.", + "type": "string" + } + }, + "required": [ + "domain" + ], + "type": "object" + } + } + } + }, + "responses": { + "201": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "default": false, + "dns": { + "domain_cname": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + }, + "owner_cname": { + "data": "sendgrid.net", + "host": "7.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/link_branding_200_response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a branded link", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "POST_whitelabel-links", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/links/default": { + "get": { + "description": "**This endpoint allows you to retrieve the default branded link.**\n\nThe default branded link is the actual URL to be used when sending messages. If you have more than one branded link, the default is determined by the following order:\n\n* The validated branded link marked as `default` (set when you call the \"Create a branded link\" endpoint or by calling the \"Update a branded link\" endpoint on an existing link)\n* Legacy branded links (migrated from the whitelabel wizard)\n* Default SendGrid-branded links (i.e., `100.ct.sendgrid.net`)\n\nYou can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request.", + "operationId": "GET_whitelabel-links-default", + "parameters": [ + { + "description": "The domain to match against when finding the default branded link.", + "in": "query", + "name": "domain", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "default": false, + "dns": { + "domain_cname": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + }, + "owner_cname": { + "data": "sendgrid.net", + "host": "7.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/link_branding_200_response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the default branded link", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "GET_whitelabel-links-default", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/links/subuser": { + "delete": { + "description": "**This endpoint allows you to take a branded link away from a subuser.**\n\nLink branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers).\n\nYour request will receive a response with a 204 status code if the disassociation was successful.", + "operationId": "DELETE_whitelabel-links-subuser", + "parameters": [ + { + "description": "The username of the subuser account that you want to disassociate a branded link from.", + "in": "query", + "name": "username", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Disassociate a branded link from a subuser", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "DELETE_whitelabel-links-subuser", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve the branded link associated with a subuser.**\n\nLink branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and then validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers).", + "operationId": "GET_whitelabel-links-subuser", + "parameters": [ + { + "description": "The username of the subuser to retrieve associated branded links for.", + "in": "query", + "name": "username", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "default": false, + "dns": { + "domain_cname": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + }, + "owner_cname": { + "data": "sendgrid.net", + "host": "7.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/link_branding_200_response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a subuser's branded link", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "GET_whitelabel-links-subuser", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/whitelabel/links/{id}": { + "delete": { + "description": "**This endpoint allows you to delete a branded link.**\n\nYour request will receive a response with a 204 status code if the deletion was successful. The call does not return the link's details, so if you wish to record these make sure you call the \"Retrieve a branded link\" endpoint *before* you request its deletion.\n\nYou can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request.", + "operationId": "DELETE_whitelabel-links-id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "204": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a branded link", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "DELETE_whitelabel-links-id", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "get": { + "description": "**This endpoint allows you to retrieve a specific branded link by providing its ID.**\n\nYou can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request.", + "operationId": "GET_whitelabel-links-id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "default": false, + "dns": { + "domain_cname": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + }, + "owner_cname": { + "data": "sendgrid.net", + "host": "7.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/link_branding_200_response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a branded link", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "GET_whitelabel-links-id", + "mock": { + "dynamic": false + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the branded link you want to retrieve.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "patch": { + "description": "**This endpoint allows you to update a specific branded link. You can use this endpoint to change a branded link's default status.**\n\nYou can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request.", + "operationId": "PATCH_whitelabel-links-id", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "default": true + }, + "properties": { + "default": { + "description": "Indicates if the branded link is set as the default. When setting a new default, the existing default link branding will have its default status removed automatically.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "default": true, + "dns": { + "domain_cname": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + }, + "owner_cname": { + "data": "sendgrid.net", + "host": "7.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/link_branding_200_response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a branded link", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "PATCH_whitelabel-links-id", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/links/{id}/validate": { + "parameters": [ + { + "description": "The ID of the branded link that you want to validate.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "post": { + "description": "**This endpoint allows you to validate a branded link.**\n\nYou can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request.", + "operationId": "POST_whitelabel-links-id-validate", + "parameters": [ + { + "$ref": "#/components/parameters/trait_onBehalfOfSubuser_on-behalf-of" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "id": 1, + "valid": true, + "validation_results": { + "domain_cname": { + "reason": "Expected CNAME to match \"sendgrid.net.\" but found \"example.com.\".", + "valid": false + }, + "owner_cname": { + "reason": null, + "valid": true + } + } + } + } + }, + "schema": { + "properties": { + "id": { + "description": "The ID of the branded link.", + "type": "integer" + }, + "valid": { + "description": "Indicates if the link branding is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "validation_results": { + "description": "The individual validation results for each of the DNS records associated with this branded link.", + "properties": { + "domain_cname": { + "description": "The DNS record generated for the sending domain used for this branded link.", + "properties": { + "reason": { + "description": "Null if the DNS record is valid. If the DNS record is invalid, this will explain why.", + "nullable": true, + "type": "string" + }, + "valid": { + "description": "Indicates if this DNS record is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "required": [ + "valid", + "reason" + ], + "type": "object" + }, + "owner_cname": { + "description": "The DNS record created to verify the branded link.", + "properties": { + "reason": { + "description": "Null if valid. If the DNS record is invalid, this will explain why.", + "nullable": true, + "type": "string" + }, + "valid": { + "description": "Indicates if the DNS record is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "required": [ + "valid", + "reason" + ], + "type": "object" + } + }, + "required": [ + "domain_cname" + ], + "type": "object" + } + }, + "required": [ + "id", + "valid", + "validation_results" + ], + "type": "object" + } + } + }, + "description": "" + }, + "500": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "errors": [ + { + "message": "internal error getting CNAME" + } + ] + } + } + }, + "schema": { + "properties": { + "errors": { + "description": "The reasons why the validation failed.", + "items": { + "properties": { + "message": { + "description": "The reason why the link whitelabel could not be validated.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate a branded link", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "POST_whitelabel-links-id-validate", + "mock": { + "dynamic": false + }, + "public": true + } + } + }, + "/whitelabel/links/{link_id}/subuser": { + "parameters": [ + { + "description": "The ID of the branded link you want to associate.", + "in": "path", + "name": "link_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "post": { + "description": "**This endpoint allows you to associate a branded link with a subuser account.**\n\nLink branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers).", + "operationId": "POST_whitelabel-links-link_id-subuser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "example": { + "username": "jane@example.com" + }, + "properties": { + "username": { + "description": "The username of the subuser account that you want to associate the branded link with.", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "examples": { + "response": { + "value": { + "default": false, + "dns": { + "domain_cname": { + "data": "sendgrid.net", + "host": "mail.example.com", + "type": "cname", + "valid": true + }, + "owner_cname": { + "data": "sendgrid.net", + "host": "7.example.com", + "type": "cname", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": true + } + } + }, + "schema": { + "$ref": "#/components/schemas/link_branding_200_response" + } + } + }, + "description": "" + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Associate a branded link with a subuser", + "tags": [ + "Link branding" + ], + "x-stoplight": { + "id": "POST_whitelabel-links-linkid-subuser", + "mock": { + "dynamic": false + }, + "public": true + } + } + } + }, + "servers": [ + { + "url": "http://api.sendgrid.com/v3" + } + ], + "tags": [ + { + "name": "Subuser Monitor Settings" + }, + { + "name": "segmenting contacts" + }, + { + "name": "Single Sign-On Settings" + }, + { + "name": "Settings - Partner" + }, + { + "name": "Contacts API - Recipients" + }, + { + "name": "Settings - Inbound Parse" + }, + { + "name": "Segmenting Contacts" + }, + { + "name": "IP Access Management" + }, + { + "name": "Messages" + }, + { + "name": "Suppressions - Unsubscribe Groups" + }, + { + "name": "Email CNAME records" + }, + { + "name": "CSV (UI only)" + }, + { + "name": "Bounces API" + }, + { + "name": "Designs API" + }, + { + "name": "Custom Fields" + }, + { + "name": "Segmenting Contacts V2 - Beta" + }, + { + "name": "Subuser Statistics" + }, + { + "name": "Send Test Email" + }, + { + "name": "IP Addresses" + }, + { + "name": "Query" + }, + { + "name": "V3" + }, + { + "name": "Invalid Emails API" + }, + { + "name": "Webhooks" + }, + { + "name": "Suppressions - Global Suppressions" + }, + { + "name": "Settings - Tracking" + }, + { + "name": "Contacts API - Lists" + }, + { + "name": "Marketing Campaigns Stats" + }, + { + "name": "API Key Permissions" + }, + { + "name": "Domain Authentication" + }, + { + "name": "Sender Identities API" + }, + { + "name": "Single Sign-On Teammates" + }, + { + "name": "Mail Send" + }, + { + "name": "Settings - Enforced TLS" + }, + { + "name": "IP Warmup" + }, + { + "name": "Categories" + }, + { + "name": "Campaigns API" + }, + { + "name": "Teammates" + }, + { + "name": "Sender Verification" + }, + { + "name": "Single Sends" + }, + { + "name": "Blocks API" + }, + { + "name": "Contacts" + }, + { + "name": "Certificates" + }, + { + "name": "Contacts API - Segments" + }, + { + "name": "Senders" + }, + { + "name": "Contacts API - Custom Fields" + }, + { + "name": "Spam Reports API" + }, + { + "name": "Subusers API" + }, + { + "name": "Link branding" + }, + { + "name": "Suppressions - Suppressions" + }, + { + "name": "Users API" + }, + { + "name": "Settings - Mail" + }, + { + "name": "API Keys" + }, + { + "name": "Transactional Templates" + }, + { + "name": "Reverse DNS" + }, + { + "name": "Email Address Validation" + }, + { + "name": "Transactional Templates Versions" + }, + { + "name": "Lists" + }, + { + "name": "Cancel Scheduled Sends" + }, + { + "name": "Stats" + }, + { + "name": "Alerts" + }, + { + "name": "IP Pools" + } + ], + "x-stoplight": { + "afterScript": "function (ctx, request, response) {\n // REMOVE WITH CAUTION. OR AT LEAST, JUST LEAVE IT COMMENTED OUT.\n // Removing this means your endpoint AFTER scripts will not be run!\n SL.runEndpoint();\n \n// if (response.body.get().count() > 1) {\n// request.hijack(200, 'application/json', {foo: 'bear'})\n// }\n\n \n //make this always available\n //SL.utilities.Audit_LogDataInResponse(ctx, request, response);\n \n //if (request.url.query.get('test')) {\n // SL.utilities.RunSpecifiedTests(ctx, request, response);\n //}\n \n // ELMER: Remove this, it logs only DELETE calls\n // if (JSON.parse(request.header.get('X-Mock')) == response.statusCode.get()) {\n // ctx.log.set(false);\n // } else {\n // ctx.log.set(true);\n //}\n}", + "beforeScript": "function (ctx, request) {\n \n request.header.set('User-Agent', 'sendgrid/stoplightdocs');\n \n // REMOVE WITH CAUTION. OR AT LEAST, JUST LEAVE IT COMMENTED OUT.\n // Removing this means your endpoint before scripts will not be run!\n SL.runEndpoint();\n \n //adds the Accept header to every request\n // request.header.set(\"accept\", \"application/json\")\n \n //request.header.set(\"foo\", \"bear\");\n //request.header.add(\"bar\", \"cat\");\n\n // if (request.url.query.get('accept')) {\n // request.header.set('Accept', 'this is a bad header');\n // }\n \n // if (request.url.query.get('behalf')) {\n // request.header.set('on-behalf-of', 'subuser2');\n // }\n \n // For example, adding ?mock=200 to a request url will enable mocking,\n // using the example endpoint response for the 200 status code.\n // var mock = request.url.query.get(\"mock\")\n // if (mock) {\n // ctx.mock.set(true, mock)\n //}\n \n // For example, adding the header X-Mock: 200 will enable mocking,\n // using the example endpoint response for the 200 status code.\n // var mock = request.header.get(\"X-Mock\");\n // if (mock) {\n\t // ctx.mock.set(true, mock);\n\t // ctx.learn.set(false);\n // }\n}", + "functions": {}, + "mock": { + "dynamic": false, + "enabled": false + }, + "textSections": { + "api-authentication": { + "content": "## Authorization Header\n\nTo authenticate, add an `Authorization` header to your API request that contains an [API Key](https://sendgrid.com/docs/API_Reference/Web_API_v3/API_Keys/index.html).\n\n## API Keys\n\nSendGrid’s Web API v3 supports the use of API Keys. API Keys allow you to use another method of authentication separate from your account username and password. API Keys add an additional layer of security for your account and can be assigned [specific permissions](https://sendgrid.com/docs/API_Reference/Web_API_v3/API_Keys/api_key_permissions_list.html) to limit which areas of your account they may be used to access. [API Keys can be generated in your account](https://app.sendgrid.com/settings/api_keys). To use keys, you must set a plain text header named “Authorization” with the contents of the header being “Bearer XXX” where XXX is your API Secret Key.\n\n### Example Header\n\n```bash\nGET https://api.sendgrid.com/v3/resource HTTP/1.1\nAuthorization: Bearer Your.API.Key-HERE\n```\n\n```bash\ncurl -X \"GET\" \"https://api.sendgrid.com/v3/templates\" -H \"Authorization: Bearer Your.API.Key-HERE\" -H \"Content-Type: application/json\"\n```", + "id": "api-authentication", + "name": "Authentication", + "public": true + }, + "api-authorization": { + "content": "# API Key Permissions List\n\nAPI Keys can be used to authenticate the use of SendGrid’s v3 Web API, or the [Mail API endpoint](https://sendgrid.com/docs/api-reference/). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. For a more detailed explanation of how you can use API Key permissions, please visit our [API Keys docs](https://sendgrid.com/docs/ui/account-and-settings/api-keys/). \n\nThe following is a complete list of all possible permissions that you may assign to an API Key.\n\n>When updating a key to include `user` or `subuser` scopes, use basic authenitcation.\n\n## Table of Contents\n\n\n\n\n\n\n\n\n\n\n
AlertsMail SettingsTeammates
API KeysMailTemplates
ASM GroupsMarketing CampaignsSuppressions
BillingPartner SettingsTracking
CategoriesScheduled SendsUser Settings
StatsWebhookIPs
SubusersDomain AuthenticationReverse DNS
Admin API Key Scopes
\n\n\n

Alerts

\n\n```json\n\"scopes\": [\n \"alerts.create\",\n \"alerts.delete\",\n \"alerts.read\",\n \"alerts.update\"\n]\n```\n\n

API Keys

\n\n```json\n\"scopes\": [\n \"api_keys.create\",\n \"api_keys.delete\",\n \"api_keys.read\",\n \"api_keys.update\"\n]\n```\n\n

ASM Groups

\n\n```json\n\"scopes\": [\n \"asm.groups.create\",\n \"asm.groups.delete\",\n \"asm.groups.read\",\n \"asm.groups.update\"\n]\n```\n\n\n

Billing

\n\n```json\n\"scopes\": [\n \"billing.create\",\n \"billing.delete\",\n \"billing.read\",\n \"billing.update\"\n]\n```\n\n\n**Billing permissions are mutually exclusive from all other permissions. An API Key can have *either* Billing Permissions *or* any other set of Permissions but not *both*.**\n\n\n

Categories

\n\n```json\n\"scopes\": [\n \"categories.create\",\n \"categories.delete\",\n \"categories.read\",\n \"categories.update\",\n \"categories.stats.read\",\n \"categories.stats.sums.read\"\n]\n```\n\n

Stats

\n\n```json\n\"scopes\": [\n \"email_activity.read\",\n \"stats.read\",\n \"stats.global.read\",\n \"browsers.stats.read\",\n \"devices.stats.read\",\n \"geo.stats.read\",\n \"mailbox_providers.stats.read\",\n \"clients.desktop.stats.read\",\n \"clients.phone.stats.read\",\n \"clients.stats.read\",\n \"clients.tablet.stats.read\",\n \"clients.webmail.stats.read\"\n]\n```\n\n

IPs

\n\n```json\n\"scopes\": [\n \"ips.assigned.read\",\n \"ips.read\",\n \"ips.pools.create\",\n \"ips.pools.delete\",\n \"ips.pools.read\",\n \"ips.pools.update\",\n \"ips.pools.ips.create\",\n \"ips.pools.ips.delete\",\n \"ips.pools.ips.read\",\n \"ips.pools.ips.update\",\n \"ips.warmup.create\",\n \"ips.warmup.delete\",\n \"ips.warmup.read\",\n \"ips.warmup.update\"\n]\n```\n\n

Mail Settings

\n\n```json\n\"scopes\": [\n \"mail_settings.address_whitelist.read\",\n \"mail_settings.address_whitelist.update\",\n \"mail_settings.bounce_purge.read\",\n \"mail_settings.bounce_purge.update\",\n \"mail_settings.footer.read\",\n \"mail_settings.footer.update\",\n \"mail_settings.forward_bounce.read\",\n \"mail_settings.forward_bounce.update\",\n \"mail_settings.forward_spam.read\",\n \"mail_settings.forward_spam.update\",\n \"mail_settings.template.read\",\n \"mail_settings.template.update\"\n]\n```\n\n

Mail

\n\n```json\n\"scopes\": [\n \"mail.batch.create\",\n \"mail.batch.delete\",\n \"mail.batch.read\",\n \"mail.batch.update\",\n \"mail.send\"\n]\n```\n\n

Marketing Campaigns

\n\n```json\n\"scopes\": [\n \"marketing_campaigns.create\",\n \"marketing_campaigns.delete\",\n \"marketing_campaigns.read\",\n \"marketing_campaigns.update\"\n]\n```\n\n\n

Partner Settings

\n\n```json\n\"scopes\": [\n \"partner_settings.new_relic.read\",\n \"partner_settings.new_relic.update\",\n \"partner_settings.read\"\n]\n```\n\n

Scheduled Sends

\n\n```json\n\"scopes\": [\n \"user.scheduled_sends.create\",\n \"user.scheduled_sends.delete\",\n \"user.scheduled_sends.read\",\n \"user.scheduled_sends.update\"\n]\n```\n\n

Subusers

\n\n```json\n\"scopes\": [\n \"subusers.create\",\n \"subusers.delete\",\n \"subusers.read\",\n \"subusers.update\",\n \"subusers.credits.create\",\n \"subusers.credits.delete\",\n \"subusers.credits.read\",\n \"subusers.credits.update\",\n \"subusers.credits.remaining.create\",\n \"subusers.credits.remaining.delete\",\n \"subusers.credits.remaining.read\",\n \"subusers.credits.remaining.update\",\n \"subusers.monitor.create\",\n \"subusers.monitor.delete\",\n \"subusers.monitor.read\",\n \"subusers.monitor.update\",\n \"subusers.reputations.read\",\n \"subusers.stats.read\",\n \"subusers.stats.monthly.read\",\n \"subusers.stats.sums.read\"\n \"subusers.summary.read\"\n]\n```\n\n

Suppressions

\n\n```json\n\"scopes\": [\n \"suppression.create\",\n \"suppression.delete\",\n \"suppression.read\",\n \"suppression.update\",\n \"suppression.bounces.create\",\n \"suppression.bounces.read\",\n \"suppression.bounces.update\",\n \"suppression.bounces.delete\",\n \"suppression.blocks.create\",\n \"suppression.blocks.read\",\n \"suppression.blocks.update\",\n \"suppression.blocks.delete\",\n \"suppression.invalid_emails.create\",\n \"suppression.invalid_emails.read\",\n \"suppression.invalid_emails.update\",\n \"suppression.invalid_emails.delete\",\n \"suppression.spam_reports.create\",\n \"suppression.spam_reports.read\",\n \"suppression.spam_reports.update\",\n \"suppression.spam_reports.delete\",\n \"suppression.unsubscribes.create\",\n \"suppression.unsubscribes.read\",\n \"suppression.unsubscribes.update\",\n \"suppression.unsubscribes.delete\"\n]\n```\n\n

Teammates

\n\n```json\n\"scopes\": [\n \"teammates.create\",\n \"teammates.read\",\n \"teammates.update\",\n \"teammates.delete\"\n]\n```\n\n

Templates

\n\n```json\n\"scopes\": [\n \"templates.create\",\n \"templates.delete\",\n \"templates.read\",\n \"templates.update\",\n \"templates.versions.activate.create\",\n \"templates.versions.activate.delete\",\n \"templates.versions.activate.read\",\n \"templates.versions.activate.update\",\n \"templates.versions.create\",\n \"templates.versions.delete\",\n \"templates.versions.read\",\n \"templates.versions.update\"\n]\n```\n\n

Tracking

\n\n```json\n\"scopes\": [\n \"tracking_settings.click.read\",\n \"tracking_settings.click.update\",\n \"tracking_settings.google_analytics.read\",\n \"tracking_settings.google_analytics.update\",\n \"tracking_settings.open.read\",\n \"tracking_settings.open.update\",\n \"tracking_settings.read\",\n \"tracking_settings.subscription.read\",\n \"tracking_settings.subscription.update\"\n]\n```\n\n

User Settings

\n\n```json\n\"scopes\": [\n \"user.account.read\",\n \"user.credits.read\",\n \"user.email.create\",\n \"user.email.delete\",\n \"user.email.read\",\n \"user.email.update\",\n \"user.multifactor_authentication.create\",\n \"user.multifactor_authentication.delete\",\n \"user.multifactor_authentication.read\",\n \"user.multifactor_authentication.update\",\n \"user.password.read\",\n \"user.password.update\",\n \"user.profile.read\",\n \"user.profile.update\",\n \"user.settings.enforced_tls.read\",\n \"user.settings.enforced_tls.update\",\n \"user.timezone.read\",\n \"user.timezone.update\",\n \"user.username.read\",\n \"user.username.update\"\n]\n```\n\n

Webhook

\n\n```json\n\"scopes\": [\n \"user.webhooks.event.settings.read\",\n \"user.webhooks.event.settings.update\",\n \"user.webhooks.event.test.create\",\n \"user.webhooks.event.test.read\",\n \"user.webhooks.event.test.update\",\n \"user.webhooks.parse.settings.create\",\n \"user.webhooks.parse.settings.delete\",\n \"user.webhooks.parse.settings.read\",\n \"user.webhooks.parse.settings.update\",\n \"user.webhooks.parse.stats.read\"\n]\n```\n\n

Domain Authentication (formerly Whitelabel)

\n\n```json\n\"scopes\": [\n \"whitelabel.create\",\n \"whitelabel.delete\",\n \"whitelabel.read\",\n \"whitelabel.update\"\n]\n```\n\n

Reverse DNS (formerly Whitelist)

\n\n```json\n\"scopes\": [\n \"access_settings.activity.read\",\n \"access_settings.whitelist.create\",\n \"access_settings.whitelist.delete\",\n \"access_settings.whitelist.read\",\n \"access_settings.whitelist.update\"\n]\n```\n\n

Admin API Key Scopes

\n\nBelow is a complete list of every API Key scope to be given to an admin level API Key.\n\n```json\n\"scopes\": [\n \"access_settings.activity.read\",\n \"access_settings.whitelist.create\",\n \"access_settings.whitelist.delete\",\n \"access_settings.whitelist.read\",\n \"access_settings.whitelist.update\",\n \"alerts.create\",\n \"alerts.delete\",\n \"alerts.read\",\n \"alerts.update\",\n \"api_keys.create\",\n \"api_keys.delete\",\n \"api_keys.read\",\n \"api_keys.update\",\n \"asm.groups.create\",\n \"asm.groups.delete\",\n \"asm.groups.read\",\n \"asm.groups.update\",\n \"billing.create\",\n \"billing.delete\",\n \"billing.read\",\n \"billing.update\",\n \"browsers.stats.read\",\n \"categories.create\",\n \"categories.delete\",\n \"categories.read\",\n \"categories.stats.read\",\n \"categories.stats.sums.read\",\n \"categories.update\",\n \"clients.desktop.stats.read\",\n \"clients.phone.stats.read\",\n \"clients.stats.read\",\n \"clients.tablet.stats.read\",\n \"clients.webmail.stats.read\",\n \"devices.stats.read\",\n \"email_activity.read\",\n \"geo.stats.read\",\n \"ips.assigned.read\",\n \"ips.pools.create\",\n \"ips.pools.delete\",\n \"ips.pools.ips.create\",\n \"ips.pools.ips.delete\",\n \"ips.pools.ips.read\",\n \"ips.pools.ips.update\",\n \"ips.pools.read\",\n \"ips.pools.update\",\n \"ips.read\",\n \"ips.warmup.create\",\n \"ips.warmup.delete\",\n \"ips.warmup.read\",\n \"ips.warmup.update\",\n \"mail_settings.address_whitelist.read\",\n \"mail_settings.address_whitelist.update\",\n \"mail_settings.bounce_purge.read\",\n \"mail_settings.bounce_purge.update\",\n \"mail_settings.footer.read\",\n \"mail_settings.footer.update\",\n \"mail_settings.forward_bounce.read\",\n \"mail_settings.forward_bounce.update\",\n \"mail_settings.forward_spam.read\",\n \"mail_settings.forward_spam.update\",\n \"mail_settings.plain_content.read\",\n \"mail_settings.plain_content.update\",\n \"mail_settings.read\",,\n \"mail_settings.template.read\",\n \"mail_settings.template.update\",\n \"mail.batch.create\",\n \"mail.batch.delete\",\n \"mail.batch.read\",\n \"mail.batch.update\",\n \"mail.send\",\n \"mailbox_providers.stats.read\",\n \"marketing_campaigns.create\",\n \"marketing_campaigns.delete\",\n \"marketing_campaigns.read\",\n \"marketing_campaigns.update\",\n \"partner_settings.new_relic.read\",\n \"partner_settings.new_relic.update\",\n \"partner_settings.read\",\n \"stats.global.read\",\n \"stats.read\",\n \"subusers.create\",\n \"subusers.credits.create\",\n \"subusers.credits.delete\",\n \"subusers.credits.read\",\n \"subusers.credits.remaining.create\",\n \"subusers.credits.remaining.delete\",\n \"subusers.credits.remaining.read\",\n \"subusers.credits.remaining.update\",\n \"subusers.credits.update\",\n \"subusers.delete\",\n \"subusers.monitor.create\",\n \"subusers.monitor.delete\",\n \"subusers.monitor.read\",\n \"subusers.monitor.update\",\n \"subusers.read\",\n \"subusers.reputations.read\",\n \"subusers.stats.monthly.read\",\n \"subusers.stats.read\",\n \"subusers.stats.sums.read\",\n \"subusers.summary.read\",\n \"subusers.update\",\n \"suppression.blocks.create\",\n \"suppression.blocks.delete\",\n \"suppression.blocks.read\",\n \"suppression.blocks.update\",\n \"suppression.bounces.create\",\n \"suppression.bounces.delete\",\n \"suppression.bounces.read\",\n \"suppression.bounces.update\",\n \"suppression.create\",\n \"suppression.delete\",\n \"suppression.invalid_emails.create\",\n \"suppression.invalid_emails.delete\",\n \"suppression.invalid_emails.read\",\n \"suppression.invalid_emails.update\",\n \"suppression.read\",\n \"suppression.spam_reports.create\",\n \"suppression.spam_reports.delete\",\n \"suppression.spam_reports.read\",\n \"suppression.spam_reports.update\",\n \"suppression.unsubscribes.create\",\n \"suppression.unsubscribes.delete\",\n \"suppression.unsubscribes.read\",\n \"suppression.unsubscribes.update\",\n \"suppression.update\",\n \"teammates.create\",\n \"teammates.read\",\n \"teammates.update\",\n \"teammates.delete\",\n \"templates.create\",\n \"templates.delete\",\n \"templates.read\",\n \"templates.update\",\n \"templates.versions.activate.create\",\n \"templates.versions.activate.delete\",\n \"templates.versions.activate.read\",\n \"templates.versions.activate.update\",\n \"templates.versions.create\",\n \"templates.versions.delete\",\n \"templates.versions.read\",\n \"templates.versions.update\",\n \"tracking_settings.click.read\",\n \"tracking_settings.click.update\",\n \"tracking_settings.google_analytics.read\",\n \"tracking_settings.google_analytics.update\",\n \"tracking_settings.open.read\",\n \"tracking_settings.open.update\",\n \"tracking_settings.read\",\n \"tracking_settings.subscription.read\",\n \"tracking_settings.subscription.update\",\n \"user.account.read\",\n \"user.credits.read\",\n \"user.email.create\",\n \"user.email.delete\",\n \"user.email.read\",\n \"user.email.update\",\n \"user.multifactor_authentication.create\",\n \"user.multifactor_authentication.delete\",\n \"user.multifactor_authentication.read\",\n \"user.multifactor_authentication.update\",\n \"user.password.read\",\n \"user.password.update\",\n \"user.profile.read\",\n \"user.profile.update\",\n \"user.scheduled_sends.create\",\n \"user.scheduled_sends.delete\",\n \"user.scheduled_sends.read\",\n \"user.scheduled_sends.update\",\n \"user.settings.enforced_tls.read\",\n \"user.settings.enforced_tls.update\",\n \"user.timezone.read\",\n \"user.username.read\",\n \"user.username.update\",\n \"user.webhooks.event.settings.read\",\n \"user.webhooks.event.settings.update\",\n \"user.webhooks.event.test.create\",\n \"user.webhooks.event.test.read\",\n \"user.webhooks.event.test.update\",\n \"user.webhooks.parse.settings.create\",\n \"user.webhooks.parse.settings.delete\",\n \"user.webhooks.parse.settings.read\",\n \"user.webhooks.parse.settings.update\",\n \"user.webhooks.parse.stats.read\",\n \"whitelabel.create\",\n \"whitelabel.delete\",\n \"whitelabel.read\",\n \"whitelabel.update\"\n]\n```", + "id": "api-authorization", + "name": "Authorization", + "public": true + }, + "api-errors": { + "content": "Sometimes your API call will generate an error. Here you will find additional information about what to expect if you don’t format your request properly, or we fail to properly process your request.\n\n## Response Codes\n\n| **Status Code** | **Description** |\n|---|---|\n| 400 | Bad request|\n| 401 | Requires authentication |\n| 406 | Missing Accept header. For example: `Accept: application/json` |\n| 429 | Too many requests/Rate limit exceeded |\n| 500 | Internal server error |\n\n## Failed Requests\n\nThe general format guidelines are displayed when the accompanying status code is returned.\n\n```bash\nGET https://api.sendgrid.com/v3/resource HTTP/1.1\n```\n\n```json\nHTTP/1.1 400 BAD REQUEST\nContent-Type: application/json\n\n{\n \"errors\": [\n {\"field\": \"identifier1\", \"message\": \"error message explained\"},\n {\"field\": \"identifier2\", \"message\": \"error message explained\"},\n {\"field\": \"identifier3\", \"message\": \"error message explained\"},\n ]\n}\n```", + "id": "api-errors", + "name": "Errors", + "public": true + }, + "api-key-permissions": { + "content": "API Keys can be used to authenticate the use of [SendGrid’s v3 API](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authorization). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access.\n\nThe following is a complete list of all possible permissions that you may assign to an API Key.\n\n* [Admin API Key Permissions](#Admin-API-Key-Permissions)\n* [Alerts](#Alerts)\n* [API Keys](#API-Keys)\n* [ASM Groups](#ASM-Groups)\n* [Billing](#Billing)\n* [Categories](#Categories)\n* [Clients](#Clients)\n* [Credentials](#Credentials)\n* [IPs](#IPs)\n* [Mail Settings](#Mail-Settings)\n* [Mail](#Mail)\n* [Marketing Campaigns](#Marketing-Campaigns)\n* [Partner Settings](#Partner-Settings)\n* [Scheduled Sends](#Scheduled-Sends)\n* [Stats](#Stats)\n* [Subusers](#Subusers)\n* [Suppressions](#Suppressions)\n* [Teammates](#Teammates)\n* [Templates](#Templates)\n* [Tracking](#Tracking)\n* [User Settings](#User-Settings)\n* [Webhook](#Webhook)\n* [Domain Authentication](#Domain-Authentication)\n* [Reverse DNS](#Reverse-DNS)\n\n\n

\n Admin API Key Permissions\n

\n\nBelow is a complete list of every API Key permission that should be given to an admin level API Key.\n\n```json\n\"scopes\": [\n \"access_settings.activity.read\",\n \"access_settings.whitelist.create\",\n \"access_settings.whitelist.delete\",\n \"access_settings.whitelist.read\",\n \"access_settings.whitelist.update\",\n \"alerts.create\",\n \"alerts.delete\",\n \"alerts.read\",\n \"alerts.update\",\n \"api_keys.create\",\n \"api_keys.delete\",\n \"api_keys.read\",\n \"api_keys.update\",\n \"asm.groups.create\",\n \"asm.groups.delete\",\n \"asm.groups.read\",\n \"asm.groups.update\",\n \"billing.create\",\n \"billing.delete\",\n \"billing.read\",\n \"billing.update\",\n \"browsers.stats.read\",\n \"categories.create\",\n \"categories.delete\",\n \"categories.read\",\n \"categories.stats.read\",\n \"categories.stats.sums.read\",\n \"categories.update\",\n \"clients.desktop.stats.read\",\n \"clients.phone.stats.read\",\n \"clients.stats.read\",\n \"clients.tablet.stats.read\",\n \"clients.webmail.stats.read\",\n \"credentials.create\",\n \"credentials.delete\",\n \"credentials.read\",\n \"credentials.update\",\n \"devices.stats.read\",\n \"email_activity.read\",\n \"geo.stats.read\",\n \"ips.assigned.read\",\n \"ips.pools.create\",\n \"ips.pools.delete\",\n \"ips.pools.ips.create\",\n \"ips.pools.ips.delete\",\n \"ips.pools.ips.read\",\n \"ips.pools.ips.update\",\n \"ips.pools.read\",\n \"ips.pools.update\",\n \"ips.read\",\n \"ips.warmup.create\",\n \"ips.warmup.delete\",\n \"ips.warmup.read\",\n \"ips.warmup.update\",\n \"mail_settings.address_whitelist.read\",\n \"mail_settings.address_whitelist.update\",\n \"mail_settings.bcc.read\",\n \"mail_settings.bcc.update\",\n \"mail_settings.bounce_purge.read\",\n \"mail_settings.bounce_purge.update\",\n \"mail_settings.footer.read\",\n \"mail_settings.footer.update\",\n \"mail_settings.forward_bounce.read\",\n \"mail_settings.forward_bounce.update\",\n \"mail_settings.forward_spam.read\",\n \"mail_settings.forward_spam.update\",\n \"mail_settings.plain_content.read\",\n \"mail_settings.plain_content.update\",\n \"mail_settings.read\",\n \"mail_settings.spam_check.read\",\n \"mail_settings.spam_check.update\",\n \"mail_settings.template.read\",\n \"mail_settings.template.update\",\n \"mail.batch.create\",\n \"mail.batch.delete\",\n \"mail.batch.read\",\n \"mail.batch.update\",\n \"mail.send\",\n \"mailbox_providers.stats.read\",\n \"marketing_campaigns.create\",\n \"marketing_campaigns.delete\",\n \"marketing_campaigns.read\",\n \"marketing_campaigns.update\",\n \"newsletter.create\",\n \"newsletter.delete\",\n \"newsletter.read\",\n \"newsletter.update\",\n \"partner_settings.new_relic.read\",\n \"partner_settings.new_relic.update\",\n \"partner_settings.read\",\n \"partner_settings.sendwithus.read\",\n \"partner_settings.sendwithus.update\",\n \"stats.global.read\",\n \"stats.read\",\n \"subusers.create\",\n \"subusers.credits.create\",\n \"subusers.credits.delete\",\n \"subusers.credits.read\",\n \"subusers.credits.remaining.create\",\n \"subusers.credits.remaining.delete\",\n \"subusers.credits.remaining.read\",\n \"subusers.credits.remaining.update\",\n \"subusers.credits.update\",\n \"subusers.delete\",\n \"subusers.monitor.create\",\n \"subusers.monitor.delete\",\n \"subusers.monitor.read\",\n \"subusers.monitor.update\",\n \"subusers.read\",\n \"subusers.reputations.read\",\n \"subusers.stats.monthly.read\",\n \"subusers.stats.read\",\n \"subusers.stats.sums.read\",\n \"subusers.summary.read\",\n \"subusers.update\",\n \"suppression.blocks.create\",\n \"suppression.blocks.delete\",\n \"suppression.blocks.read\",\n \"suppression.blocks.update\",\n \"suppression.bounces.create\",\n \"suppression.bounces.delete\",\n \"suppression.bounces.read\",\n \"suppression.bounces.update\",\n \"suppression.create\",\n \"suppression.delete\",\n \"suppression.invalid_emails.create\",\n \"suppression.invalid_emails.delete\",\n \"suppression.invalid_emails.read\",\n \"suppression.invalid_emails.update\",\n \"suppression.read\",\n \"suppression.spam_reports.create\",\n \"suppression.spam_reports.delete\",\n \"suppression.spam_reports.read\",\n \"suppression.spam_reports.update\",\n \"suppression.unsubscribes.create\",\n \"suppression.unsubscribes.delete\",\n \"suppression.unsubscribes.read\",\n \"suppression.unsubscribes.update\",\n \"suppression.update\",\n \"templates.create\",\n \"templates.delete\",\n \"templates.read\",\n \"templates.update\",\n \"templates.versions.activate.create\",\n \"templates.versions.activate.delete\",\n \"templates.versions.activate.read\",\n \"templates.versions.activate.update\",\n \"templates.versions.create\",\n \"templates.versions.delete\",\n \"templates.versions.read\",\n \"templates.versions.update\",\n \"tracking_settings.click.read\",\n \"tracking_settings.click.update\",\n \"tracking_settings.google_analytics.read\",\n \"tracking_settings.google_analytics.update\",\n \"tracking_settings.open.read\",\n \"tracking_settings.open.update\",\n \"tracking_settings.read\",\n \"tracking_settings.subscription.read\",\n \"tracking_settings.subscription.update\",\n \"user.account.read\",\n \"user.credits.read\",\n \"user.email.create\",\n \"user.email.delete\",\n \"user.email.read\",\n \"user.email.update\",\n \"user.multifactor_authentication.create\",\n \"user.multifactor_authentication.delete\",\n \"user.multifactor_authentication.read\",\n \"user.multifactor_authentication.update\",\n \"user.password.read\",\n \"user.password.update\",\n \"user.profile.read\",\n \"user.profile.update\",\n \"user.scheduled_sends.create\",\n \"user.scheduled_sends.delete\",\n \"user.scheduled_sends.read\",\n \"user.scheduled_sends.update\",\n \"user.settings.enforced_tls.read\",\n \"user.settings.enforced_tls.update\",\n \"user.timezone.read\",\n \"user.username.read\",\n \"user.username.update\",\n \"user.webhooks.event.settings.read\",\n \"user.webhooks.event.settings.update\",\n \"user.webhooks.event.test.create\",\n \"user.webhooks.event.test.read\",\n \"user.webhooks.event.test.update\",\n \"user.webhooks.parse.settings.create\",\n \"user.webhooks.parse.settings.delete\",\n \"user.webhooks.parse.settings.read\",\n \"user.webhooks.parse.settings.update\",\n \"user.webhooks.parse.stats.read\",\n \"whitelabel.create\",\n \"whitelabel.delete\",\n \"whitelabel.read\",\n \"whitelabel.update\"\n]\n```\n\n\n

\n Alerts\n

\n\n```json\n\"scopes\": [\n \"alerts.create\",\n \"alerts.delete\",\n \"alerts.read\",\n \"alerts.update\"\n]\n```\n\n\n

\n API Keys\n

\n\n```json\n\"scopes\": [\n \"api_keys.create\",\n \"api_keys.delete\",\n \"api_keys.read\",\n \"api_keys.update\"\n]\n```\n\n

\n ASM Groups\n

\n\n```json\n\"scopes\": [\n \"asm.groups.create\",\n \"asm.groups.delete\",\n \"asm.groups.read\",\n \"asm.groups.update\"\n]\n```\na>\n

\n Billing\n

\n\n**Billing permissions are mutually exclusive from all other permissions. An API Key can have *either* Billing Permissions *or* any other set of Permissions but not *both*.**\n\n```json\n\"scopes\": [\n \"billing.create\",\n \"billing.delete\",\n \"billing.read\",\n \"billing.update\"\n]\n```\n\n
\n

\n Categories\n

\n\n```json\n\"scopes\": [\n \"categories.create\",\n \"categories.delete\",\n \"categories.read\",\n \"categories.update\",\n \"categories.stats.read\",\n \"categories.stats.sums.read\"\n]\n```\n\n\n

\n Clients\n

\n\n```json\n\"scopes\": [\n \"clients.desktop.stats.read\",\n \"clients.phone.stats.read\",\n \"clients.stats.read\",\n \"clients.tablet.stats.read\",\n \"clients.webmail.stats.read\"\n]\n```\n\n\n

\n Credentials\n

\n\n```json\n\"scopes\": [\n \"credentials.create\",\n \"credentials.delete\",\n \"credentials.read\",\n \"credentials.update\"\n]\n```\n\n\n

\n IPs\n

\n\n```json\n\"scopes\": [\n \"ips.assigned.read\",\n \"ips.read\",\n \"ips.pools.create\",\n \"ips.pools.delete\",\n \"ips.pools.read\",\n \"ips.pools.update\",\n \"ips.pools.ips.create\",\n \"ips.pools.ips.delete\",\n \"ips.pools.ips.read\",\n \"ips.pools.ips.update\",\n \"ips.warmup.create\",\n \"ips.warmup.delete\",\n \"ips.warmup.read\",\n \"ips.warmup.update\"\n]\n```\n\n\n

\n Mail Settings\n

\n\n```json\n\"scopes\": [\n \"mail_settings.address_whitelist.read\",\n \"mail_settings.address_whitelist.update\",\n \"mail_settings.bcc.read\",\n \"mail_settings.bcc.update\",\n \"mail_settings.bounce_purge.read\",\n \"mail_settings.bounce_purge.update\",\n \"mail_settings.footer.read\",\n \"mail_settings.footer.update\",\n \"mail_settings.forward_bounce.read\",\n \"mail_settings.forward_bounce.update\",\n \"mail_settings.forward_spam.read\",\n \"mail_settings.forward_spam.update\",\n \"mail_settings.plain_content.read\",\n \"mail_settings.plain_content.update\",\n \"mail_settings.read\",\n \"mail_settings.spam_check.read\",\n \"mail_settings.spam_check.update\",\n \"mail_settings.template.read\",\n \"mail_settings.template.update\"\n]\n```\n\n\n

\n Mail\n

\n\n```json\n\"scopes\": [\n \"mail.batch.create\",\n \"mail.batch.delete\",\n \"mail.batch.read\",\n \"mail.batch.update\",\n \"mail.send\"\n]\n```\n\n\n

\n Marketing Campaigns\n

\n\n```json\n\"scopes\": [\n \"marketing_campaigns.create\",\n \"marketing_campaigns.delete\",\n \"marketing_campaigns.read\",\n \"marketing_campaigns.update\"\n]\n```\n\n\n

\n Newsletter\n

\n\n```json\n\"scopes\": [\n \"newsletter.create\",\n \"newsletter.delete\",\n \"newsletter.read\",\n \"newsletter.update\"\n]\n```\n\n\n

\n Partner-Settings\n

\n\n```json\n\"scopes\": [\n \"partner_settings.new_relic.read\",\n \"partner_settings.new_relic.update\",\n \"partner_settings.read\",\n \"partner_settings.sendwithus.read\",\n \"partner_settings.sendwithus.update\"\n]\n```\n\na>\n

\n Scheduled Sends\n

\n\n```json\n\"scopes\": [\n \"user.scheduled_sends.create\",\n \"user.scheduled_sends.delete\",\n \"user.scheduled_sends.read\",\n \"user.scheduled_sends.update\"\n]\n```\n\n
\n

\n Stats\n

\n\n```json\n\"scopes\": [\n \"email_activity.read\",\n \"stats.read\",\n \"stats.global.read\",\n \"browsers.stats.read\",\n \"devices.stats.read\",\n \"geo.stats.read\",\n \"mailbox_providers.stats.read\",\n \"clients.desktop.stats.read\",\n \"clients.phone.stats.read\",\n \"clients.stats.read\",\n \"clients.tablet.stats.read\",\n \"clients.webmail.stats.read\"\n]\n```\n\n\n

\n Subusers\n

\n\n```json\n\"scopes\": [\n \"subusers.create\",\n \"subusers.delete\",\n \"subusers.read\",\n \"subusers.update\",\n \"subusers.credits.create\",\n \"subusers.credits.delete\",\n \"subusers.credits.read\",\n \"subusers.credits.update\",\n \"subusers.credits.remaining.create\",\n \"subusers.credits.remaining.delete\",\n \"subusers.credits.remaining.read\",\n \"subusers.credits.remaining.update\",\n \"subusers.monitor.create\",\n \"subusers.monitor.delete\",\n \"subusers.monitor.read\",\n \"subusers.monitor.update\",\n \"subusers.reputations.read\",\n \"subusers.stats.read\",\n \"subusers.stats.monthly.read\",\n \"subusers.stats.sums.read\"\n \"subusers.summary.read\"\n]\n```\n\n\n

\n Suppressions\n

\n\n```json\n\"scopes\": [\n \"suppression.create\",\n \"suppression.delete\",\n \"suppression.read\",\n \"suppression.update\",\n \"suppression.bounces.create\",\n \"suppression.bounces.read\",\n \"suppression.bounces.update\",\n \"suppression.bounces.delete\",\n \"suppression.blocks.create\",\n \"suppression.blocks.read\",\n \"suppression.blocks.update\",\n \"suppression.blocks.delete\",\n \"suppression.invalid_emails.create\",\n \"suppression.invalid_emails.read\",\n \"suppression.invalid_emails.update\",\n \"suppression.invalid_emails.delete\",\n \"suppression.spam_reports.create\",\n \"suppression.spam_reports.read\",\n \"suppression.spam_reports.update\",\n \"suppression.spam_reports.delete\",\n \"suppression.unsubscribes.create\",\n \"suppression.unsubscribes.read\",\n \"suppression.unsubscribes.update\",\n \"suppression.unsubscribes.delete\"\n]\n```\n\n\n

\n Teammates\n

\n\n```json\n\"scopes\": [\n \"teammates.create\",\n \"teammates.read\",\n \"teammates.update\",\n \"teammates.delete\"\n]\n```\n\n\n

\n Templates\n

\n\n```json\n\"scopes\": [\n \"templates.create\",\n \"templates.delete\",\n \"templates.read\",\n \"templates.update\",\n \"templates.versions.activate.create\",\n \"templates.versions.activate.delete\",\n \"templates.versions.activate.read\",\n \"templates.versions.activate.update\",\n \"templates.versions.create\",\n \"templates.versions.delete\",\n \"templates.versions.read\",\n \"templates.versions.update\"\n]\n```\n\n\n

\n Tracking\n

\n\n```json\n\"scopes\": [\n \"tracking_settings.click.read\",\n \"tracking_settings.click.update\",\n \"tracking_settings.google_analytics.read\",\n \"tracking_settings.google_analytics.update\",\n \"tracking_settings.open.read\",\n \"tracking_settings.open.update\",\n \"tracking_settings.read\",\n \"tracking_settings.subscription.read\",\n \"tracking_settings.subscription.update\"\n]\n```\n\n\n

\n User Settings\n

\n\n```json\n\"scopes\": [\n \"user.account.read\",\n \"user.credits.read\",\n \"user.email.create\",\n \"user.email.delete\",\n \"user.email.read\",\n \"user.email.update\",\n \"user.multifactor_authentication.create\",\n \"user.multifactor_authentication.delete\",\n \"user.multifactor_authentication.read\",\n \"user.multifactor_authentication.update\",\n \"user.password.read\",\n \"user.password.update\",\n \"user.profile.read\",\n \"user.profile.update\",\n \"user.settings.enforced_tls.read\",\n \"user.settings.enforced_tls.update\",\n \"user.timezone.read\",\n \"user.timezone.update\",\n \"user.username.read\",\n \"user.username.update\"\n]\n```\n\n\n

\n Webhook\n

\n\n```json\n\"scopes\": [\n \"user.webhooks.event.settings.read\",\n \"user.webhooks.event.settings.update\",\n \"user.webhooks.event.test.create\",\n \"user.webhooks.event.test.read\",\n \"user.webhooks.event.test.update\",\n \"user.webhooks.parse.settings.create\",\n \"user.webhooks.parse.settings.delete\",\n \"user.webhooks.parse.settings.read\",\n \"user.webhooks.parse.settings.update\",\n \"user.webhooks.parse.stats.read\"\n]\n```\n\n\n

\n Domain Authentication (formerly Whitelabel)\n

\n\n```json\n\"scopes\": [\n \"whitelabel.create\",\n \"whitelabel.delete\",\n \"whitelabel.read\",\n \"whitelabel.update\"\n]\n```\n\n\n

\n Reverse DNS (formerly Whitelist)\n

\n\n```json\n\"scopes\": [\n \"access_settings.activity.read\",\n \"access_settings.whitelist.create\",\n \"access_settings.whitelist.delete\",\n \"access_settings.whitelist.read\",\n \"access_settings.whitelist.update\"\n]\n```", + "id": "api-key-permissions", + "name": "API Key Permissions", + "public": true + }, + "api-rate-limits": { + "content": "## Rate Limit Response Header\n\nAll calls within the Web API are allotted a specific number of requests per refresh period.\n\nEach Web API request returns the following header information regarding rate limits and number of requests left.\n\nDepending on the endpoint you are trying to reach, it will have a specific number of allowed requests per refresh period. Once this threshold has been reached, we will return a status code `429` response.\n\n### Example\n\n```bash\nGET https://api.sendgrid.com/v3/resource HTTP/1.1\n```\n\n```json\nHTTP/1.1 200 OK\nContent-Type: application/json\nX-RateLimit-Limit: 500\nX-RateLimit-Remaining: 499\nX-RateLimit-Reset: 1392815263\n\n{\n \"foo\": \"bar\"\n}\n```\n\n## When You Reach a Rate Limit\n\nYou will no longer be able to make request against that endpoint for the duration of that refresh period.\n\n### Example\n\n```bash\nGET https://api.sendgrid.com/v3/resource/ HTTP/1.1\n```\n\n```json\nHTTP/1.1 429 TOO MANY REQUESTS\nContent-Type: application/json\nX-RateLimit-Limit: 150\nX-RateLimit-Remaining: 0\nX-RateLimit-Reset: 1392815263\n\n{\n \"errors\": [\n {\n \"field\": null,\n \"message\": \"too many requests\"\n },\n ]\n}\n```", + "id": "api-rate-limits", + "name": "Rate Limits", + "public": true + }, + "api-requests": { + "content": "## Making a Request\n\n### Host\n\nThe host for Web API v3 requests is always `https://sendgrid.com/v3/`\n\n**All requests must be made over HTTPS. The API does not support HTTP.**\n\n### Authorization Header\n\nYou must provide an authorization header as described in [Authentication]().\n\n### HTTP Verbs\n\n| **Verb** | **Description** |\n| --- | --- |\n| GET | Retrieve a resource or group of resources |\n| POST| Create a new resource |\n| PUT | Update an existing resource |\n| DELETE | Delete an existing resource |\n| OPTIONS | View allowed verbs against a specific resource |\n\n### Accept Header\n\nThe API provides JSON responses. It doesn't currently require the [accept header](http://www.soapui.org/Best-Practices/understanding-rest-headers-and-parameters.html), but might in the future. If not set, the API will use `application/json`.\n\n```bash\nGET https://api.sendgrid.com/v3/endpoint HTTP/1.1\nAccept: application/json\n```\n\n### Arrays of Data\n\nWhen you send an array of data in a `GET` request, you will include the parameter multiple times on the URL. The parameter name does not require brackets.\n\n#### Example Array in a GET request\\\n\n```bash\nGET https://api.sendgrid.com/v3/endpoint?parameter=data1¶meter=data2 HTTP/1.1\n```\n\n## Formatting Your Request\n\n### Request Body\n\nWhen submitting data to a resource via `POST` or `PUT`, you must submit your payload in JSON.\n\n```bash\nPOST https://api.sendgrid.com/v3/templates/ HTTP/1.1\nContent-Type: application/json\n```\n\n```json\n{\n \"name\": \"new template name\"\n}\n```\n\n### Pagination\n\nSome `GET` resources allow for retrieval of information in batches. We will provide the query args in the resource documentation when available to consume.\n\nWhen requesting multiple items, we will default the request limit to 500 items. You can specify a different limit but cannot exceed the default limit.\n\nResources documented will display a bolded list of available paginated parameters if available.\n\nBelow is a basic pagination example. In the resource documentation, we will only provide the bolded list of available parameters.\n\n**A [Link Header](http://tools.ietf.org/html/rfc5988) is provided in the response for batched information.**\n\n```bash\nGET https://api.sendgrid.com/v3/resource?limit=300&offset=10 HTTP/1.1\n```\n\n| **Parameter** | **Description** |\n|---|---|\n| limit | The number of records to return |\n| offset | The number of records to skip |\n\n### Search & Paramters\n\nSome resources allow for you to search by a specific field. Other resources require you to append a parameter to the URI.\n\nIn this example, we will display a paginated URI example, searching for resources where the email contains `foo`.\n\n```bash\nGET https://api.sendgrid.com/v3/resource?email=foo&bar=baz HTTP/1.1\n```\n\n## Successful Requests\n\nBelow is a general overview of what resource objects return with successful Web API requests.\n\n| **Verb** | **Resource object returned** |\n|---|---|\n| GET | Returns a single resource object or array of resource objects |\n| PATCH | Returns the updated resource object |\n| PUT | Returns the updated resource object |\n| DELETE | No content is returned |\n| POST | Returns the newly created resource object |", + "id": "api-requests", + "name": "Requests", + "public": true + }, + "api-responses": { + "content": "## Content-Type Header\n\nAll responses are returned in JSON format. We specify this by sending the `Content-Type` header.\n\n```bash\nGET https://api.sendgrid.com/v3/resource HTTP/1.1\n```\n\n```json\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"foo\": \"bar\"\n}\n```\n\n## Status Codes\n\nBelow is a table containing descriptions of the various status codes we currently support against various resources.\n\n| **Status Code** | **Description** |\n|---|---|\n| 200 | No error |\n| 201 | Successfully created |\n| 204 | Successfully deleted |\n| 400 | Bad request|\n| 401 | Requires authentication |\n| 403 | From address doesn't match Verified Sender Identity. To learn how to resolve this error, see our [Sender Identity requirements]({{root_url}}for-developers/sending-email/sender-identity/). |\n| 406 | Missing Accept header. For example: `Accept: application/json` |\n| 429 | Too many requests/Rate limit exceeded |\n| 500 | Internal server error |\n\n\n## Pagination\n\nWhen a request is made with a pagination query, the following data is included in the header to allow for easy traversal of previous, current, first, and last page of the data set.\n\n```bash\nGET https://api.sendgrid.com/v3/resource?limit=5&offset=0 HTTP/1.1\n```\n\n```json\nHTTP/1.1 200 OK\nContent-Type: application/json\n\nLink: ; rel=\"next\"; title=\"2\",\n ; rel=\"prev\"; title=\"1\",\n ; rel=\"last\"; title=\"3\",\n ; rel=\"first\"; title=\"1\"\n\n```", + "id": "api-responses", + "name": "Responses", + "public": true + }, + "mail-send-errors": { + "content": "\n\n\n

Personalizations Errors

\n\n\n\n\n

personalizations

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n \n
Error CodeError MessageDetails
400
The personalization block is limited to 1000 personalizations per API request. You have provided X personalizations. Please consider splitting this into multiple requests and resending your request.
The v3 Mail Send endpoint is only capable of processing 1000 individual personalizations objects per request. If you need to send your email to more than 1000 different recipients, we recommend that you simply make more than one call. For more information about the personalizations array, and how you can use it to define who you would like you send your email to, and how you would like your email to be processed, please visit our Personalizations documentation.
You must have at least one personalization.
Every email you send must have at least one recipient email address included. Recipients are defined in the personalizations array. For more information on how to use personalizations to define who you want to send your email to, please visit our Personalizations documentation.
There is a limit of 1000 total recipients (to + cc + bcc) per request.
The combined, total number of email recipients may never exceed 1000. This includes recipients defined within the to, cc, and bcc parameters. For more information on how you may specify your recipients, please visit our Personalizations documentation.
Each \"to\" object must at least have an email address and may also contain a name. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
For every recipient that you define within a personalizations.to parameter, you must include one valid email address. You are not required to include a name.
Each unique email address in the personalizations array should only be included once. You have included [email address] more than once.
To prevent the same email from being delivered to one recipient multiple times, SendGrid will confirm that you do not duplicate an email address in your request. For more information on how you may specify your recipients, please visit our Personalizations documentation.
The to parameter is required for all personalization objects.
For every single object that you include within the personalizations array, you must include at least one to email object with a valid email address. For more information on how you may specify your recipients, please visit our Personalizations documentation.
\n\n\n\n\n

personalizations.bcc

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The bcc array, when used, must at least have an email parameter with a valid email address and it may also contain a name parameter. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
For every blind carbon copy of your email, you must include one, valid recipient email address. However, you are not required to include a corresponding name with the recipient email address. For more information on how to use personalizations to define who you want to send your email to, please visit our Personalizations documentation.
Each recipient object must at least have an email address and may also contain a name. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
Every recipient that you define within the personalizations.cc array must be in the form of an email object including one, valid email address. You are not required to include a name.
Each unique email address in the personalization block should only be included once. You have included [email address] more than once.
To prevent the same email from being delivered to one recipient multiple times, SendGrid will confirm that you do not duplicate an email address in your request. For more information on how you may specify your recipients, please visit our Personalizations documentation.
\n\n\n\n\n

personalizations.cc

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The cc array, when used, must at least have an email parameter with a valid email address and it may also contain a name parameter. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
For every carbon copy of your email, you must include one valid recipient email address. However, you are not required to include a corresponding name with the recipient email address. For more information on how to use personalizations to define who you want to send your email to, please visit our Personalizations documentation.
Each recipient object must at least have an email address and may also contain a name. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
Every recipient that you define within the personalizations.cc array must be in the form of an email object including one, valid email address. You are not required to include a name.
Each unique email address in the personalization block should only be included once. You have included [email address] more than once.
To prevent the same email from being delivered to one recipient multiple times, SendGrid will confirm that you do not duplicate an email address in your request. For more information on how you may specify your recipients, please visit our Personalizations documentation.
\n\n\n\n\n

personalizations.custom_args

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
All values of custom arguments object must be strings
Custom argument values must always be strings. You cannot define arrays, integers, or booleans as custom argument values. Click here more information about how to use custom arguments.
custom_args cannot be empty.
If you include the custom_args parameter, you must include at least one value. If you do not want to use any custom arguments, simply omit the custom_arg param from your request. Click here more information about how to use custom arguments.
The combined size of both global and personalization custom arguments may not exceed 10,000 bytes per personalization.
personalizations[x].custom_args will be merged with message level custom_args, overriding any conflicting keys. The combined total size of the resulting custom arguments, after merging, for each personalization may not exceed 10,000 bytes. Click here more information about how to use custom arguments.
\n\n\n\n\n

personalizations.headers

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
All values of the headers object must be strings.
The object type of every header that you include must be a string. You cannot include headers that are integers, booleans, or arrays.
The headers cannot contain duplicate keys.
You may not include the same header more than once.
Header keys cannot contain non-ASCII characters or empty spaces.
When defining the headers that you would like to use, you must make sure that the string contains only ASCII characters.
Header cannot be one of the reserved keys.
Some header keys are reserved. You may not include any of the following reserved keys: x-sg-id, x-sg-eid, received, dkim-signature, Content-Type, Content-Transfer-Encoding, To, From, Subject, Reply-To, CC, BCC.
\n\n\n\n\n

personalizations.send_at

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The send_at parameter is expecting a Unix timestamp as an integer. We will send immediately if you include a send_at timestamp that is in the past.
send_at accepts a unix timestamp representing when you want your email to be sent from SendGrid. If you want the email to be sent at the time of your API request, simply omit the send_at parameter.
Scheduling more than 72 hours in advance is forbidden.
The send_at parameter allows you to schedule your email to be sent up to 72 hours in advance, but due to our constraints, we cannot schedule emails more than 72 hours in the future. For more information on scheduling parameters, please see our API Reference.
\n\n\n\n\n

personalizations.subject

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The subject of your email must be a string at least one character in length.
You are required to include a subject for every email you send, and you may not include an empty subject. The minimum length of your subject is one character.
The subject is required. You can get around this requirement if you use a template with a subject defined.
Every email must have a subject. This can be accomplished 3 ways: you include a template that has a subject, you define a global subject, or every single personalizations object has a subject.
\n\n\n\n\n

personalizations.substitutions

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The substitution values must be an object of key/value pairs, where the values are all strings.
Substitutions must always follow the pattern \"substitution_tag\": \"value to substitute\". The value to substitute for the \"substitution_tag\" must always be a string.
You are limited to 10,000 substitutions.
You may not make more than 10,000 bytes worth of substitutions per request. Substitutions will apply to the content of your email, in addition to the subject and reply_to parameters
\n\n\n\n\n

personalizations.to

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The to array must at least have an email parameter with a valid email address and it may also contain a name parameter. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
Every email you send must have at least one, valid recipient email address included. However, you are not required to include a corresponding name with the recipient email address. For more information on how to use personalizations to define who you want to send your email to, please visit our Personalizations documentation.
\n\n\n\n\n

ASM Errors

\n\n\n\n\n

asm.group_id

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The ASM group ID must be an integer.
Suppression Groups, or unsubscribe groups, are a great way to record which emails your recipients want to receive. Including the asm.group_id in your request allows you to group your email with other, similar sends. However, these group IDs are always generated as integers, and so you must ensure that asm.group_id is defined as an integer. For more information please read our Unsubscribe Groups documentation.
The ASM group ID must be a valid Group ID on your account. You provided [YOUR ASM GROUP ID].
\n\n\n\n\n

asm.groups_to_display

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The ASM Group IDs to display must be an array of integers.
All ASM groups to display must be valid ASM groups IDs on your account. You provided {invalid IDs}.
There is a limit of 25 unsubscribe groups that can be displayed to a user at a time.\n
\n\n\n\n\n

Attachment Errors

\n\n\n\n\n

attachments.content

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The attachment content must be base64 encoded.
The attachment content must be a string at least one character in length.
\n\n\n\n\n

attachments.content_id

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The content ID of your attachment must be a string. You provided [YOUR CONTENT ID].
The content_id is a unique id that you specify for the attachment. This is used when the disposition is set to \"inline\" and the attachment is an image, allowing the file to be displayed within the body of your email. For example, <img src=\"cid:ii_139db99fdb5c3704\"></img>
The content ID of your attachment cannot contain CRLF characters.
When defining your content_id, you may not include the characters ;, ,, n, or r.
\n\n\n\n\n

attachments.disposition

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The disposition of your attachment can be either \"inline\" or \"attachment\". You provided [YOUR DISPOSITION].
The content-disposition of your attachment defines how you would like the attachment to be displayed. For example, \"inline\" results in the attached file being displayed automatically within the message while \"attachment\" results in the attached file requiring some action to be taken before it is displayed (e.g. opening or downloading the file). attachments.disposition always defaults to \"attachment\". Can be either \"attachment\" or \"inline\".
\n\n\n\n\n

attachments.filename

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The filename of your attachment must be a string.
The filename of your attachment cannot contain CRLF characters.
When defining the filename of your attachment, you may not include the characters ;, ,, n, or r.
filename is required.
You must always include a filename for your attachment.
\n\n\n\n\n

attachments.type

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The attachment type must be a string and at least one character in length.
The type cannot contain ‘;’, or CRLF characters.
When defining the type of your attachment content, you may not include the characters ;, ,, n, or r.
\n\n\n\n\n

Batch ID Errors

\n\n\n\n\n

batch_id

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The batch_id must be a string.
Batch IDs are always generated as strings, so when you choose to include a batch ID in your send, you must make sure that batch_id is defined as a string. You must first generate a batch_id via the API; it will not be automatically generated for you. See the Create a Batch ID API reference to generate a batch_id. For more information about batch IDs, and how you can use them to group sends together, please visit our API Reference.
\n\n\n\n\n

Categories Errors

\n\n\n\n\n

categories

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
There is a limit of 10 categories for each email that is sent. You provided X categories.
For more information on how you can use categories to organize your email analytics, please visit our Categories documentation.
Categories must be an array of strings.
Every object that you include within the categories array must be a string. For more information on how you can use categories to organize your email analytics, please visit our Categories documentation.
Each category must not be longer than 255 characters. [YOUR CATEGORY] exceeds this limit
he maximum length of a category is 255 characters. For more information on how you can use categories to organize your email analytics, please visit our Categories documentation.
The categories must be a unique list, and you have included [YOUR CATEGORY] more than once.
You cannot include the same category more than once within the categories array. For more information on how you can use categories to organize your email analytics, please visit our Categories documentation.
Categories can not contain non-ASCII characters.
Each category name must only be comprised of ASCII characters. For more information on how you can use categories to organize your email analytics, please visit our Categories documentation.
\n\n\n\n\n

Content Errors

\n\n\n\n\n

content

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The content param is required unless you are using a transactional template and have defined a template_ID.
You may not send an email without the content parameter unless you are using a transactional template. This is to prevent you from sending an empty email to your recipients.
There must be at least one defined content block. We typically suggest both text/plain and text/html blocks are included, but only one block is required.
You must specify at least one content type and value for every email you send. We recommend that you include both text/plain and text/html to ensure that all of your recipients are able to read your email, but you are only required to define one type of content.
\n\n\n\n\n

content.type

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
A content type is required, this tells email clients how to display the email.
You must always specify the MIME type of content you are including in your email, and if you are including the text/plain type, it must be specified first, followed by text/html, and then any other MIME types you would like to specify.
The content value must be a string at least one character in length.
You may not send an email with no content.
Your content type must be a string with length of at least one character.
The content of your email must always be contained within a string when you make your request.
Cannot contain ‘;’, or CRLF characters.
When defining the type of your content, you may not include the characters ;, ,, n, or r.
\n\n\n\n\n

content.value

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
A content value is required, this is the content of the email you are sending.
We do not allow you to send an empty email to your recipients. You must always include a value for your content.
The content value must be a string at least one character in length.
We do not allow you to send an empty email to your recipients. Even if you include the content.value parameter, it must include at least one character.
Following RFC 1341, section 7.2, if either text/html or text/plain are to be sent in your email: text/plain needs to be first, followed by text/html, followed by any other content.
The order in which you specify the MIME types of your content must always be text/plain first, if you choose to include it, followed by text/html, and then any other MIME types you wish to include.
\n\n\n\n\n

Encoding Errors

\n\n\n\n\n

Encoding

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
415
Invalid UTF8 in request
Your payload must be encoded in UTF-8. This includes any attachments.
\n\n\n\n\n

From Address Errors

\n\n\n\n\n

from

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The from object must at least have an email parameter with a valid email address and may also contain a name parameter. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
While every from parameter must include a valid email address, you are not required to include a name.
The from object must be provided for every email send. It is an object that requires the email parameter, but may also contain a name parameter. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
You are required to provide a from address whenever you send an email through SendGrid. This is used for authentication purposes and helps to build a positive sending reputation with your recipients' ISPs. You are not required to include a name within the from parameter.
\n\n\n\n\n

Headers Errors

\n\n\n\n\n

headers

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The header values must be strings.
The object type of every header that you include must be a string. You cannot include headers that are integers, booleans, or arrays.
The headers cannot contain duplicate keys.
You may not include the same header more than once.
Header keys cannot contain non-ASCII characters and empty spaces.
When defining the headers that you would like to use, you must make sure that the string contains only ASCII characters.
Header can not be one of the reserved keys.
Some header keys are reserved. You may not include any of the following reserved headers: x-sg-id, x-sg-eid, received, dkim-signature, Content-Type, Content-Transfer-Encoding, To, From, Subject, Reply-To, CC, BCC.
\n\n\n\n\n

IP Pool Errors

\n\n\n\n\n

ip_pool_name

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The name of your IP pool must be a string.
The IP Pool name must be a valid pool name for your account. You provided [YOUR IP POOL NAME].
\n\n\n\n\n

Reply To Errors

\n\n\n\n\n

reply_to

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The reply_to object, when used, must at least have an email parameter with a valid email address and it may also contain a name parameter. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
For every carbon copy of your email, you must include one, valid recipient email address. However, you are not required to include a corresponding name with the recipient email address. For more information on how to use personalizations to define who you want to send your email to, please visit our Personalizations documentation.
\n\n\n\n\n

Sections Errors

\n\n\n\n\n

sections

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The section values must be strings.
The values of your sections parameter will be substituted into the content of your email. We will only perform substitutions using strings, so please make sure that your section values are always defined as strings.
\n\n\n\n\n

Send At Errors

\n\n\n\n\n

send_at

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The send_at parameter is expecting a Unix timestamp as an integer. We will send immediately if you include a send_at timestamp that is in the past.
send_at accepts a unix timestamp representing when you want your email to be sent from SendGrid. If you want the email to be sent at the time of your API request, simply omit the send_at parameter.
Scheduling more than 72 hours in advance is forbidden.
The send_at parameter allows you to schedule your email to be sent up to 72 hours in advance, but due to our constraints, we cannot schedule emails more than 72 hours in the future. For more information on scheduling parameters, please see our API Reference.
\n\n\n\n\n

Subject Line Errors

\n\n\n\n\n

subject

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The subject of your email must be a string at least one character in length.
You are required to include a subject for every email you send, and you may not include an empty subject. The minimum length of your subject is one character.
The subject is required. You can get around this requirement if you use a template with a subject defined or if every personalization has a subject defined.
Every email must have a subject. This can be accomplished 3 ways: you include a template that has a subject, you define a global subject, or every single personalizations object has a subject.
\n\n\n\n\n

Template Errors

\n\n\n\n\n

template_id

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The template ID must be a string, you provided [YOUR TEMPLATE ID].
Template IDs are always strings.
The Template ID must be a valid template id for your account. You provided [YOUR TEMPLATE ID].
We do not allow you to send an empty email, so in the event that the only content of your email is contained within your template, we want to make sure that the included template exists, and is valid.
Must be a valid template.
We do not allow you to send an empty email, so in the event that the only content of your email is contained within your template, we want to make sure that the included template exists, and is valid.
\n\n\n\n\n

Mail Settings Errors

\n\n\n\n\n

mail_settings.bcc.email

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The bcc email recipient object must at least have an email address and may also contain a name. e.g. {\"email\": \"example@example.com\"} or {\"email\": \"example@example.com\", \"name\": \"Example Recipient\"}
You must include a recipient object when using the bcc mail setting.
\n\n\n\n\n

mail_settings.bcc.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The bcc enable param should be a boolean value.
\n\n\n\n\n

mail_settings.bypass_list_management.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The bypass list management enable param should be a boolean value.
\n\n\n\n\n

mail_settings.footer.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The footer enable param should be a boolean value.
\n\n\n\n\n

mail_settings.footer.html

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The text/html version of your footer should be a string.
\n\n\n\n\n

mail_settings.footer.text

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The text/plain version of your footer should be a string.
\n\n\n\n\n

mail_settings.sandbox_mode.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The sandbox mode enable param should be a boolean value.
\n\n\n\n\n

mail_settings.spam_check.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The spam check enable param should be a boolean value.
\n\n\n\n\n

mail_settings.spam_check.post_to_url

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The spam check url must be a string.
You must include the url to post to when using the spam check mail setting.
The `post_to_url` parameter must start with `http://` or `https://`.
\n\n\n\n\n

mail_settings.spam_check.threshold

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The spam check threshold is between 1 and 10, with the lower numbers being the most strict filtering.
You must include the spam check threshold when using the spam check mail setting.
\n\n\n\n\n

Tracking Settings Errors

\n\n\n\n\n

tracking_settings.click_tracking.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The click tracking enable param should be a boolean value.
\n\n\n\n\n

tracking_settings.click_tracking.enable_text

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The click tracking enable text must be a boolean value.
\n\n\n\n\n

tracking_settings.ganalytics.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The Google Analytics enable param must be a boolean value.
\n\n\n\n\n

tracking_settings.ganalytics.utm_campaign

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The Google Analytics utm_campaign must be a string value.
\n\n\n\n\n

tracking_settings.ganalytics.utm_content

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The Google Analytics utm_content must be a string value.
\n\n\n\n\n

tracking_settings.ganalytics.utm_medium

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The Google Analytics utm_medium must be a string value.
\n\n\n\n\n

tracking_settings.ganalytics.utm_source

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The Google Analytics utm_source must be a string value.
\n\n\n\n\n

tracking_settings.ganalytics.utm_term

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The Google Analytics utm_term must be a string value.
\n\n\n\n\n

tracking_settings.open_tracking.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The open tracking enable param should be a boolean value.
\n\n\n\n\n

tracking_settings.open_tracking.substitution_tag

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The open tracking substitution tag must be a string.
\n\n\n\n\n

tracking_settings.subscription_tracking.enable

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The subscription tracking enable param should be a boolean value.
\n\n\n\n\n

tracking_settings.subscription_tracking.html

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The subscription tracking unsubscribe content for text/html messages must be a string.
\n\n\n\n\n

tracking_settings.subscription_tracking.substitution_tag

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The subscription tracking substitution tag must be a string value.
\n\n\n\n\n

tracking_settings.subscription_tracking.text

\n\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n \n \n \n\n\n \n \n\n\n\n \n
Error CodeError MessageDetails
400
The subscription tracking unsubscribe content for text/plain messages must be a string.
\n\n\n\n\n\n ", + "id": "mail-send-errors", + "name": "Errors", + "public": true + }, + "mail-send-limitations": { + "content": "There are several rate limitations and restrictions that you should be aware of when using the v3 Mail Send endpoint.\n\n* The total size of your email, including attachments, must be less than 30MB.\n* The total number of recipients must no more than 1000. This includes all recipients defined within the `to`, `cc`, and `bcc` parameters, across each object that you include in the `personalizations` array.\n* The total length of custom arguments must be less than 10000 bytes.\n* Unicode encoding is not supported for the `from` field.\n* The `to.name`, `cc.name`, and `bcc.name` personalizations cannot include either the `;` or `,` characters.\n\nFor more specific, parameter level requirements and limitations, please refer to the [v3/mail/send documentation](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send).", + "id": "mail-send-limitations", + "name": "Limitations", + "public": true + }, + "mail-send-validation": { + "content": "Whenever you make a request to the v3 Mail Send endpoint, your JSON payload is validated before your email is sent. If there are any errors, SendGrid will attempt to identify and return as many issues as possible for each request. For more information, please read our [error documentation](https://sendgrid.api-docs.io/v3.0/mail-send/mail-send-errors).", + "id": "mail-send-validation", + "name": "Validation", + "public": true + }, + "on-behalf-of": { + "content": "Use the *on-behalf-of* header to make calls for a particular subuser through the parent account. Use this header to automate bulk updates, or to administer a subuser without changing the authentication in your code.\n\nTo use the feature, add the *on-behalf-of* header:\n\n`on-behalf-of: << subuser username >>`\n\nThis header generates the API call as if the subuser account was making the call.\n\nWhen authenticating using the *on-behalf-of* header, you need to use the API key credentials of the **parent account**. For example:\n\n```curl --request GET \\\n --url 'https://api.sendgrid.com/v3/stats?start_date=2018-02-01&aggregated_by=day' \\\n --header 'authorization: Bearer << API KEY >>' \\\n --header 'on-behalf-of: << subuser username >>'\n ```\n\n**Note**: The *on-behalf-of* header does not work with the mail.send API.", + "id": "on-behalf-of", + "name": "On Behalf of Subuser", + "public": true + }, + "tip": { + "content": "Exporting your contacts regularly as a backup to avoid issues is a recommended best practice.", + "id": "tip", + "name": "Tip", + "public": true + } + }, + "version": { + "groups": { + "docs": [ + { + "divider": true, + "items": [], + "name": "Getting Started" + }, + { + "description": "Welcome to SendGrid’s Web API v3! This API is RESTful, fully featured, easy to integrate with, and offers support in [7 different languages](https://sendgrid.com/docs/for-developers/sending-email/libraries/).\n\n## Libraries\n\n* [C#](https://github.com/sendgrid/sendgrid-csharp)\n* [Go](https://github.com/sendgrid/sendgrid-go)\n* [Java](https://github.com/sendgrid/sendgrid-java)\n* [Node.js](https://github.com/sendgrid/sendgrid-nodejs)\n* [PHP](https://github.com/sendgrid/sendgrid-php)\n* [Python](https://github.com/sendgrid/sendgrid-python)\n* [Ruby](https://github.com/sendgrid/sendgrid-ruby)", + "divider": false, + "items": [ + { + "_id": "api-authentication", + "type": "docTextSections" + }, + { + "_id": "api-authorization", + "type": "docTextSections" + }, + { + "_id": "api-requests", + "type": "docTextSections" + }, + { + "_id": "on-behalf-of", + "type": "docTextSections" + }, + { + "_id": "api-responses", + "type": "docTextSections" + }, + { + "_id": "api-rate-limits", + "type": "docTextSections" + }, + { + "_id": "api-errors", + "type": "docTextSections" + } + ], + "name": "How to use the SendGrid v3 API" + }, + { + "description": "", + "divider": false, + "items": [ + { + "_id": "POST_mail-send", + "type": "endpoints" + }, + { + "_id": "mail-send-limitations", + "type": "docTextSections" + }, + { + "_id": "mail-send-validation", + "type": "docTextSections" + }, + { + "_id": "mail-send-errors", + "type": "docTextSections" + }, + { + "_id": "cc_bcc_email_object", + "type": "schemas" + }, + { + "_id": "from_email_object", + "type": "schemas" + }, + { + "_id": "reply_to_email_object", + "type": "schemas" + }, + { + "_id": "to_email_array", + "type": "schemas" + }, + { + "_id": "mailSendErrors", + "type": "traits" + } + ], + "name": "Mail Send" + }, + { + "description": "The Cancel Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID.\n\nA `batch_id` groups multiple scheduled `mail/send` requests together with the same ID. You can cancel or pause all of the `mail/send` requests associated with a batch ID up to 10 minutes before the scheduled send time by passing a `batch_id` to the \"Cancel or puase a scheduled send\" endpoint.\n\nFor a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send, see [\"Canceling a Scheduled Send\"](https://sendgrid.com/docs/for-developers/sending-email/stopping-a-scheduled-send/).\n\nThe Cancel Scheduled Sends API also make it possible to validate a `batch_id` and retrieve all scheduled sends as an array.\n\nWhen a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded.\n\nWhen a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a `pause` status, and your scheduled send will be delivered once the pause is removed. Any messages left with a `pause` status that are more than 72 hours old will be discarded as Expired.", + "divider": false, + "items": [ + { + "_id": "POST_mail-batch", + "type": "endpoints" + }, + { + "_id": "POST_user-scheduledsends", + "type": "endpoints" + }, + { + "_id": "GET_mail-batch-batchid", + "type": "endpoints" + }, + { + "_id": "GET_user-scheduledsends", + "type": "endpoints" + }, + { + "_id": "GET_user-scheduledsends-batchid", + "type": "endpoints" + }, + { + "_id": "PATCH_user-scheduledsends-batchid", + "type": "endpoints" + }, + { + "_id": "DELETE_user-scheduledsends-batchid", + "type": "endpoints" + }, + { + "_id": "mail_batch_id", + "type": "schemas" + }, + { + "_id": "user_scheduled_send_status", + "type": "schemas" + }, + { + "_id": "cancelScheduledSendsErrors", + "type": "traits" + } + ], + "name": "Cancel Scheduled Sends" + }, + { + "divider": true, + "items": [], + "name": "Security" + }, + { + "description": "Your application, mail client, or website can all use API (Application Programming Interface) keys to authenticate access to SendGrid services. You can revoke an API key at any time without having to change your username and password, and an API key can be scoped to perform a limited number of actions.\n\nThere are 3 different types of API keys:\n\n* **Full Access** \nAllows the API key to access `GET`, `PATCH`, `PUT`, `DELETE` and `POST` endpoints for all parts of your account, excluding billing and Email Address Validation.\n* **Restricted Access** \nCustomizes levels of access for all parts of your account, excluding billing and Email Address Validation.\n* **Billing Access** \nAllows the API key to access billing endpoints for the account.\n\nYou must create your first API key using the [Twilio SendGrid App](https://app.sendgrid.com/settings/api_keys). Once you have a key with permissions to manage other keys, you can use the endpoints documented as part of this API.", + "divider": false, + "items": [ + { + "_id": "create-api-keys", + "type": "endpoints" + }, + { + "_id": "GET_apikeys", + "type": "endpoints" + }, + { + "_id": "GET_apikeys-apikeyid", + "type": "endpoints" + }, + { + "_id": "PATCH_apikeys-apikeyid", + "type": "endpoints" + }, + { + "_id": "PUT_apikeys-apikeyid", + "type": "endpoints" + }, + { + "_id": "DELETE_apikeys-apikeyid", + "type": "endpoints" + }, + { + "_id": "api_key_name_id", + "type": "schemas" + }, + { + "_id": "api_key_name_id_scopes", + "type": "schemas" + }, + { + "_id": "apiKeysErrors", + "type": "traits" + } + ], + "name": "API Keys" + }, + { + "divider": false, + "items": [ + { + "_id": "api-key-permissions", + "type": "docTextSections" + }, + { + "_id": "GET_scopes", + "type": "endpoints" + } + ], + "name": "API Key Permissions" + }, + { + "description": "The Enforced TLS settings specify whether or not the recipient of your send is required to support TLS or have a valid certificate. The Enforced TLS endpoint supports retrieving and updating TLS settings.\n\nTwilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted.\n\nYou can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with “TLS required but not supported” as the description.", + "divider": false, + "items": [ + { + "_id": "GET_user-settings-enforcedtls", + "type": "endpoints" + }, + { + "_id": "PATCH_user-settings-enforcedtls", + "type": "endpoints" + }, + { + "_id": "enforced-tls-request-response", + "type": "schemas" + } + ], + "name": "Settings - Enforced TLS" + }, + { + "description": "IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API.\n\nThere is no limit to the number of IP addresses that you can allow.\n\n> It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously, and wish to prevent any 'bad actors' from maliciously gaining access to your account.\n>\n> Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses.\n\nFor more information, please see our [IP Access Management documentation](https://sendgrid.com/docs/ui/account-and-settings/ip-access-management/).", + "divider": false, + "items": [ + { + "_id": "POST_accesssettings-whitelist", + "type": "endpoints" + }, + { + "_id": "GET_accesssettings-activity", + "type": "endpoints" + }, + { + "_id": "GET_accesssettings-whitelist", + "type": "endpoints" + }, + { + "_id": "GET_accesssettings-whitelist-ruleid", + "type": "endpoints" + }, + { + "_id": "DELETE_accesssettings-whitelist", + "type": "endpoints" + }, + { + "_id": "DELETE_accesssettings-whitelist-ruleid", + "type": "endpoints" + }, + { + "_id": "ip-access-response", + "type": "schemas" + } + ], + "name": "IP Access Management" + }, + { + "divider": true, + "items": [], + "name": "Single Sign-On" + }, + { + "divider": false, + "items": [ + { + "_id": "sso-error-response", + "type": "schemas" + }, + { + "_id": "singleSignOnErrorsTrait", + "type": "traits" + } + ], + "name": "Single Sign-On Shared Models and Traits" + }, + { + "description": ">Twilio SendGrid Single Sign-On is currently in beta. The following documentation and product interface may change as the product is improved.\n>\n>**Known limitations during beta** \nTwilio SendGrid SSO does not currently support granting an SSO user access to more than one Subuser without granting the SSO user administrator access at the top level of your Twilio SendGrid account.\n\nThe Single Sign-On APIs allow you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the [SSO section of the Twilio SendGrid App](https://app.sendgrid.com/settings/sso).\n\nThe Certificates API allows you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters.\n\nFor more information about managing SSO Certificates, see the [Twilio SendGrid SSO documentation](https://sendgrid.com/docs/ui/account-and-settings/sso/).", + "divider": false, + "items": [ + { + "_id": "POST_sso-certificates", + "type": "endpoints" + }, + { + "_id": "GET_sso-integrations-integrationid-certificates", + "type": "endpoints" + }, + { + "_id": "GET_sso-certificates-certid", + "type": "endpoints" + }, + { + "_id": "PATCH_sso-certificates-certid", + "type": "endpoints" + }, + { + "_id": "DELETE_sso-certificates-certid", + "type": "endpoints" + }, + { + "_id": "sso-certificate-body", + "type": "schemas" + } + ], + "name": "Certificates" + }, + { + "description": ">Twilio SendGrid Single Sign-On is currently in beta. The following documentation and product interface may change as the product is improved.\n>\n>**Known limitations during beta** \nTwilio SendGrid SSO does not currently support granting an SSO user access to more than one Subuser without granting the SSO user administrator access at the top level of your Twilio SendGrid account.\n\nThe Single Sign-On APIs allow you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the [SSO section of the Twilio SendGrid App](https://app.sendgrid.com/settings/sso).\n\nThe Single Sign-On Settings API allows you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory.\n\n", + "divider": false, + "items": [ + { + "_id": "POST_sso-integrations", + "type": "endpoints" + }, + { + "_id": "GET_sso-integrations", + "type": "endpoints" + }, + { + "_id": "GET_sso-integrations-id", + "type": "endpoints" + }, + { + "_id": "PATCH_sso-integrations-id", + "type": "endpoints" + }, + { + "_id": "DELETE_sso-integrations-id", + "type": "endpoints" + }, + { + "_id": "create-integration-request", + "type": "schemas" + }, + { + "_id": "sso-integration", + "type": "schemas" + } + ], + "name": "Single Sign-On Settings" + }, + { + "description": ">Twilio SendGrid Single Sign-On is currently in beta. The following documentation and product interface may change as the product is improved.\n>\n>**Known limitations during beta** \nTwilio SendGrid SSO does not currently support granting an SSO user access to more than one Subuser without granting the SSO user administrator access at the top level of your Twilio SendGrid account.\n\nThe Single Sign-On APIs allow you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the [SSO section of the Twilio SendGrid App](https://app.sendgrid.com/settings/sso).\n\nThe Single Sign-On Teammates API allows you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials.\n\nTo retrieve or delete an SSO Teammate, you will use the [Teammates API](https://sendgrid.api-docs.io/v3.0/teammates). \n\nFor more information about managing SSO Teammates, see the [Twilio SendGrid SSO documentation](https://sendgrid.com/docs/ui/account-and-settings/sso/#manage-users).", + "divider": false, + "items": [ + { + "_id": "POST_sso-teammates", + "type": "endpoints" + }, + { + "_id": "PATCH_sso-teammates-username", + "type": "endpoints" + }, + { + "_id": "sso-teammate-common-fields", + "type": "schemas" + }, + { + "_id": "sso-teammate-request", + "type": "schemas" + }, + { + "_id": "sso-teammate-response", + "type": "schemas" + }, + { + "_id": "sso-teammates-patch-response", + "type": "schemas" + } + ], + "name": "Single Sign-On Teammates" + }, + { + "divider": true, + "items": [], + "name": "Settings" + }, + { + "description": "Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s v3 API](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) or [SMTP Relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more.\n\nFor a full list of Twilio SendGrid's Mail Settings, and what each one does, see our [Mail Settings documentation](https://sendgrid.com/docs/ui/account-and-settings/mail/).\n\nYou can also manage your Mail Settings in the [Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings)", + "divider": false, + "items": [ + { + "_id": "GET_mailsettings", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-addresswhitelist", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-addresswhitelist", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-footer", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-footer", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-forwardspam", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-forwardspam", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-template", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-template", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-bouncepurge", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-bouncepurge", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-forwardbounce", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-forwardbounce", + "type": "endpoints" + }, + { + "_id": "mail_settings_patch", + "type": "schemas" + }, + { + "_id": "mail_settings_address_whitelabel", + "type": "schemas" + }, + { + "_id": "mail_settings_footer", + "type": "schemas" + }, + { + "_id": "mail_settings_forward_spam", + "type": "schemas" + }, + { + "_id": "mail_settings_template", + "type": "schemas" + }, + { + "_id": "mail_settings_bounce_purge", + "type": "schemas" + }, + { + "_id": "mail_settings_forward_bounce", + "type": "schemas" + } + ], + "name": "Settings - Mail" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "PATCH_partnersettings-newrelic", + "type": "endpoints" + }, + { + "_id": "GET_partnersettings-newrelic", + "type": "endpoints" + }, + { + "_id": "GET_partnersettings", + "type": "endpoints" + }, + { + "_id": "partner_settings_new_relic", + "type": "schemas" + } + ], + "name": "Settings - Partner" + }, + { + "description": "Give and adjust account access.", + "divider": false, + "items": [ + { + "_id": "POST_v3-teammates", + "type": "endpoints" + }, + { + "_id": "POST_v3-teammates-pending-token-resend", + "type": "endpoints" + }, + { + "_id": "GET_v3-teammates", + "type": "endpoints" + }, + { + "_id": "GET_v3-scopes-requests", + "type": "endpoints" + }, + { + "_id": "GET_v3-teammates-pending", + "type": "endpoints" + }, + { + "_id": "GET_v3-teammates-username", + "type": "endpoints" + }, + { + "_id": "PATCH_v3-scopes-requests-approve-id", + "type": "endpoints" + }, + { + "_id": "PATCH_v3-teammates-username", + "type": "endpoints" + }, + { + "_id": "DELETE_v3-scopes-requests-request_id", + "type": "endpoints" + }, + { + "_id": "DELETE_v3-teammates-pending-token", + "type": "endpoints" + }, + { + "_id": "DELETE_v3-teammates-username", + "type": "endpoints" + } + ], + "name": "Teammates" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "POST_alerts", + "type": "endpoints" + }, + { + "_id": "GET_alerts", + "type": "endpoints" + }, + { + "_id": "GET_alerts-alertid", + "type": "endpoints" + }, + { + "_id": "DELETE_alerts-alertid", + "type": "endpoints" + }, + { + "_id": "PATCH_alerts-alertid", + "type": "endpoints" + } + ], + "name": "Alerts" + }, + { + "description": "Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you.\n\nYou can learn more in the [SendGrid Account Details documentation.](https://sendgrid.com/docs/ui/account-and-settings/account/)", + "divider": false, + "items": [ + { + "_id": "user_profile", + "type": "schemas" + }, + { + "_id": "GET_user-profile", + "type": "endpoints" + }, + { + "_id": "PATCH_user-profile", + "type": "endpoints" + }, + { + "_id": "GET_user-account", + "type": "endpoints" + }, + { + "_id": "GET_user-email", + "type": "endpoints" + }, + { + "_id": "PUT_user-email", + "type": "endpoints" + }, + { + "_id": "GET_user-username", + "type": "endpoints" + }, + { + "_id": "PUT_user-username", + "type": "endpoints" + }, + { + "_id": "GET_user-credits", + "type": "endpoints" + }, + { + "_id": "PUT_user-password", + "type": "endpoints" + } + ], + "name": "Users API" + }, + { + "description": "For more information about Subusers, visit the [longform Subusers documentation](https://sendgrid.com/docs/ui/account-and-settings/subusers/). You can also [manage Subusers in the SendGrid console](https://app.sendgrid.com/settings/subusers).", + "divider": false, + "items": [ + { + "_id": "subuser", + "type": "schemas" + }, + { + "_id": "subuser_post", + "type": "schemas" + }, + { + "_id": "GET_subusers", + "type": "endpoints" + }, + { + "_id": "POST_subusers", + "type": "endpoints" + }, + { + "_id": "PATCH_subusers-subusername", + "type": "endpoints" + }, + { + "_id": "DELETE_subusers-subusername", + "type": "endpoints" + }, + { + "_id": "GET_subusers-reputations", + "type": "endpoints" + }, + { + "_id": "PUT_subusers-subusername-ips", + "type": "endpoints" + } + ], + "name": "Subusers API" + }, + { + "description": "Subuser monitor settings allow you to receive a sample of an outgoing message from a specific customer at a specific frequency of emails.", + "divider": false, + "items": [ + { + "_id": "monitor", + "type": "schemas" + }, + { + "_id": "GET_subusers-subusername-monitor", + "type": "endpoints" + }, + { + "_id": "POST_subusers-subusername-monitor", + "type": "endpoints" + }, + { + "_id": "PUT_subusers-subusername-monitor", + "type": "endpoints" + }, + { + "_id": "DELETE_subusers-subusername-monitor", + "type": "endpoints" + } + ], + "name": "Subuser Monitor Settings" + }, + { + "description": "Subuser statistics enable you to view specific segments of your statistics, as compared to the general overview of all email activity on your account. SendGrid tracks your subusers' emails sent, bounces, and spam reports. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.\n\nFor more information, see our [Subusers documentation](https://sendgrid.com/docs/ui/account-and-settings/subusers/). You can also access [Subuser Statistics in the SendGrid console](https://app.sendgrid.com/statistics/subuser).", + "divider": false, + "items": [ + { + "_id": "subuser_stats", + "type": "schemas" + }, + { + "_id": "GET_subusers-subusername-stats-monthly", + "type": "endpoints" + }, + { + "_id": "GET_subusers-stats-monthly", + "type": "endpoints" + }, + { + "_id": "GET_subusers-stats-sums", + "type": "endpoints" + }, + { + "_id": "GET_subusers-stats", + "type": "endpoints" + } + ], + "name": "Subuser Statistics" + }, + { + "divider": true, + "items": [], + "name": "Deliverability" + }, + { + "description": "Email link branding (formerly \"Link Whitelabel\") allows all of the click-tracked links, opens, and images in your emails to be served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email looks trustworthy. They use the reputation of the root domain to determine whether the links can be trusted.\n\nYou can also manage link branding in the [Sender Authentication section of the Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth).\n\nFor more information, please see our [Link Branding documentation](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).", + "divider": false, + "items": [ + { + "_id": "POST_whitelabel-links", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-links-id-validate", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-links-linkid-subuser", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-links", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-links-id", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-links-default", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-links-subuser", + "type": "endpoints" + }, + { + "_id": "PATCH_whitelabel-links-id", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-links-id", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-links-subuser", + "type": "endpoints" + }, + { + "_id": "link_branding_200_response", + "type": "schemas" + } + ], + "name": "Link branding" + }, + { + "description": "IP warming is the practice of gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender.\n\nSendGrid can automatically [warm up](https://sendgrid.com/docs/glossary/ip-warmup/) dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit determined by how long the IP address has been warming up. \n\nSee the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup.\n\nYou can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the [\"IP Addresses\" settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/ip_addresses).", + "divider": false, + "items": [ + { + "_id": "POST_ips-warmup", + "type": "endpoints" + }, + { + "_id": "GET_ips-warmup", + "type": "endpoints" + }, + { + "_id": "GET_ips-warmup-ipaddress", + "type": "endpoints" + }, + { + "_id": "DELETE_ips-warmup-ipaddress", + "type": "endpoints" + }, + { + "_id": "ip_warmup_response", + "type": "schemas" + } + ], + "name": "IP Warmup" + }, + { + "description": "Reverse DNS (formerly IP Whitelabel) allows mailbox providers to verify the sender of an email by performing a reverse DNS lookup upon receipt of the emails you send.\n\nReverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only.\n\nWhen setting up reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to your DNS records. The A Record maps your sending domain to a dedicated Twilio SendGrid IP address.\n\nA Reverse DNS consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated.\n\nYou can also manage your reverse DNS settings in the [Sender Authentication setion of the Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth).\n\nFor more about Reverse DNS, see [\"How to set up reverse DNS\"](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) in the Twilio SendGrid documentation.", + "divider": false, + "items": [ + { + "_id": "POST_whitelabel-ips", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-ips-id-validate", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-ips", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-ips-id", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-ips-id", + "type": "endpoints" + }, + { + "_id": "reverse_dns", + "type": "schemas" + } + ], + "name": "Reverse DNS" + }, + { + "description": "**Email Address Validation is available to Email API Pro and Premier level accounts only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including a Full Access API key.**\n\nEmail Address Validation provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case.\n\nYou can use this API to:\n\n* Indicate to users that the address they have entered into a form is invalid.\n* Drop invalid email addresses from your database.\n* [Suppress invalid email addresses](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#different-types-of-suppressions) from your sending to decrease your bounce rate.\n\nYou can learn more about enabling Email Validation in our [Email Validation documentation](https://sendgrid.com/docs/ui/managing-contacts/email-address-validation/).\n\nYou can also view your Email Validation results and metrics in the [Validation section of the Twilio SendGrid App](https://app.sendgrid.com/email_validation). Again, these settings are available only after upgrading your account to Pro or higher.", + "divider": false, + "items": [ + { + "_id": "POST_validations-email", + "type": "endpoints" + } + ], + "name": "Email Address Validation" + }, + { + "description": "If you don't have access to modify your companies DNS records, you can email the records to a co-worker who does to complete [Domain Authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) and/or [Link Branding](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) setups. This email includes a direct link to the DNS records. The link does expire, but the recipient doesn't need login access to your Twilio SendGrid account.\n", + "divider": false, + "items": [ + { + "_id": "POST_whitelabel-dns-email", + "type": "endpoints" + } + ], + "name": "Email CNAME records" + }, + { + "description": "IP pools allow you to group your dedicated SendGrid IP addresses. For example, you could create separate one pool for your transactional email and another for your marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.\n\nA single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it.\n\nIP pools can only be used with IP addresses for which you’ve set up a reverse DNS record.\n\nIf an IP pool is *not* specified for an email, it will use any IP available, including pooled addresses.\n\n**Each user can create up to 10 different IP pools.**", + "divider": false, + "items": [ + { + "_id": "POST_ips-pools", + "type": "endpoints" + }, + { + "_id": "POST_ips-pools-poolname-ips", + "type": "endpoints" + }, + { + "_id": "GET_ips-pools", + "type": "endpoints" + }, + { + "_id": "GET_ips-pools-poolname", + "type": "endpoints" + }, + { + "_id": "PUT_ips-pools-poolname", + "type": "endpoints" + }, + { + "_id": "DELETE_ips-pools-poolname", + "type": "endpoints" + }, + { + "_id": "DELETE_ips-pools-poolname-ips-ip", + "type": "endpoints" + }, + { + "_id": "ip_pool", + "type": "schemas" + }, + { + "_id": "ip_pool_response", + "type": "schemas" + } + ], + "name": "IP Pools" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "POST_ips", + "type": "endpoints" + }, + { + "_id": "GET_ips-remaining", + "type": "endpoints" + }, + { + "_id": "GET_ips", + "type": "endpoints" + }, + { + "_id": "GET_ips-assigned", + "type": "endpoints" + }, + { + "_id": "GET_ips-ipaddress", + "type": "endpoints" + } + ], + "name": "IP Addresses" + }, + { + "description": "An authenticated domain allows you to remove the “via” or “sent on behalf of” message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will get 2 TXT records and 1 MX record.\n\nDomain Authentication was formerly called \"Domain Whitelabel\".\n\nFor more information, please see [How to set up domain authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/).", + "divider": false, + "items": [ + { + "_id": "domain_authentication:domain_spf", + "type": "schemas" + }, + { + "_id": "authentication::domain", + "type": "schemas" + }, + { + "_id": "domain-authentication-200-response", + "type": "schemas" + }, + { + "_id": "GET_whitelabel-domains", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-domains-domainid", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-domains", + "type": "endpoints" + }, + { + "_id": "PATCH_whitelabel-domains-domainid", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-domains-domainid", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-domains-default", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-domains-id-ips", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-domains-id-ips-ip", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-domains-id-validate", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-domains-subuser", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-domains-subuser", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-domains-domainid-subuser", + "type": "endpoints" + } + ], + "name": "Domain Authentication" + }, + { + "description": "The Sender Verification API exposes multiple endpoints that allow you to programmatically manage the [Sender Identities](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/) that are authorized to send email for your account.\nYou can also manage Sender Identities in the SendGrid app by selecting [**Sender Authentication** under **Settings** in the navigation bar](https://app.sendgrid.com/settings/sender_auth). For full app instructions, see [Sender Verification](https://sendgrid.com/docs/ui/sending-email/sender-verification/).\n\nThe Sender Verification API provides a RESTful interface for creating new Sender Identities, retrieving a list of existing Sender Identities, checking the status of a Sender Identity, updating a Sender Identity, and deleting a Sender Identity.\n \nThis API offers additional endpoints to check for domains known to implement DMARC, and resend verification emails to Sender Identities that have yet to complete the verification process.", + "divider": false, + "items": [ + { + "_id": "GET_verifiedsenders-domains", + "type": "endpoints" + }, + { + "_id": "GET_verifiedsenders-stepscompleted", + "type": "endpoints" + }, + { + "_id": "POST_verifiedsenders", + "type": "endpoints" + }, + { + "_id": "GET_verifiedsenders-verify-token", + "type": "endpoints" + }, + { + "_id": "PATCH_verifiedsenders-id", + "type": "endpoints" + }, + { + "_id": "DELETE_verifiedsenders-id", + "type": "endpoints" + }, + { + "_id": "GET_verifiedsenders", + "type": "endpoints" + }, + { + "_id": "POST_verifiedsenders-resend-id", + "type": "endpoints" + }, + { + "_id": "verified-sender-request-schema", + "type": "schemas" + }, + { + "_id": "verified-sender-response-schema", + "type": "schemas" + } + ], + "name": "Sender Verification" + }, + { + "divider": true, + "items": [], + "name": "Design Library" + }, + { + "description": "The Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs).\n\nThe Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends, Automations, and Dynamic Templates.\n\nYou can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started.\n\nThe Designs API provides a RESTful interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design.", + "divider": false, + "items": [ + { + "_id": "_metadata", + "type": "schemas" + }, + { + "_id": "api-error", + "type": "schemas" + }, + { + "_id": "api-errors", + "type": "schemas" + }, + { + "_id": "design-duplicate-input", + "type": "schemas" + }, + { + "_id": "design-common-fields", + "type": "schemas" + }, + { + "_id": "design-input", + "type": "schemas" + }, + { + "_id": "design-output-summary", + "type": "schemas" + }, + { + "_id": "design-output", + "type": "schemas" + }, + { + "_id": "designsQueryStrings", + "type": "traits" + }, + { + "_id": "POST-design", + "type": "endpoints" + }, + { + "_id": "POST-design", + "type": "endpoints" + }, + { + "_id": "LIST-designs", + "type": "endpoints" + }, + { + "_id": "GET-design", + "type": "endpoints" + }, + { + "_id": "POST-sendgrid-pre-built-design", + "type": "endpoints" + }, + { + "_id": "LIST-Sendgrid-Pre-built-designs", + "type": "endpoints" + }, + { + "_id": "GET-sendgrid-pre-built-design", + "type": "endpoints" + }, + { + "_id": "PUT-design", + "type": "endpoints" + }, + { + "_id": "DELETE-design", + "type": "endpoints" + } + ], + "name": "Designs API" + }, + { + "divider": true, + "items": [], + "name": "New Marketing Campaigns" + }, + { + "divider": false, + "items": [ + { + "_id": "contact-import", + "type": "schemas" + }, + { + "_id": "single-contact-request", + "type": "schemas" + }, + { + "_id": "contact-export", + "type": "schemas" + }, + { + "_id": "contact-summary", + "type": "schemas" + }, + { + "_id": "contact-request", + "type": "schemas" + }, + { + "_id": "contact-details", + "type": "schemas" + }, + { + "_id": "contact-details2", + "type": "schemas" + }, + { + "_id": "contact-details3", + "type": "schemas" + }, + { + "_id": "PUT_mc-contacts", + "type": "endpoints" + }, + { + "_id": "DELETE_mc-contacts", + "type": "endpoints" + }, + { + "_id": "GET_mc-contacts-count", + "type": "endpoints" + }, + { + "_id": "POST_mc-contacts-exports", + "type": "endpoints" + }, + { + "_id": "GET_mc-contacts-id", + "type": "endpoints" + }, + { + "_id": "POST_mc-contacts-search", + "type": "endpoints" + }, + { + "_id": "GET_mc-contats", + "type": "endpoints" + }, + { + "_id": "PUT_mc-contacts-imports", + "type": "endpoints" + }, + { + "_id": "GET_marketing-contacts-imports-id", + "type": "endpoints" + }, + { + "_id": "GET_mc-contacts-exports-id", + "type": "endpoints" + }, + { + "_id": "GET_marketing-contacts-exports", + "type": "endpoints" + }, + { + "_id": "POST_marketing-contacts-batch", + "type": "endpoints" + }, + { + "_id": "POST_marketing-contacts-search-emails", + "type": "endpoints" + }, + { + "_id": "tip", + "type": "docTextSections" + } + ], + "name": "Contacts" + }, + { + "divider": false, + "items": [ + { + "_id": "segment_status_response", + "type": "schemas" + }, + { + "_id": "all_segments_response", + "type": "schemas" + }, + { + "_id": "segment_summary_v2", + "type": "schemas" + }, + { + "_id": "contact_response", + "type": "schemas" + }, + { + "_id": "segment_response", + "type": "schemas" + }, + { + "_id": "errors-seg-v2", + "type": "schemas" + }, + { + "_id": "segment_write_v2", + "type": "schemas" + }, + { + "_id": "segment_update", + "type": "schemas" + }, + { + "_id": "_metadata", + "type": "schemas" + }, + { + "_id": "POST_segments", + "type": "endpoints" + }, + { + "_id": "errors", + "type": "traits" + }, + { + "_id": "PATCH_segments-segment_id", + "type": "endpoints" + }, + { + "_id": "GET_segments", + "type": "endpoints" + }, + { + "_id": "GET_segments-segment_id", + "type": "endpoints" + }, + { + "_id": "DELETE_segments-segment_id", + "type": "endpoints" + } + ], + "name": "Segmenting Contacts V2 - Beta" + }, + { + "divider": false, + "items": [ + { + "_id": "senders-id-request-body", + "type": "schemas" + }, + { + "_id": "TNE-senderID", + "type": "schemas" + }, + { + "_id": "POST_marketing-senders", + "type": "endpoints" + } + ], + "name": "Senders" + }, + { + "description": "Lists are static collections of Marketing Campaigns contacts. This API allows you to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://sendgrid.api-docs.io/v3.0/contacts).\n\nYou can also manage your lists using the [Contacts menu in the Marketing Campaigns UI](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [\"Building your Contact List\"](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/).", + "divider": false, + "items": [ + { + "_id": "list", + "type": "schemas" + }, + { + "_id": "POST_mc-lists", + "type": "endpoints" + }, + { + "_id": "GET_mc-lists-id-contacts-count", + "type": "endpoints" + }, + { + "_id": "GET_mc-lists-id", + "type": "endpoints" + }, + { + "_id": "GET_mc-lists", + "type": "endpoints" + }, + { + "_id": "PATCH_mc-lists-id", + "type": "endpoints" + }, + { + "_id": "DELETE_lists-id", + "type": "endpoints" + }, + { + "_id": "DELETE_mc-lists-id-contacts", + "type": "endpoints" + } + ], + "name": "Lists" + }, + { + "description": "Custom Fields allow you to add extra information about your contacts to your contact database. With custom fields, you can create custom segments from your individual contacts or from your contact database that will dynamically update your content with the values for the individual contact receiving the email. Your custom fields are completely customizable to the use cases and user information that you need.\n\nYou can also manage your Custom Fields using the [Custom Fields UI in the Marketing Campaigns App](https://mc.sendgrid.com/custom-fields). For more about creating Custom Fields, including a list of Reserved Fields, see our [Custom Fields documentation](https://sendgrid.com/docs/ui/managing-contacts/custom-fields/).", + "divider": false, + "items": [ + { + "_id": "custom-fields-by-name", + "type": "schemas" + }, + { + "_id": "custom-fields-by-id", + "type": "schemas" + }, + { + "_id": "reserved_field_definitions_response", + "type": "schemas" + }, + { + "_id": "custom_field_definitions_response", + "type": "schemas" + }, + { + "_id": "POST_mc-field_definitions", + "type": "endpoints" + }, + { + "_id": "GET_mc-field_definitions", + "type": "endpoints" + }, + { + "_id": "PATCH_mc-field_definitions-custom_field_id", + "type": "endpoints" + }, + { + "_id": "DELETE_mc-field_definitions-custom_field_id", + "type": "endpoints" + } + ], + "name": "Custom Fields" + }, + { + "description": "Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience.\n\nThe Marketing Campaigns Segments API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID.\n\n> Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes.\n>\n> Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating.\n>\n> Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours.\n\nFor more information on creating segments with the Twilio SendGrid Marketing Campaigns UI see [\"Segmenting your Contacts.\"](https://sendgrid.com/docs/ui/managing-contacts/segmenting-your-contacts/)\n\nFor help with Segmentation Query Language, see our [Segmentation Query Language reference](https://sendgrid.com/docs/for-developers/sending-email/segmentation-query-language/)", + "divider": false, + "items": [ + { + "_id": "xJZx99h8rizghwRct", + "type": "traits" + }, + { + "_id": "segment_write", + "type": "schemas" + }, + { + "_id": "contact_response", + "type": "schemas" + }, + { + "_id": "segment_summary", + "type": "schemas" + }, + { + "_id": "full-segment", + "type": "schemas" + }, + { + "_id": "segment_query_json", + "type": "schemas" + }, + { + "_id": "POST_marketing-segments", + "type": "endpoints" + }, + { + "_id": "GET_marketing-segments-segmentid", + "type": "endpoints" + }, + { + "_id": "GET_marketing-segments", + "type": "endpoints" + }, + { + "_id": "PATCH_marketing-segments-segmentid", + "type": "endpoints" + }, + { + "_id": "DELETE_marketing-segments-segmentid", + "type": "endpoints" + }, + { + "_id": "POST_marketing-segments-delete", + "type": "endpoints" + } + ], + "name": "Segmenting Contacts" + }, + { + "description": "A Single Send is a one-time nonautomated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery.\n\nSingle Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates.\n\nThe Single Sends API allows you to create, retrieve, update, delete, schedule, and deliver your Single Sends. There are also endpoints for searching and statistics to help you maintain and alter your Single Sends as you learn more and further develop your campaigns.\n\nThe Single Sends API changed on **May 6, 2020**. Please check the SendGrid Knowledge Center for updates and instructions here: [https://sendgrid.com/docs/for-developers/sending-email/single-sends-2020-update/](https://sendgrid.com/docs/for-developers/sending-email/single-sends-2020-update/)", + "divider": false, + "items": [ + { + "_id": "vve7kMhgurSwPWi6S", + "type": "schemas" + }, + { + "_id": "FTA2YcjxEPyAFfYe8", + "type": "schemas" + }, + { + "_id": "singlesend_request", + "type": "schemas" + }, + { + "_id": "singlesend_response_short", + "type": "schemas" + }, + { + "_id": "singlesend_response", + "type": "schemas" + }, + { + "_id": "singlesend_search", + "type": "schemas" + }, + { + "_id": "singlesend_schedule", + "type": "schemas" + }, + { + "_id": "singlesend_warning", + "type": "schemas" + }, + { + "_id": "abtest_summary", + "type": "schemas" + }, + { + "_id": "POST_marketing-singlesends", + "type": "endpoints" + }, + { + "_id": "POST_marketing-singlesends-id", + "type": "endpoints" + }, + { + "_id": "POST_marketing-singlesends-search", + "type": "endpoints" + }, + { + "_id": "PATCH_marketing-singlesends-id", + "type": "endpoints" + }, + { + "_id": "PUT_marketing-singlesends-id-schedule", + "type": "endpoints" + }, + { + "_id": "GET_marketing-singlesends", + "type": "endpoints" + }, + { + "_id": "GET_marketing-singlesends-id", + "type": "endpoints" + }, + { + "_id": "GET_marketing-singlesends-categories", + "type": "endpoints" + }, + { + "_id": "DELETE_marketing-singlesends-id", + "type": "endpoints" + }, + { + "_id": "DELETE_marketing-singlesends", + "type": "endpoints" + }, + { + "_id": "DELETE_marketing-singlesends-id-schedule", + "type": "endpoints" + } + ], + "name": "Single Sends" + }, + { + "divider": false, + "items": [ + { + "_id": "POST_marketing-test-sendemail", + "type": "endpoints" + } + ], + "name": "Send Test Email" + }, + { + "description": "The Marketing Campaigns Stats endpoints allow you to retrieve stats for both Automations and Single Sends.\n\n**Note:** These endpoints provide stats for Marketing Campaigns only. For stats related to event tracking, please see the **Stats** section under **Event Tracking** below.", + "divider": false, + "items": [ + { + "_id": "automationQueryParams", + "type": "traits" + }, + { + "_id": "singlesendQueryParams", + "type": "traits" + }, + { + "_id": "singlesendQueryParams2", + "type": "traits" + }, + { + "_id": "errorResponse", + "type": "traits" + }, + { + "_id": "baseParams", + "type": "traits" + }, + { + "_id": "pagination", + "type": "traits" + }, + { + "_id": "errors", + "type": "schemas" + }, + { + "_id": "metadata", + "type": "schemas" + }, + { + "_id": "metrics", + "type": "schemas" + }, + { + "_id": "singlesends-response", + "type": "schemas" + }, + { + "_id": "automations-response", + "type": "schemas" + }, + { + "_id": "automations-link-stats-response", + "type": "schemas" + }, + { + "_id": "singlesends-link-stats-response", + "type": "schemas" + }, + { + "_id": "link-tracking-metadata", + "type": "schemas" + }, + { + "_id": "getall-automation-stats", + "type": "endpoints" + }, + { + "_id": "get-automation-stat", + "type": "endpoints" + }, + { + "_id": "getall-singlesend-stats", + "type": "endpoints" + }, + { + "_id": "get-singlesend-stat", + "type": "endpoints" + }, + { + "_id": "get-automation-link-stat", + "type": "endpoints" + }, + { + "_id": "get-singlesend-link-stat", + "type": "endpoints" + }, + { + "_id": "get-singlesend-stats-export", + "type": "endpoints" + }, + { + "_id": "get-automations-stats-export", + "type": "endpoints" + } + ], + "name": "Marketing Campaigns Stats" + }, + { + "divider": true, + "items": [], + "name": "Legacy Marketing Campaigns" + }, + { + "description": "A [Sender Identity](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/) is the email address from which an email is sent. Sender Identities must be verified before use.\n\nIf your domain has been authenticated, it will auto verify on creation. Otherwise, a verification email will be sent to the `from.email`.", + "divider": false, + "items": [ + { + "_id": "senderID", + "type": "schemas" + }, + { + "_id": "sender-id-request", + "type": "schemas" + }, + { + "_id": "POST_senders", + "type": "endpoints" + }, + { + "_id": "GET_v3-senders", + "type": "endpoints" + }, + { + "_id": "GET_v3-senders-sender_id", + "type": "endpoints" + }, + { + "_id": "PATCH_v3-senders-sender_id", + "type": "endpoints" + }, + { + "_id": "POST_v3-senders-sender_id-resend_verification", + "type": "endpoints" + }, + { + "_id": "DELETE_v3-senders-sender_id", + "type": "endpoints" + } + ], + "name": "Sender Identities API" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "contactdb_list", + "type": "schemas" + }, + { + "_id": "POST_contactdb-lists", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-lists", + "type": "endpoints" + }, + { + "_id": "DELETE_contactdb-lists", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-lists-listid", + "type": "endpoints" + }, + { + "_id": "PATCH_contactdb-lists-listid", + "type": "endpoints" + }, + { + "_id": "DELETE_contactdb-lists-listid", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-lists-listid-recipients", + "type": "endpoints" + }, + { + "_id": "POST_contactdb-lists-listid-recipients-recipientid", + "type": "endpoints" + }, + { + "_id": "DELETE_contactdb-lists-listid-recipients-recipientid", + "type": "endpoints" + }, + { + "_id": "POST_contactdb-lists-listid-recipients", + "type": "endpoints" + } + ], + "name": "Contacts API - Lists" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "contactdb_recipient_count", + "type": "schemas" + }, + { + "_id": "contactdb_recipient", + "type": "schemas" + }, + { + "_id": "contactdb_recipient_response", + "type": "schemas" + }, + { + "_id": "contacts", + "type": "schemas" + }, + { + "_id": "POST_contactdb-recipients", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-status", + "type": "endpoints" + }, + { + "_id": "PATCH_contactdb-recipients", + "type": "endpoints" + }, + { + "_id": "DELETE_contactdb-recipients", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-recipients", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-recipients-recipientid", + "type": "endpoints" + }, + { + "_id": "DELETE_contactdb-recipients-recipientid", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-recipients-recipientid-lists", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-recipients-billablecount", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-recipients-count", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-recipients-search", + "type": "endpoints" + }, + { + "_id": "POST_contactdb-recipients-search", + "type": "endpoints" + } + ], + "name": "Contacts API - Recipients" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "contactdb_custom_field_with_id", + "type": "schemas" + }, + { + "_id": "contactdb_custom_field_with_id_value", + "type": "schemas" + }, + { + "_id": "contactdb_custom_field", + "type": "schemas" + }, + { + "_id": "POST_contactdb-customfields", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-customfields", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-customfields-customfieldid", + "type": "endpoints" + }, + { + "_id": "DELETE_contactdb-customfields-customfieldid", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-reservedfields", + "type": "endpoints" + } + ], + "name": "Contacts API - Custom Fields" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "contactdb_segments", + "type": "schemas" + }, + { + "_id": "contactdb_segments_with_id", + "type": "schemas" + }, + { + "_id": "contactdb_segments_conditions", + "type": "schemas" + }, + { + "_id": "POST_contactdb-segments", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-segments", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-segments-segmentid", + "type": "endpoints" + }, + { + "_id": "PATCH_contactdb-segments-segmentid", + "type": "endpoints" + }, + { + "_id": "DELETE_contactdb-segments-segmentid", + "type": "endpoints" + }, + { + "_id": "GET_contactdb-segments-segmentid-recipients", + "type": "endpoints" + } + ], + "name": "Contacts API - Segments" + }, + { + "description": "Categories can help organize your email analytics by enabling you to “tag” emails by type or broad topic. You can define your own custom categories.\n\nYou can retrieve statistics based on your categories, but note that category statistics are only available for the previous thirteen months.", + "divider": false, + "items": [ + { + "_id": "GET_categories", + "type": "endpoints" + }, + { + "_id": "GET_categories-stats-sums", + "type": "endpoints" + }, + { + "_id": "GET_categories-stats", + "type": "endpoints" + }, + { + "_id": "category_stats", + "type": "schemas" + } + ], + "name": "Categories" + }, + { + "description": "Allows you to create, manage, send, and schedule campaigns.", + "divider": false, + "items": [ + { + "_id": "campaign_request", + "type": "schemas" + }, + { + "_id": "campaign_response", + "type": "schemas" + }, + { + "_id": "POST_campaigns", + "type": "endpoints" + }, + { + "_id": "GET_campaigns", + "type": "endpoints" + }, + { + "_id": "GET_campaigns-campaignid", + "type": "endpoints" + }, + { + "_id": "DELETE_campaigns-campaignid", + "type": "endpoints" + }, + { + "_id": "PATCH_campaigns-campaignid", + "type": "endpoints" + }, + { + "_id": "POST_campaigns-campaignid-schedules-now", + "type": "endpoints" + }, + { + "_id": "POST_campaigns-campaignid-schedules", + "type": "endpoints" + }, + { + "_id": "PATCH_campaigns-campaignid-schedules", + "type": "endpoints" + }, + { + "_id": "GET_campaigns-campaignid-schedules", + "type": "endpoints" + }, + { + "_id": "DELETE_campaigns-campaignid-schedules", + "type": "endpoints" + }, + { + "_id": "POST_campaigns-campaignid-schedules-test", + "type": "endpoints" + } + ], + "name": "Campaigns API" + }, + { + "divider": true, + "items": [], + "name": "Templates" + }, + { + "description": "An HTML template that can establish a consistent design for [transactional emails](https://sendgrid.com/use-cases/transactional-email/).\n\nEach user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.\n\nTransactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns designs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/). For more information about transactional templates, please see our [Dynamic Transactional Templates documentation](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/).", + "divider": false, + "items": [ + { + "_id": "transactional_template", + "type": "schemas" + }, + { + "_id": "transactional-templates-template-lean", + "type": "schemas" + }, + { + "_id": "transactional-template-warning", + "type": "schemas" + }, + { + "_id": "POST_templates", + "type": "endpoints" + }, + { + "_id": "POST_templates-templateid", + "type": "endpoints" + }, + { + "_id": "GET_templates", + "type": "endpoints" + }, + { + "_id": "GET_templates-templateid", + "type": "endpoints" + }, + { + "_id": "PATCH_templates-templateid", + "type": "endpoints" + }, + { + "_id": "DELETE_templates-templateid", + "type": "endpoints" + } + ], + "name": "Transactional Templates" + }, + { + "description": "Represents the code for a particular transactional template. Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates.\n\nFor more information about transactional templates, please see our [Transactional Templates documentation](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). You can also manage your Transactional Templates in the [Dynamic Templates section of the Twilio SendGrid App](https://mc.sendgrid.com/dynamic-templates).", + "divider": false, + "items": [ + { + "_id": "transactional-templates-version-output-lean", + "type": "schemas" + }, + { + "_id": "transactional_template_version_create", + "type": "schemas" + }, + { + "_id": "transactional_template_version_output", + "type": "schemas" + }, + { + "_id": "POST_templates-templateid-versions", + "type": "endpoints" + }, + { + "_id": "POST_templates-templateid-versions-versionid-activate", + "type": "endpoints" + }, + { + "_id": "GET_templates-templateid-versions-versionid", + "type": "endpoints" + }, + { + "_id": "PATCH_templates-templateid-versions-versionid", + "type": "endpoints" + }, + { + "_id": "DELETE_templates-templateid-versions-versionid", + "type": "endpoints" + } + ], + "name": "Transactional Templates Versions" + }, + { + "divider": true, + "items": [], + "name": "Event Tracking" + }, + { + "divider": false, + "items": [ + { + "_id": "webhooks-event-webhook-request", + "type": "schemas" + }, + { + "_id": "event-webhook-response", + "type": "schemas" + }, + { + "_id": "event-webhook-update-oauth-request", + "type": "schemas" + }, + { + "_id": "GET_user-webhooks-event-settings", + "type": "endpoints" + }, + { + "_id": "GET_user-webhooks-parse-settings", + "type": "endpoints" + }, + { + "_id": "GET_user-webhooks-parse-stats", + "type": "endpoints" + }, + { + "_id": "GET_user-webhooks-event-settings-signed", + "type": "endpoints" + }, + { + "_id": "POST_user-webhooks-event-test", + "type": "endpoints" + }, + { + "_id": "PATCH_user-webhooks-event-settings", + "type": "endpoints" + }, + { + "_id": "PATCH_user-webhooks-event-settings-signed", + "type": "endpoints" + } + ], + "name": "Webhooks" + }, + { + "description": "**You must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API.**\n\nThe Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages.\n\nOnce retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them.\n\nSee \"[Getting Started with the Email Activity Feed API](https://sendgrid.com/docs/for-developers/sending-email/getting-started-email-activity-api/)\" for help building queries and working with the API.\n\nYou can also work with email activity in the **Activity** section of the [Twilio SendGrid App](https://app.sendgrid.com/email_activity).", + "divider": false, + "items": [ + { + "_id": "GET-messages", + "type": "endpoints" + }, + { + "_id": "GET-v3-messages-msg_id", + "type": "endpoints" + }, + { + "_id": "POST_v3-messages-download", + "type": "endpoints" + }, + { + "_id": "GET_v3-messages-download-download_uuid", + "type": "endpoints" + }, + { + "_id": "email-activity-response-common-fields", + "type": "schemas" + } + ], + "name": "Email Activity" + }, + { + "description": "You can track many of your recipients' interactions with your emails, including:\n\n- Opening emails\n- Clicking links\n- Subscribing to (or unsubscribing from) your emails\n\nFor more information about tracking, please see our [Tracking Settings documentation](https://sendgrid.com/docs/ui/account-and-settings/tracking/).", + "divider": false, + "items": [ + { + "_id": "subscription_tracking_settings", + "type": "schemas" + }, + { + "_id": "click-tracking", + "type": "schemas" + }, + { + "_id": "google_analytics_settings", + "type": "schemas" + }, + { + "_id": "GET_trackingsettings", + "type": "endpoints" + }, + { + "_id": "GET_trackingsettings-click", + "type": "endpoints" + }, + { + "_id": "PATCH_trackingsettings-click", + "type": "endpoints" + }, + { + "_id": "GET_trackingsettings-googleanalytics", + "type": "endpoints" + }, + { + "_id": "PATCH_trackingsettings-googleanalytics", + "type": "endpoints" + }, + { + "_id": "GET_trackingsettings-open", + "type": "endpoints" + }, + { + "_id": "PATCH_trackingsettings-open", + "type": "endpoints" + }, + { + "_id": "GET_trackingsettings-subscription", + "type": "endpoints" + }, + { + "_id": "PATCH_trackingsettings-subscription", + "type": "endpoints" + } + ], + "name": "Settings - Tracking" + }, + { + "description": "Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from basics of clicks and opens to looking at which browsers and mailbox providers your customers use.\n\nWe have broken up statistics in specific ways so that you can get at-a-glance data, as well as allowing you to get into the details of how your email is being used.\n\n> Category statistics are available for the previous thirteen months only.", + "divider": false, + "items": [ + { + "_id": "Ag8mEYHMm5BNuLh4B", + "type": "schemas" + }, + { + "_id": "statsAdvancedStatsBaseQueryStrings", + "type": "traits" + }, + { + "_id": "statsAdvancedQueryStringsLimitOffset", + "type": "traits" + }, + { + "_id": "advanced_stats_mailbox_provider", + "type": "schemas" + }, + { + "_id": "stats-advanced-global-stats", + "type": "schemas" + }, + { + "_id": "GET_stats", + "type": "endpoints" + }, + { + "_id": "GET_geo-stats", + "type": "endpoints" + }, + { + "_id": "GET_devices-stats", + "type": "endpoints" + }, + { + "_id": "GET_clients-stats", + "type": "endpoints" + }, + { + "_id": "GET_clients-clienttype-stats", + "type": "endpoints" + }, + { + "_id": "GET_mailboxproviders-stats", + "type": "endpoints" + }, + { + "_id": "GET_browsers-stats", + "type": "endpoints" + }, + { + "_id": "stats-advanced-stats-base-schema", + "type": "schemas" + }, + { + "_id": "advanced_stats_clicks", + "type": "schemas" + }, + { + "_id": "advanced_stats_opens", + "type": "schemas" + }, + { + "_id": "advanced_stats_clicks_opens", + "type": "schemas" + } + ], + "name": "Stats" + }, + { + "divider": true, + "items": [], + "name": "Suppression Management" + }, + { + "description": "An email is considered [bounced](https://sendgrid.com/docs/glossary/bounces/) when the message is undeliverable and then returned to the server that sent it. Bounced emails can be either permanent or temporary failures to deliver the message.\n\nFor more information, see our [Bounces documentation](https://sendgrid.com/docs/ui/sending-email/bounces/).\n\nYou can also manage bounced emails from the [Suppression settings menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces).", + "divider": false, + "items": [ + { + "_id": "GET_suppression-bounces", + "type": "endpoints" + }, + { + "_id": "GET_suppression-bounces-email", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-bounces", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-bounces-email", + "type": "endpoints" + }, + { + "_id": "bounce_response", + "type": "schemas" + } + ], + "name": "Bounces API" + }, + { + "description": "[Blocks](https://sendgrid.com/docs/glossary/blocks/) happen when your email is rejected because of an issue with the message itself rather than an issue with the recipient's address.\n\nThere are several causes for blocked emails. For example, your mail server IP address may be blocked by an ISP, or the receiving server may flag the message content using a filter. Twilio SendGrid will not suppress future messages to blocked addresses by default. \n\nFor more information, please see our [Blocks documentation](https://sendgrid.com/docs/ui/sending-email/blocks/).\n\nYou can also see your Blocks in the [Suppressions settings menu of the Twilio SendGrid App](https://app.sendgrid.com/suppressions/blocks).", + "divider": false, + "items": [ + { + "_id": "GET_suppression-blocks", + "type": "endpoints" + }, + { + "_id": "GET_suppression-blocks-email", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-blocks", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-blocks-email", + "type": "endpoints" + }, + { + "_id": "blocks-response", + "type": "schemas" + } + ], + "name": "Blocks API" + }, + { + "description": "Spam Reports are triggered when a recipient marks one of your emails as spam. Spam reports can only be gathered from Internet Service Providers (ISPs) that provide a feedback loop.\n\nIt is important that addresses that have marked your messages as spam be permanently removed from your send list, even if the recipients have previously opted into receiving your messages. Continuing to send to customers who have reported your email as spam can severely affect your deliverability rating.\n\nYou can also access your Spam Reports from the [Suppressions settings menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/spam_reports).\n\nFor more information, please see our [Spam Reports documentation](https://sendgrid.com/docs/ui/analytics-and-reporting/spam-reports/).", + "divider": false, + "items": [ + { + "_id": "GET_suppression-spamreports", + "type": "endpoints" + }, + { + "_id": "GET_suppression-spamreports-email", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-spamreports", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-spamreports-email", + "type": "endpoints" + }, + { + "_id": "spam-reports-response", + "type": "schemas" + } + ], + "name": "Spam Reports API" + }, + { + "description": "A global suppression (or global unsubscribe) is an email address of a recipient who does not want to receive any of your messages. A globally suppressed recipient will be removed from any email you send. For more information, please see our [Global Unsubscribes documentation](https://sendgrid.com/docs/ui/sending-email/global-unsubscribes/).", + "divider": false, + "items": [ + { + "_id": "POST_asm-suppressions-global", + "type": "endpoints" + }, + { + "_id": "GET_suppression-unsubscribes", + "type": "endpoints" + }, + { + "_id": "GET_asm-suppressions-global-email", + "type": "endpoints" + }, + { + "_id": "DELETE_asm-suppressions-global-email", + "type": "endpoints" + }, + { + "_id": "suppressions-request", + "type": "schemas" + } + ], + "name": "Suppressions - Global Suppressions" + }, + { + "description": "Suppression groups, or unsubscribe groups, are specific types or categories of emails from which you would like your recipients to be able to unsubscribe. For example: Daily Newsletters, Invoices, and System Alerts are all potential suppression groups. Visit the main documentation to [learn more about suppression/unsubscribe groups](https://sendgrid.com/docs/ui/sending-email/unsubscribe-groups/)\n\nThe **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.\n\nEach Twilio SendGrid account can create up to 25 different suppression groups.", + "divider": false, + "items": [ + { + "_id": "POST_asm-groups", + "type": "endpoints" + }, + { + "_id": "GET_asm-groups", + "type": "endpoints" + }, + { + "_id": "GET_asm-groups-groupid", + "type": "endpoints" + }, + { + "_id": "PATCH_asm-groups-groupid", + "type": "endpoints" + }, + { + "_id": "DELETE_asm-groups-groupid", + "type": "endpoints" + }, + { + "_id": "suppression-group-request-base", + "type": "schemas" + }, + { + "_id": "suppression_group", + "type": "schemas" + } + ], + "name": "Suppressions - Unsubscribe Groups" + }, + { + "description": "Suppressions are recipient email addresses that are added to [unsubscribe groups](https://sendgrid.com/docs/ui/sending-email/unsubscribe-groups/). Once a recipient's address is on the suppressions list for an unsubscribe group, they will not receive any emails that are tagged with that unsubscribe group.", + "divider": false, + "items": [ + { + "_id": "POST_asm-groups-groupid-suppressions", + "type": "endpoints" + }, + { + "_id": "POST_asm-groups-groupid-suppressions-search", + "type": "endpoints" + }, + { + "_id": "GET_asm-groups-groupid-suppressions", + "type": "endpoints" + }, + { + "_id": "GET_asm-suppressions", + "type": "endpoints" + }, + { + "_id": "GET_asm-suppressions-email", + "type": "endpoints" + }, + { + "_id": "DELETE_asm-groups-groupid-suppressions-email", + "type": "endpoints" + } + ], + "name": "Suppressions - Suppressions" + }, + { + "description": "\nAn invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipient’s mail server.\n\nExamples include addresses without the “@” sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.\n\nFor more information, please see our [Invalid Email documentation](https://sendgrid.com/docs/ui/sending-email/invalid-emails/).", + "divider": false, + "items": [ + { + "_id": "GET_suppression-invalidemails", + "type": "endpoints" + }, + { + "_id": "GET_suppression-invalidemails-email", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-invalidemails", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-invalidemails-email", + "type": "endpoints" + }, + { + "_id": "invalid-email", + "type": "schemas" + } + ], + "name": "Invalid Emails API" + }, + { + "divider": true, + "items": [], + "name": "Inbound Parse" + }, + { + "description": "Twilio SendGrid’s Inbound Parse Webhook allows you to receive emails as multipart/form-data at a URL of your choosing. SendGrid will grab the content, attachments, and the headers from any email it receives for your specified hostname.\n\nSee \"[Setting up the Inbound Parse Webhook](https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/)\" for help configuring the Webhook. You can also manage the Inbound Parse Webhook in the [Twilio SendGrid App](https://app.sendgrid.com/settings/parse).\n\nTo begin processing email using SendGrid's Inbound Parse Webhook, you will have to setup MX Records, choose the hostname (or receiving domain) that will be receiving the emails you want to parse, and define the URL where you want to POST your parsed emails. If you do not have access to your domain's DNS records, you must work with someone in your organization who does.", + "divider": false, + "items": [ + { + "_id": "parse-setting", + "type": "schemas" + }, + { + "_id": "POST_user-webhooks-parse-settings", + "type": "endpoints" + }, + { + "_id": "GET_user-webhooks-parse-settings", + "type": "endpoints" + }, + { + "_id": "GET_user-webhooks-parse-settings-hostname", + "type": "endpoints" + }, + { + "_id": "PATCH_user-webhooks-parse-settings-hostname", + "type": "endpoints" + }, + { + "_id": "DELETE_user-webhooks-parse-settings-hostname", + "type": "endpoints" + } + ], + "name": "Settings - Inbound Parse" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "global_error_response_schema", + "type": "schemas" + }, + { + "_id": "global:id", + "type": "schemas" + }, + { + "_id": "global:empty_request", + "type": "schemas" + }, + { + "_id": "selfmetadata", + "type": "schemas" + }, + { + "_id": "error", + "type": "schemas" + }, + { + "_id": "link", + "type": "schemas" + }, + { + "_id": "metadata", + "type": "schemas" + }, + { + "_id": "webhook", + "type": "schemas" + } + ], + "name": "Global: Models" + }, + { + "description": "Elements that can be shared among more than one endpoint definition.", + "divider": false, + "items": [ + { + "_id": "onBehalfOfSubuser", + "type": "traits" + }, + { + "_id": "globalErrors", + "type": "traits" + }, + { + "_id": "makoErrorResponse", + "type": "traits" + } + ], + "name": "Global: Traits" + }, + { + "divider": false, + "items": [ + { + "_id": "credentials", + "type": "schemas" + } + ], + "name": "Credentials" + } + ] + } + } + }, + "x-tests": { + "2QtdGPeZcwPm7CTTh": { + "id": "2QtdGPeZcwPm7CTTh", + "initialVariables": {}, + "name": "Alerts test", + "steps": [ + { + "assertions": [ + { + "expected": 201, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 201, + "op": "validate.pass" + } + ], + "capture": { + "body": [ + { + "name": "alert_id", + "value": "id" + } + ] + }, + "id": "LrnrTjuMQ2kCb9xZG", + "name": "Create a new Alert", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "post", + "pathParams": [], + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\n \"type\": \"stats_notification\",\n \"email_to\": \"example@example.com\",\n \"frequency\": \"daily\"\n}" + }, + "queryString": [], + "transformed": false, + "url": "/alerts", + "valid": 2 + } + }, + { + "assertions": [ + { + "expected": 200, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 200, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "aRd37ou83TsrHxkMc", + "name": "Retrieve a specific alert", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "get", + "pathParams": [], + "postData": {}, + "queryString": [], + "transformed": false, + "url": "/alerts/{alert_id}", + "valid": 2 + } + }, + { + "assertions": [ + { + "expected": 200, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 200, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "nqDiBRakuZA8nD6s7", + "name": "Update an alert", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "patch", + "pathParams": [], + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\n \"email_to\": \"matt@example.com\"\n}" + }, + "queryString": [], + "transformed": false, + "url": "/alerts/{alert_id}", + "valid": 2 + } + }, + { + "assertions": [ + { + "expected": 204, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 204, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "MvuQwBuikXtWbsCBt", + "name": "Delete an alert", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "delete", + "pathParams": [], + "postData": {}, + "queryString": [], + "transformed": false, + "url": "/alerts/{alert_id}", + "valid": 2 + } + }, + { + "assertions": [ + { + "expected": 400, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 400, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "kuh6nzo9sAfXJeSzz", + "name": "Create an alert", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "post", + "pathParams": [], + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\n \"type\": \"stats_notification\",\n \"email_to\": \"example@example.com\",\n \"frequency\": \"daily\"\n}" + }, + "queryString": [], + "transformed": false, + "url": "/alerts", + "valid": 2 + } + } + ] + }, + "HFGvnuoqkd36FarWE": { + "id": "HFGvnuoqkd36FarWE", + "initialVariables": {}, + "name": "Parse Settings Test", + "steps": [ + { + "assertions": [ + { + "expected": 201, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 201, + "op": "validate.pass" + } + ], + "capture": { + "body": [ + { + "name": "hostname", + "value": "hostname" + } + ] + }, + "id": "DXFjNLuibt8mBTMDE", + "name": "Create a parse setting", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "post", + "pathParams": [], + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\n \"hostname\": \"example.com\",\n \"url\": \"http://email.example.com\",\n \"spam_check\": true,\n \"send_raw\": false\n}" + }, + "queryString": [], + "transformed": false, + "url": "/user/webhooks/parse/settings", + "valid": 2 + } + }, + { + "assertions": [ + { + "expected": 200, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 200, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "6DoSn3KYqs3LqNzo4", + "name": "Retrieve all parse settings", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "get", + "pathParams": [], + "postData": {}, + "queryString": [], + "transformed": false, + "url": "/user/webhooks/parse/settings", + "valid": 2 + } + }, + { + "assertions": [ + { + "expected": 200, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 200, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "sXYsGopzxCdmtFBpf", + "name": "Retrieve a specific parse setting", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "get", + "pathParams": [], + "postData": {}, + "queryString": [], + "transformed": false, + "url": "/user/webhooks/parse/settings/{hostname}", + "valid": 2 + } + }, + { + "assertions": [ + { + "expected": 200, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 200, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "AL2R3B5fyfMcLKvFg", + "name": "Update a parse setting", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "patch", + "pathParams": [], + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\n \"url\": \"http://newdomain.com/parse\",\n \"spam_check\": false,\n \"send_raw\": true\n}" + }, + "queryString": [], + "transformed": false, + "url": "/user/webhooks/parse/settings/{hostname}/", + "valid": 2 + } + }, + { + "afterScript": "function (ctx, request, response) {\n // Your javascript code here.\n // Code completion enabled.\n // You have access to a global \"SL\" object.\n // \"url\": \"http://newdomain.com/parse\",\n // \"spam_check\": false,\n // \"send_raw\": true\n var body = response.body.get();\n assert.equal(body.url, \"http://newdomain.com/parse\");\n assert.equal(body.spam_check, false);\n assert.equal(body.send_raw, true);\n}", + "assertions": [ + { + "expected": 200, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 200, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "7ewLowiXP3fFti63Z", + "name": "Verify updating a parse setting", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "get", + "pathParams": [], + "postData": {}, + "queryString": [], + "transformed": false, + "url": "/user/webhooks/parse/settings/{hostname}", + "valid": 2 + } + }, + { + "assertions": [ + { + "expected": 204, + "location": "response.code", + "op": "eq" + }, + { + "location": "response.body", + "match": 204, + "op": "validate.pass" + } + ], + "capture": {}, + "id": "738KySxu4mWHjDvmw", + "name": "Delete a parse setting", + "request": { + "authentication": {}, + "bodySize": -1, + "cookies": [], + "headers": [ + { + "name": "Authorization", + "value": "Bearer SG.xxxxxxxx.yyyyyyyy" + } + ], + "headersSize": -1, + "method": "delete", + "pathParams": [], + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{}" + }, + "queryString": [], + "transformed": false, + "url": "/user/webhooks/parse/settings/{hostname}", + "valid": 2 + } + } + ] + } + } +}