From 5f511699bfb41812c0fa0aa0a002a420de760feb Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Fri, 3 Jun 2016 20:25:09 -0700 Subject: [PATCH] Adding OAI with stoplight extensions --- oai_stoplight.json | 26660 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 26660 insertions(+) create mode 100644 oai_stoplight.json diff --git a/oai_stoplight.json b/oai_stoplight.json new file mode 100644 index 0000000..5131fc2 --- /dev/null +++ b/oai_stoplight.json @@ -0,0 +1,26660 @@ +{ + "basePath": "/v3", + "consumes": [ + "application/json" + ], + "definitions": { + "advanced_stats_clicks": { + "properties": { + "date": { + "description": "The date that the events occurred.", + "type": "string" + }, + "stats": { + "description": "The statistics of the email events.", + "items": { + "properties": { + "metrics": { + "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" + } + }, + "required": [ + "clicks", + "unique_clicks" + ], + "type": "object" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "required": [ + "type", + "name", + "metrics" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "date", + "stats" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "advanced_stats_clicks", + "name": "Stats: Advanced Stats with Clicks", + "public": true, + "summary": "" + } + }, + "advanced_stats_country": { + "properties": { + "date": { + "description": "The date that the events occurred.", + "type": "string" + }, + "stats": { + "description": "The statistics of the email events.", + "items": { + "properties": { + "metrics": { + "description": "The individual events and their stats.", + "properties": { + "clicks": { + "description": "The number of links that were clicked in your emails.", + "type": "integer" + }, + "opens": { + "description": "The total number of times your emails were opened by recipients.", + "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" + } + }, + "required": [ + "clicks", + "opens", + "unique_clicks", + "unique_opens" + ], + "type": "object" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "required": [ + "type", + "name", + "metrics" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "date", + "stats" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "advanced_stats_country", + "name": "Stats: Advanced Stats with Clicks and Opens", + "public": true, + "summary": "" + } + }, + "advanced_stats_mailbox_provider": { + "properties": { + "date": { + "description": "The date that the events occurred.", + "type": "string" + }, + "stats": { + "description": "The statistics of the email events.", + "items": { + "properties": { + "metrics": { + "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" + }, + "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" + }, + "drops": { + "description": "The number of emails that were not delivered due to the recipient email address being on a suppression list.", + "type": "integer" + }, + "opens": { + "description": "The total number of times your emails were opened by recipients.", + "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" + } + }, + "required": [ + "clicks", + "opens", + "unique_clicks", + "unique_opens", + "blocks", + "bounces", + "deferred", + "delivered", + "drops", + "spam_reports" + ], + "type": "object" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "required": [ + "type", + "name", + "metrics" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "date", + "stats" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "advanced_stats_mailbox_provider", + "name": "Stats: Advanced Stats for Mailbox Provider", + "public": true, + "summary": "" + } + }, + "advanced_stats_opens": { + "properties": { + "date": { + "description": "The date that the events occurred.", + "type": "string" + }, + "stats": { + "description": "The statistics of the email events.", + "items": { + "properties": { + "metrics": { + "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" + } + }, + "required": [ + "opens", + "unique_opens" + ], + "type": "object" + }, + "name": { + "description": "The name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "required": [ + "type", + "name", + "metrics" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "date", + "stats" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "advanced_stats_opens", + "name": "Stats: Advanced Stats with Opens", + "public": true, + "summary": "" + } + }, + "api_key_name_id": { + "example": { + "api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA", + "name": "A New Hope" + }, + "properties": { + "api_key_id": { + "description": "The ID of your API Key. ", + "type": "string" + }, + "name": { + "description": "The name of your API Key.", + "type": "string" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "api_key_name_id", + "name": "API Key Name and ID", + "public": true, + "summary": "" + } + }, + "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": "#/definitions/api_key_name_id" + } + ], + "example": { + "api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA", + "name": "A New Hope", + "scopes": [ + "user.profile.read", + "user.profile.update" + ] + }, + "x-stoplight": { + "description": "", + "id": "api_key_name_id_scopes", + "name": "API Key Name, ID, and Scopes", + "public": true, + "summary": "" + } + }, + "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" + }, + "type": [ + "array", + "null" + ] + }, + "custom_unsubscribe_url": { + "description": "This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups.", + "type": [ + "string", + "null" + ] + }, + "html_content": { + "description": "The HTML of your marketing email.", + "type": [ + "string", + "null" + ] + }, + "ip_pool": { + "description": "The pool of IPs that you would like to send this email from.", + "type": [ + "string", + "null" + ] + }, + "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" + }, + "type": [ + "array", + "null" + ] + }, + "plain_content": { + "description": "The plain text content of your emails.", + "type": [ + "string", + "null" + ] + }, + "segment_ids": { + "description": "The segment IDs that you are sending this list to. You can have both segment IDs and list IDs.", + "items": { + "type": "integer" + }, + "type": [ + "array", + "null" + ] + }, + "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.", + "type": [ + "null", + "integer" + ] + }, + "subject": { + "description": "The subject of your campaign that your recipients will see.", + "type": [ + "string", + "null" + ] + }, + "suppression_group_id": { + "description": "The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type.", + "type": [ + "null", + "integer" + ] + }, + "title": { + "description": "The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI.", + "type": "string" + } + }, + "required": [ + "title" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "campaign_request", + "name": "Campaigns Request", + "public": true, + "summary": "" + } + }, + "campaign_response": { + "allOf": [ + { + "$ref": "#/definitions/campaign_request" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "status": { + "description": "The status of your campaign.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + ], + "x-stoplight": { + "description": "", + "id": "campaign_response", + "name": "Campaigns Response", + "public": true, + "summary": "" + } + }, + "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" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "category_stats", + "name": "Stats: Category Stats", + "public": true, + "summary": "" + } + }, + "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": { + "description": "", + "id": "contactdb_custom_field", + "name": "ContactDB: Custom Field", + "public": true, + "summary": "" + } + }, + "contactdb_custom_field_with_id": { + "allOf": [ + { + "$ref": "#/definitions/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": { + "description": "", + "id": "contactdb_custom_field_with_id", + "name": "ContactDB: Custom Field with ID", + "public": true, + "summary": "" + } + }, + "contactdb_custom_field_with_id_value": { + "allOf": [ + { + "$ref": "#/definitions/contactdb_custom_field_with_id" + }, + { + "properties": { + "value": { + "description": "The value of this recipient's custom field", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + } + ], + "title": "ContactDB Custom field schema.", + "x-stoplight": { + "description": "", + "id": "contactdb_custom_field_with_id_value", + "name": "ContactDB: Custom Field with ID & Value", + "public": true, + "summary": "" + } + }, + "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.", + "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": { + "description": "", + "id": "contactdb_list", + "name": "ContactDB: List", + "public": true, + "summary": "" + } + }, + "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": "#/definitions/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.", + "type": [ + "string", + "null" + ] + }, + "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.", + "type": [ + "number", + "null" + ] + }, + "last_emailed": { + "description": "The last time this user was emailed by one of your campaigns, in unixtime.", + "type": [ + "number", + "null" + ] + }, + "last_name": { + "description": "The last name of the recipient.", + "type": [ + "string", + "null" + ] + }, + "last_opened": { + "description": "The last time this recipient opened an email from you, in unixtime.", + "type": [ + "number", + "null" + ] + }, + "updated_at": { + "description": "The last update date for this recipient's record.", + "type": "number" + } + }, + "required": [ + "email" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "contactdb_recipient", + "name": "ContactDB: Recipient", + "public": true, + "summary": "" + } + }, + "contactdb_recipient_count": { + "example": { + "recipient_count": 1234 + }, + "properties": { + "recipient_count": { + "description": "The count of recipients.", + "type": "number" + } + }, + "required": [ + "recipient_count" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "contactdb_recipient_count", + "name": "ContactDB: Recipient Count", + "public": true, + "summary": "" + } + }, + "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" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "contactdb_recipient_response", + "name": "ContactDB: Recipient response", + "public": true, + "summary": "" + } + }, + "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": "#/definitions/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": { + "description": "", + "id": "contactdb_segments", + "name": "ContactDB: Segments", + "public": true, + "summary": "" + } + }, + "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" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "contactdb_segments_conditions", + "name": "ContactDB: Segments: Conditions", + "public": true, + "summary": "" + } + }, + "contactdb_segments_with_id": { + "allOf": [ + { + "properties": { + "id": { + "description": "The ID of the segment.", + "type": "number" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + { + "$ref": "#/definitions/contactdb_segments" + } + ], + "x-stoplight": { + "description": "", + "id": "contactdb_segments_with_id", + "name": "ContactDB:: Segments with ID", + "public": true, + "summary": "" + } + }, + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "contacts", + "name": "Contacts", + "public": true, + "summary": "" + } + }, + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "credentials", + "name": "Credentials", + "public": true, + "summary": "" + } + }, + "email_object": { + "properties": { + "email": { + "format": "email", + "type": "string" + }, + "name": { + "description": "The name of the person to whom you are sending an email.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "email_object", + "name": "Email Object", + "public": true, + "summary": "" + } + }, + "errors": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "description": "The field that has the error.", + "type": [ + "null", + "string" + ] + }, + "message": { + "description": "The message the API caller will receive.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "errors", + "name": "Error Schema", + "public": true, + "summary": "" + } + }, + "event_webhook_settings": { + "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" + }, + "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" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "event_webhook_settings", + "name": "Webhooks: Event Webhook Settings", + "public": true, + "summary": "" + } + }, + "global:ErrorResponse": { + "example": { + "errors": [ + { + "field": "field_name", + "message": "Some message here" + } + ] + }, + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "description": "The field that generated the error.", + "type": [ + "string", + "null" + ] + }, + "message": { + "description": "The error message.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "global:ErrorResponse", + "name": "Global: Error Response", + "public": true, + "summary": "" + } + }, + "global:empty_request": { + "type": "null", + "x-stoplight": { + "description": "", + "id": "global:empty_request", + "name": "Global: Request Empty Body", + "public": true, + "summary": "" + } + }, + "global:id": { + "type": "integer", + "x-stoplight": { + "description": "", + "id": "global:id", + "name": "Global: ID", + "public": true, + "summary": "" + } + }, + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "google_analytics_settings", + "name": "Settings: Google Analytics", + "public": true, + "summary": "" + } + }, + "ip_pool": { + "properties": { + "name": { + "description": "The name of the IP pool.", + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "ip_pool", + "name": "IP Pools: Pool", + "public": true, + "summary": "" + } + }, + "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 was entered into warmup mode.", + "type": "integer" + } + }, + "required": [ + "ip", + "start_date" + ], + "type": "object" + }, + "type": "array", + "x-stoplight": { + "description": "", + "id": "ip_warmup_response", + "name": "IP Warmup: IP", + "public": true, + "summary": "" + } + }, + "ip_whitelabel": { + "example": { + "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 + }, + "properties": { + "a_record": { + "properties": { + "data": { + "description": "The IP address being whitelabeled.", + "type": "string" + }, + "host": { + "description": "This is the web address that will be mapped to the IP address.", + "type": "string" + }, + "type": { + "description": "The type of DNS record.", + "type": "string" + }, + "valid": { + "description": "Indicates if the a_record is valid.", + "type": "boolean" + } + }, + "required": [ + "valid", + "type", + "host", + "data" + ], + "type": "object" + }, + "domain": { + "description": "The root, or sending, domain.", + "type": "string" + }, + "id": { + "description": "The id of the IP whitelabel.", + "type": "integer" + }, + "ip": { + "description": "The IP address that this whitelabel was created for.", + "type": "string" + }, + "legacy": { + "description": "Indicates if this whitelabel was created using the legacy whitelabel tool.", + "type": "boolean" + }, + "rdns": { + "description": "The reverse DNS record for the IP address. This points to the IP whitelabel subdomain.", + "type": "string" + }, + "subdomain": { + "description": "The subdomain created for this IP whitelabel. This is where the rDNS record points.", + "type": "string" + }, + "users": { + "description": "The users who are able to send mail from the IP.", + "items": { + "properties": { + "user_id": { + "description": "The ID of the user who can send mail from this IP.", + "type": "integer" + }, + "username": { + "description": "The username of the user who can send mail from this IP.", + "type": "string" + } + }, + "required": [ + "username", + "user_id" + ], + "type": "object" + }, + "type": "array" + }, + "valid": { + "description": "Indicates if this is a valid whitelabel.", + "type": "boolean" + } + }, + "required": [ + "id", + "ip", + "rdns", + "users", + "subdomain", + "domain", + "valid", + "legacy", + "a_record" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "ip_whitelabel", + "name": "Whitelabel - IPs", + "public": true, + "summary": "" + } + }, + "link_whitelabel": { + "properties": { + "default": { + "description": "Indicates if this is the default link whitelabel.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "dns": { + "description": "The DNS records generated for this link whitelabel.", + "properties": { + "domain_cname": { + "description": "The DNS record generated to point to your link whitelabel subdomain.", + "properties": { + "data": { + "description": "The domain that the DNS record points to.", + "type": "string" + }, + "host": { + "description": "The domain that this whitelabel will use when whitelabeling the links in your email.", + "type": "string" + }, + "type": { + "description": "The type of DNS record that was generate.", + "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 whitelabel.", + "properties": { + "data": { + "description": "The domain that the DNS record points to.", + "type": "string" + }, + "host": { + "description": "Used to verify the link whitelabel. The subdomain of this domain is the user id of the user who created the link whitelabel.", + "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 for this link whitelabel.", + "type": "string" + }, + "id": { + "description": "The id of the link whitelabel.", + "type": "integer" + }, + "legacy": { + "description": "Indicates if this link whitelabel was created using the legacy whitelabel tool.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "subdomain": { + "description": "The subdomain used to generate the DNS records for this link whitelabel. This subdomain must be different from the subdomain used for your domain whitelabel.", + "type": "string" + }, + "user_id": { + "description": "The id of the user that this whitelabel is associated with.", + "type": "integer" + }, + "username": { + "description": "The username of the account that this link whitelabel is associated with.", + "type": "string" + }, + "valid": { + "description": "Indicates if this link whitelabel is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "required": [ + "id", + "domain", + "subdomain", + "username", + "user_id", + "default", + "valid", + "legacy", + "dns" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "link_whitelabel", + "name": "Whitelabel - Links", + "public": true, + "summary": "" + } + }, + "mail_batch_id": { + "example": { + "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi" + }, + "properties": { + "batch_id": { + "pattern": "^[a-zA-Z0-9\\-\\_]", + "type": "string" + } + }, + "required": [ + "batch_id" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_batch_id", + "name": "Mail: Batch ID", + "public": true, + "summary": "" + } + }, + "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 address that are currently on the whitelist.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_address_whitelabel", + "name": "Mail Settings: Address Whitelabel", + "public": true, + "summary": "" + } + }, + "mail_settings_bcc": { + "example": { + "email": "example@example.com", + "enabled": false + }, + "properties": { + "email": { + "description": "The email address that will be sent a blind carbon copy.", + "type": "string" + }, + "enabled": { + "description": "Indicates if the BCC setting is enabled.", + "type": "boolean" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_bcc", + "name": "Mail Settings: BCC", + "public": true, + "summary": "" + } + }, + "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.", + "type": [ + "integer", + "null" + ] + }, + "soft_bounces": { + "description": "The number of days, after which SendGrid will purge all contacts from your soft bounces suppression lists.", + "type": [ + "integer", + "null" + ] + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_bounce_purge", + "name": "Mail Settings: Bounce Purge", + "public": true, + "summary": "" + } + }, + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_footer", + "name": "Mail Settings: Footer", + "public": true, + "summary": "" + } + }, + "mail_settings_forward_bounce": { + "example": { + "email": null, + "enabled": false + }, + "properties": { + "email": { + "description": "The email address that you would like your bounce reports forwarded to.", + "type": [ + "string", + "null" + ] + }, + "enabled": { + "description": "Indicates if the bounce forwarding mail setting is enabled.", + "type": "boolean" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_forward_bounce", + "name": "Mail Settings: Forward Bounce", + "public": true, + "summary": "" + } + }, + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_forward_spam", + "name": "Mail Settings: Forward Spam", + "public": true, + "summary": "" + } + }, + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_patch", + "name": "Mail Settings: Patch", + "public": true, + "summary": "" + } + }, + "mail_settings_spam_check": { + "example": { + "enabled": false, + "max_score": 6, + "url": "http://example.com" + }, + "properties": { + "enabled": { + "description": "Indicates if your Spam Checker mail setting is enabled.", + "type": "boolean" + }, + "max_score": { + "default": 5, + "description": "The spam threshold. Can range from 1 to 10. The lower the number, the more strict the filtering.", + "maximum": 10, + "minimum": 1, + "type": "integer" + }, + "url": { + "description": "The inbound parse URL where you would like the spam messages to be sent to.", + "type": "string" + } + }, + "required": [ + "enabled" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_spam_check", + "name": "Mail Settings: Spam Check", + "public": true, + "summary": "" + } + }, + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "mail_settings_template", + "name": "Mail Settings: Template", + "public": true, + "summary": "" + } + }, + "monitor": { + "example": { + "email": "example@example.com", + "frequency": 50000 + }, + "properties": { + "email": { + "description": "The email address to send emails at the frequency specified for monitoring.", + "format": "email", + "type": "string" + }, + "frequency": { + "description": "The frequency by which to send the emails. An email will be sent, every time your subuser sends this {frequency} emails. ", + "type": "number" + } + }, + "required": [ + "email", + "frequency" + ], + "title": "Create monitor settings request", + "type": "object", + "x-stoplight": { + "description": "", + "id": "monitor", + "name": "Monitor Settings", + "public": true, + "summary": "" + } + }, + "partner_settings_new_relic": { + "properties": { + "enable_subuser_statistics": { + "description": "Indicates if your subuser statistics will be sent to your New Relic Dashboard.", + "type": "boolean" + }, + "enabled": { + "description": "Indicates if this setting is enabled. ", + "type": "boolean" + }, + "license_key": { + "description": "The license key provided with your New Relic account.", + "type": "string" + } + }, + "required": [ + "enabled", + "license_key" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "partner_settings_new_relic", + "name": "Partner Settings: New Relic", + "public": true, + "summary": "" + } + }, + "stats": { + "items": { + "properties": { + "date": { + "description": "The date that the statistics were gathered.", + "type": "string" + }, + "stats": { + "description": "The list of statistics.", + "items": { + "properties": { + "metrics": { + "description": "The individual events and their statistics.", + "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 name of the specific segmentation.", + "type": "string" + }, + "type": { + "description": "The type of segmentation.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "type": "array", + "x-stoplight": { + "description": "", + "id": "stats", + "name": "Stats", + "public": true, + "summary": "" + } + }, + "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\u2019s server.", + "type": "string" + }, + "plain_content": { + "description": "The information in plain text for your unsubscribe link. You should have the \u201c<% %>\u201d 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.", + "type": "string" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "subscription_tracking_settings", + "name": "Settings: Subscription Tracking", + "public": true, + "summary": "" + } + }, + "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": { + "description": "", + "id": "subuser", + "name": "Subuser", + "public": true, + "summary": "" + } + }, + "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" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "subuser_post", + "name": "Subuser::POST", + "public": true, + "summary": "" + } + }, + "subuser_stats": { + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "subuser_stats", + "name": "subuser_stats", + "public": true, + "summary": "" + } + }, + "suppression_bounce": { + "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": { + "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" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "suppression_bounce", + "name": "Suppression: Bounce", + "public": true, + "summary": "" + } + }, + "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": { + "type": "null" + }, + "name": { + "description": "The name of the suppression group. Each group created by a user must have a unique name.", + "maxLength": 30, + "type": "string" + } + }, + "required": [ + "id", + "name", + "description" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "suppression_group", + "name": "Suppressions: Suppression Group", + "public": true, + "summary": "" + } + }, + "suppression_group_unsubscribes": { + "allOf": [ + { + "$ref": "#/definitions/suppression_group" + }, + { + "properties": { + "unsubscribes": { + "description": "The unsubscribes associated with this group.", + "type": "integer" + } + }, + "required": [ + "unsubscribes" + ] + } + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "suppression_group_unsubscribes", + "name": "Suppressions: Suppression Group with Unsubscribes", + "public": true, + "summary": "" + } + }, + "transactional_template": { + "properties": { + "id": { + "description": "The ID of the transactional template.", + "type": "string" + }, + "name": { + "description": "The name for the transactional template.", + "maxLength": 100, + "type": "string" + }, + "versions": { + "description": "The different versions of this transactional template.", + "items": { + "$ref": "#/definitions/transactional_template_version" + }, + "type": "array" + } + }, + "required": [ + "id", + "name" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "transactional_template", + "name": "Transactional Templates: Template", + "public": true, + "summary": "" + } + }, + "transactional_template_version": { + "properties": { + "active": { + "description": "Set the new 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" + }, + "html_content": { + "description": "The HTML content of the new version. Must include <%body%> tag. Maximum of 1048576 bytes allowed for plain content.", + "type": "string" + }, + "name": { + "description": "Name of the new transactional template version.", + "type": "string" + }, + "plain_content": { + "description": "Text/plain content of the new transactional template version. Must include <%body%> tag. Maximum of 1048576 bytes allowed for plain content.", + "type": "string" + }, + "subject": { + "description": "Subject of the new transactional template version. Must include <%subject%> tag.", + "type": "string" + }, + "template_id": { + "description": "The name of the original transactional template.", + "type": "string" + } + }, + "required": [ + "template_id", + "active", + "name", + "html_content", + "plain_content", + "subject" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "transactional_template_version", + "name": "Transactional Templates: Version", + "public": true, + "summary": "" + } + }, + "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": { + "type": "string" + }, + "address2": { + "type": "string" + }, + "city": { + "type": "string" + }, + "company": { + "type": "string" + }, + "country": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "last_name": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "state": { + "type": "string" + }, + "website": { + "type": "string" + }, + "zip": { + "type": "string" + } + }, + "type": "object", + "x-stoplight": { + "description": "", + "id": "user_profile", + "name": "User: Profile", + "public": true, + "summary": "" + } + }, + "user_scheduled_send_status": { + "allOf": [ + { + "$ref": "#/definitions/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" + } + ], + "x-stoplight": { + "description": "", + "id": "user_scheduled_send_status", + "name": "User: Scheduled Send status", + "public": true, + "summary": "" + } + }, + "whitelabel::domain": { + "properties": { + "automatic_security": { + "description": "Indicates if this domain whitelabel uses automated security.", + "type": "boolean" + }, + "custom_spf": { + "description": "Indicates whether this domain whitelabel will use custom SPF.", + "type": "boolean" + }, + "default": { + "description": "Indicates if this domain whitelabel is the default whitelabel.", + "type": "boolean" + }, + "dns": { + "description": "The DNS records for this whitelabel that are 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 that this whitelabel is being created for.", + "type": "string" + }, + "id": { + "description": "The ID of the domain whitelabel.", + "type": "number" + }, + "ips": { + "description": "The IPs to be included in the custom SPF record for this domain whitelabel.", + "items": { + "type": "object" + }, + "type": "array" + }, + "legacy": { + "description": "Indicates if this domain whitelabel was created using the legacy whitelabel tool.", + "type": "boolean" + }, + "subdomain": { + "description": "The subdomain to use for this domain whitelabel.", + "type": "string" + }, + "user_id": { + "description": "The ID of the user that this whitelabel will be associated with.", + "type": "number" + }, + "username": { + "description": "The username that this whitelabel will be associated with.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid whitelabel.", + "type": "boolean" + } + }, + "required": [ + "id", + "user_id", + "subdomain", + "domain", + "username", + "ips", + "custom_spf", + "default", + "legacy", + "automatic_security", + "valid", + "dns" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "whitelabel::domain", + "name": "Whitelabel - Domain", + "public": true, + "summary": "" + } + }, + "whitelabel:domain_spf": { + "properties": { + "automatic_security": { + "description": "Indicates if this whitelabel uses automated security.", + "type": "boolean" + }, + "custom_spf": { + "description": "Indicates if this whitelabel uses custom SPF.", + "type": "boolean" + }, + "default": { + "description": "Indicates if this is the default whitelabel.", + "type": "boolean" + }, + "dns": { + "description": "The DNS records for this whitelabel.", + "properties": { + "dkim": { + "description": "The DKIM record for messages sent using this whitelabel.", + "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 whitelabel.", + "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 that this whitelabel was created for.", + "type": "string" + }, + "id": { + "description": "The ID of the domain whitelabel.", + "type": "integer" + }, + "ips": { + "description": "The IP addresses that are included in the SPF record for this whitelabel.", + "items": {}, + "type": "array" + }, + "legacy": { + "description": "Indicates if this whitelabel was created using the legacy whitelabel tool.", + "type": "boolean" + }, + "subdomain": { + "description": "The subdomain that was used to create this whitelabel.", + "type": "string" + }, + "user_id": { + "description": "The user_id of the account that this whitelabel is associated with.", + "type": "integer" + }, + "username": { + "description": "The username of the account that this whitelabel is associated with.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid whitelabel.", + "type": "boolean" + } + }, + "required": [ + "id", + "domain", + "subdomain", + "username", + "user_id", + "ips", + "custom_spf", + "default", + "legacy", + "automatic_security", + "valid", + "dns" + ], + "type": "object", + "x-stoplight": { + "description": "", + "id": "whitelabel:domain_spf", + "name": "Whitelabel - Domain", + "public": true, + "summary": "" + } + } + }, + "host": "api.sendgrid.com", + "info": { + "description": "", + "title": "SendGrid V3 API", + "version": "3.0" + }, + "paths": { + "/access_settings/activity": { + "get": { + "consumes": [ + "application/json" + ], + "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.**\n\nIP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.\n\nFor more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).", + "operationId": "GET_access_settings-activity", + "parameters": [ + { + "default": 20, + "description": "Limits the number of IPs to return.", + "in": "query", + "name": "limit", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "result": [ + { + "allowed": false, + "auth_method": "basic", + "first_at": 1444087966, + "ip": "1.1.1.1", + "last_at": 1444406672, + "location": "Australia" + }, + { + "allowed": false, + "auth_method": "basic", + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all recent access attempts", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_accesssettings-activity", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/access_settings/whitelist": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove one or more IPs from your IP whitelist.**\n\nYou can remove one IP at a time, or you can remove multiple IP addresses.\n\nIP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.\n\nFor more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).", + "operationId": "DELETE_access_settings-whitelist", + "parameters": [ + { + "in": "body", + "name": "body", + "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 whitelist.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "type": "object" + } + } + ], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove one or more IPs from the whitelist", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_accesssettings-whitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of IP addresses that are currently whitelisted.**\n\nIP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.\n\nFor more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).", + "operationId": "GET_access_settings-whitelist", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": { + "properties": { + "result": { + "description": "An array listing all of your whitelisted IPs.", + "items": { + "properties": { + "created_at": { + "description": "A Unix timestamp indicating when the IP was whitelisted.", + "type": "integer" + }, + "id": { + "description": "The ID of the whitelisted IP.", + "type": "integer" + }, + "ip": { + "description": "The whitelisted IP.", + "type": "string" + }, + "updated_at": { + "description": "A Unix timestamp indicating when the IPs whitelisting status was most recently updated.", + "type": "integer" + } + }, + "required": [ + "id", + "ip", + "created_at", + "updated_at" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "result" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a list of currently whitelisted IPs", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_accesssettings-whitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to add one or more IP addresses to your IP whitelist.**\n\nWhen adding an IP to your whitelist, include the IP address in an array. You can whitelist one IP at a time, or you can whitelist multiple IPs at once.\n\nIP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.\n\nFor more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).", + "operationId": "POST_access_settings-whitelist", + "parameters": [ + { + "in": "body", + "name": "body", + "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 whitelist.", + "items": { + "properties": { + "ip": { + "description": "An IP address that you want to whitelist.", + "type": "string" + } + }, + "required": [ + "ip" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "ips" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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": { + "properties": { + "result": { + "description": "An array listing all of your whitelisted IPs.", + "items": { + "properties": { + "created_at": { + "description": "A Unix timestamp indicating when the IP was whitelisted.", + "type": "integer" + }, + "id": { + "description": "The ID of the whitelisted IP.", + "type": "integer" + }, + "ip": { + "description": "The whitelisted IP.", + "type": "string" + }, + "updated_at": { + "description": "A Unix timestamp indicating when the IPs whitelisting status was most recently updated.", + "type": "integer" + } + }, + "required": [ + "id", + "ip", + "created_at", + "updated_at" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "result" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add one or more IPs to the whitelist", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_accesssettings-whitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/access_settings/whitelist/{rule_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove a specific IP address from your IP whitelist.**\n\nWhen removing a specific IP address from your whitelist, you must include the ID in your call.\n\nIP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.\n\nFor more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).", + "operationId": "DELETE_access_settings-whitelist-rule_id", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove a specific IP from the whitelist", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_accesssettings-whitelist-ruleid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retreive a specific IP address that has been whitelisted.**\n\nYou must include the ID for the specific IP address you want to retrieve in your call.\n\nIP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.\n\nFor more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).", + "operationId": "GET_access_settings-whitelist-rule_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "created_at": 1441824715, + "id": 1, + "ip": "192.168.1.1", + "updated_at": 1441824715 + } + }, + "schema": { + "properties": { + "created_at": { + "description": "A Unix timestamp indicating when the IP was whitelisted.", + "type": "integer" + }, + "id": { + "description": "The ID of the IP address.", + "type": "integer" + }, + "ip": { + "description": "The IP address.", + "type": "string" + }, + "updated_at": { + "description": "A Unix timestamp indicating when the IP address was last updated.", + "type": "integer" + } + }, + "required": [ + "id", + "ip", + "created_at", + "updated_at" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific whitelisted IP", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_accesssettings-whitelist-ruleid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the whitelisted IP address that you want to retrieve.", + "in": "path", + "name": "rule_id", + "required": true, + "type": "string" + } + ] + }, + "/api_keys": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all API Keys that belong to the authenticated user.**\n\nThe API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).", + "operationId": "GET_api_keys", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/api_key_name_id" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all API Keys belonging to the authenticated user", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_apikeys", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This enpoint allows you to create a new random API Key for the user.**\n\nA JSON request body containing a \"name\" property is required. If number of maximum keys is reached, HTTP 403 will be returned.\n\nThere is a limit of 100 API Keys on your account.\n\nThe API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).\n\nSee the [API Key Permissions List](https://sendgrid.com/docs/API_Reference/Web_API_v3/API_Keys/api_key_permissions_list.html) for a list of all available scopes.", + "operationId": "create-api-keys", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": "name", + "message": "missing required argument" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "403": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "Cannot create more than 100 API Keys" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create API keys", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_apikeys", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 201 + }, + "public": true + } + } + }, + "/api_keys/{api_key_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to revoke an existing API Key**\n\nAuthentications using this API Key will fail after this request is made, with some small propogation delay.If the API Key ID does not exist an HTTP 404 will be returned.\n\nThe API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).\n\n## URI Parameters\n\n| URI Parameter | Type | Required? | Description |\n|---|---|---|---|\n|api_key_id |string | required | The ID of the API Key you are deleting.|", + "operationId": "DELETE_api_keys-api_key_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "unable to find API Key" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete API keys", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_apikeys-apikeyid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a single api key.**\n\nIf the API Key ID does not exist an HTTP 404 will be returned.", + "operationId": "GET_api_keys-api_key_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/api_key_name_id_scopes" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "Unexpected error in API call. See HTTP response body for details.", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "unable to find API Key" + } + ] + } + }, + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve an existing API Key", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_apikeys-apikeyid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "api_key_id", + "required": true, + "type": "string" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update the name of an existing API Key.**\n\nA JSON request body with a \"name\" property is required.\n\nThe API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).\n\n## URI Parameters\n\n| URI Parameter | Type | Required? | Description |\n|---|---|---|---|\n|api_key_id |string | required | The ID of the API Key you are updating.|", + "operationId": "PATCH_api_keys-api_key_id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "A New Hope" + }, + "properties": { + "name": { + "description": "The new name of the API Key.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA", + "name": "A New Hope" + } + }, + "schema": { + "$ref": "#/definitions/api_key_name_id" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update API keys", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_apikeys-apikeyid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "put": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update the name and scopes of a given API key.**\n\nA JSON request body with a \"name\" property is required.\nMost provide the list of all the scopes an api key should have.\n\nThe API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).\n", + "operationId": "PUT_api_keys-api_key_id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "A New Hope", + "scopes": [ + "user.profile.read", + "user.profile.update" + ] + }, + "properties": { + "name": { + "type": "string" + }, + "scopes": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "api_key_id": "qfTQ6KG0QBiwWdJ0-pCLCA", + "name": "A New Hope", + "scopes": [ + "user.profile.read", + "user.profile.update" + ] + } + }, + "schema": { + "$ref": "#/definitions/api_key_name_id_scopes" + } + }, + "400": { + "description": "Unexpected error in API call. See HTTP response body for details.", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "expected JSON request body with 'name' property" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "schema": { + "type": "object" + } + }, + "404": { + "description": "Unexpected error in API call. See HTTP response body for details.", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "unable to find API Key to update" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update the name & scopes of an API Key", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PUT_apikeys-apikeyid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/asm/groups": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all suppression groups created by this user.**\n\nSuppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.\n\nThe **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.\n\nEach user can create up to 25 different suppression groups.", + "operationId": "GET_asm-groups", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": "#/definitions/suppression_group_unsubscribes" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all suppression groups associated with the user.", + "tags": [ + "Suppression Management - Unsubscribe Groups" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_asm-groups", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endoint allows you to create a new suppression group.**\n\nSuppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.\n\nThe **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.\n\nEach user can create up to 25 different suppression groups.", + "operationId": "POST_asm-groups", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "description": "A group description", + "is_default": false, + "name": "A group name" + }, + "properties": { + "description": { + "description": "A description of the suppression group.", + "maxLength": 100, + "type": "string" + }, + "is_default": { + "default": false, + "description": "Indicates if this is the default suppression group.", + "type": "boolean" + }, + "name": { + "description": "The name of the new suppression group. May not share its name with any other suppression group on the user.", + "maxLength": 30, + "type": "string" + } + }, + "required": [ + "name", + "description" + ], + "title": "Create a Group request", + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "description": "A group description", + "id": 1234, + "is_default": false, + "last_email_sent_at": null, + "name": "A group name" + } + }, + "schema": { + "$ref": "#/definitions/suppression_group" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Group", + "tags": [ + "Suppression Management - Unsubscribe Groups" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_asm-groups", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/asm/groups/:group_id/suppressions": { + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to determine if the given list of email addresses exists in the given suppression group. The endpoint will return a subset of emails from the request that exists in the suppression group specified.**\n\nSuppressions are email addresses that can be added to [groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html) to prevent certain types of emails from being delivered to those addresses.", + "operationId": "POST_asm-groups-:group_id-suppressions", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "recipient_emails": [ + "exists1@example.com", + "exists2@example.com", + "doesnotexists@example.com" + ] + }, + "properties": { + "recipient_emails": { + "description": "The list of email address you would like to search for.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "recipient_emails" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "recipient_emails": [ + "exists1@example.com", + "exists2@example.com" + ] + } + }, + "schema": { + "properties": { + "recipient_emails": { + "description": "The subset of email address that do exist in the suppression group.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "recipient_emails" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Search a suppression group for a set of email addresses", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_asm-groups-groupid-suppressions", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/asm/groups/{group_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a suppression group.**\n\nYou can only delete groups that have not been attached to sent mail in the last 60 days. If 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\nSuppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.\n\nThe **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.\n\nEach user can create up to 25 different suppression groups.", + "operationId": "DELETE_asm-groups-group_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a suppression group.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_asm-groups-groupid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": 204 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a single suppression group.**\n\nSuppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.\n\nThe **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.\n\nEach user can create up to 25 different suppression groups.", + "operationId": "GET_asm-groups-group_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "description": "Our monthly newsletter.", + "id": 100, + "is_default": true, + "last_email_sent_at": null, + "name": "Newsletters", + "unsubscribes": 400 + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/suppression_group" + }, + { + "properties": { + "unsubscribes": { + "description": "The unsubscribes associated with this group.", + "type": "integer" + } + } + } + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get information on a single suppression group.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_asm-groups-groupid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the suppression group you want to delete.", + "in": "path", + "name": "group_id", + "required": true, + "type": "integer" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update or change a suppression group.**\n\nSuppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.\n\nThe **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.\n\nEach user can create up to 25 different suppression groups.", + "operationId": "PATCH_asm-groups-group_id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "description": "Suggestions for items our users might like.", + "id": 103, + "name": "Item Suggestions" + }, + "properties": { + "description": { + "description": "The description of the suppression group.", + "maxLength": 100, + "type": "string" + }, + "id": { + "description": "The id of the suppression group.", + "type": "number" + }, + "is_default": { + "description": "Indicates if the suppression group is set as the default group.", + "type": "boolean" + }, + "name": { + "description": "The name of the suppression group. Each group created by a user must have a unique name.", + "maxLength": 30, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "description": "Suggestions for items our users might like.", + "id": 103, + "name": "Item Suggestions" + } + }, + "schema": { + "$ref": "#/definitions/suppression_group" + } + } + }, + "summary": "Update a suppression group.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_asm-groups-groupid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/asm/groups/{group_id}/suppressions": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all suppressed email addresses belonging to the given group.**\n\nSuppressions are recipient email addresses that are added to [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html). 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.", + "operationId": "GET_asm-groups-group_id-suppressions", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + "example@example.com", + "example2@example.com" + ] + }, + "schema": { + "description": "The list of email addresses belonging to the given suppression group.", + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all suppressions for a suppression group", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_asm-groups-groupid-suppressions", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the suppression group that you are retrieving email addresses from.", + "in": "path", + "name": "group_id", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "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.\n\nSuppressions are recipient email addresses that are added to [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html). 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.", + "operationId": "POST_asm-groups-group_id-suppressions", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "recipient_emails": [ + "test1@example.com", + "test2@example.com" + ] + }, + "properties": { + "recipient_emails": { + "description": "The email address that you want to add to the unsubscribe group.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "recipient_emails" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "recipient_emails": [ + "test1@example.com", + "test2@example.com" + ] + } + }, + "schema": { + "properties": { + "recipient_emails": { + "description": "The email address that were added to the suppressions list.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "recipient_emails" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add suppressions to a suppression group", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_asm-groups-groupid-suppressions", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/asm/groups/{group_id}/suppressions/{email}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove a suppressed email address from the given suppression group.**\n\nSuppressions are recipient email addresses that are added to [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html). 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.", + "operationId": "DELETE_asm-groups-group_id-suppressions-email", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a suppression from a suppression group", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_asm-groups-groupid-suppressions-email", + "mock": { + "dynamic": false, + "enabled": null, + "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, + "type": "string" + }, + { + "description": "The email address that you want to remove from the suppression group.", + "in": "path", + "name": "email", + "required": true, + "type": "string" + } + ] + }, + "/asm/suppressions": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all suppressions.**\n\nSuppressions are email addresses that can be added to [groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html) to prevent certain types of emails from being delivered to those addresses.", + "operationId": "GET_asm-suppressions", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all suppressions", + "tags": [ + "Suppression Management - Suppressions" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_asm-suppressions", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/asm/suppressions/global": { + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to add one or more email addresses to the global suppressions group.**\n\nA 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 [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html).", + "operationId": "POST_asm-suppressions-global", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "recipient_emails": [ + "test1@example.com", + "test2@example.com" + ] + }, + "properties": { + "recipient_emails": { + "description": "The email address, or addresses, that you want to add to the global suppressions group.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "recipient_emails": [ + "test1@example.com", + "test2@example.com" + ] + } + }, + "schema": { + "properties": { + "recipient_emails": { + "description": "The email addresses that are globally suppressed", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "recipient_emails" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add recipient addresses to the global suppression group.", + "tags": [ + "Suppression Management - Global Suppressions" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_asm-suppressions-global", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/asm/suppressions/global/{email}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove an email address from the global suppressions group.**\n\nA 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 [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html).", + "operationId": "DELETE_asm-suppressions-global-email", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Global Suppression", + "tags": [ + "Suppression Management - Global Suppressions" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_asm-suppressions-global-email", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "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 alreayd 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.\n\nA 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 [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html).", + "operationId": "GET_asm-suppressions-global-email", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "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.", + "type": "string" + } + }, + "required": [ + "recipient_email" + ], + "title": "Retrieve a Global Suppression response", + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Global Suppression", + "tags": [ + "Suppression Management - Global Suppressions" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_asm-suppressions-global-email", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The email address you want to remove from the global suppressions group.", + "in": "path", + "name": "email", + "required": true, + "type": "string" + } + ] + }, + "/asm/suppressions/{email}": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint will return a list of all suppression groups, indicating if the given email address is suppressed for each group.**\n\nSuppressions are email addresses that can be added to [groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html) to prevent certain types of emails from being delivered to those addresses.", + "operationId": "GET_asm-suppressions-email", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all suppression groups for an email address", + "tags": [ + "Suppression Management - Suppressions" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "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, + "type": "string" + } + ] + }, + "/browsers/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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 [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).", + "operationId": "GET_browsers-stats", + "parameters": [ + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "type": "string" + }, + { + "description": "The end date of the statistics to retrieve. Defaults to today.", + "in": "query", + "name": "end_date", + "required": false, + "type": "string" + }, + { + "description": "The number of results to include on each page.", + "in": "query", + "name": "limit", + "required": false, + "type": "string" + }, + { + "description": "The number of results to exclude.", + "in": "query", + "name": "offset", + "required": false, + "type": "string" + }, + { + "description": "How to group the stats. Must be either \"day\", \"week\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + }, + { + "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", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "$ref": "#/definitions/advanced_stats_clicks" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by browser. ", + "tags": [ + "Stats - Advanced Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_browsers-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/campaigns": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "GET_campaigns", + "parameters": [ + { + "default": 10, + "description": "The number of results you would like to receive at a time.", + "in": "query", + "name": "limit", + "type": "number" + }, + { + "default": 0, + "description": "The index of the first campaign to return, where 0 is the first campaign.", + "in": "query", + "name": "offset", + "type": "number" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/campaign_response" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all Campaigns", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_campaigns", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create a campaign.**\n\nOur Marketing Campaigns API lets you create, manage, send, and schedule campaigns.\n\nNote: In 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.\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "POST_campaigns", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/campaign_request", + "example": { + "categories": [ + "spring line" + ], + "custom_unsubscribe_url": "", + "html_content": "

Check out our spring line!

", + "ip_pool": "marketing", + "list_ids": [ + 110, + 124 + ], + "plain_content": "Check out our spring line!", + "segment_ids": [ + 110 + ], + "sender_id": 124451, + "subject": "New Products for Spring!", + "suppression_group_id": 42, + "title": "March Newsletter" + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/campaign_response" + } + }, + "400": { + "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.\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Campaign", + "tags": [ + "Campaigns API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_campaigns", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/campaigns/{campaign_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a specific campaign.**\n\nOur Marketing Campaigns API lets you create, manage, send, and schedule campaigns.\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "DELETE_campaigns-campaign_id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "type": "object" + } + }, + "404": { + "description": "\"\": \"not found\"", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_campaigns-campaignid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a specific campaign.**\n\nOur Marketing Campaigns API lets you create, manage, send, and schedule campaigns.\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "GET_campaigns-campaign_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/campaign_response" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "type": "object" + } + }, + "404": { + "description": "\"\": \"not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + }, + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a single campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_campaigns-campaignid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the campaign that you would like to delete.", + "in": "path", + "name": "campaign_id", + "required": true, + "type": "integer" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "Update a campaign. This is especially useful if you only set up the campaign using POST /campaigns, but didn't set many of the parameters.\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "PATCH_campaigns-campaign_id", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/campaign_response" + } + }, + "400": { + "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.\"", + "examples": { + "application/json": { + "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" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "403": { + "description": "\"\": \"You may only update a campaign when it is in draft mode.\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "You may only update a campaign when it is in draft mode." + } + ] + } + }, + "schema": { + "type": "object" + } + }, + "404": { + "description": "\"\": \"not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a Campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_campaigns-campaignid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/campaigns/{campaign_id}/schedules": { + "delete": { + "consumes": [ + "application/json" + ], + "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).\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "DELETE_campaigns-campaign_id-schedules", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "403": { + "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.\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"\": \"not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Unschedule a Scheduled Campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_campaigns-campaignid-schedules", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the date and time that the given campaign has been scheduled to be sent.**\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "GET_campaigns-campaign_id-schedules", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "send_at": 1490778528 + } + }, + "schema": { + "properties": { + "send_at": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "send_at" + ], + "title": "View Scheduled Time of a Campaign response", + "type": "object" + } + }, + "404": { + "description": "\"\": \"not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "View Scheduled Time of a Campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_campaigns-campaignid-schedules", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "campaign_id", + "required": true, + "type": "integer" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows to you change the scheduled time and date for a campaign to be sent.**\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "PATCH_campaigns-campaign_id-schedules", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "send_at": 1489451436 + }, + "properties": { + "send_at": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "send_at" + ], + "title": "Update a Scheduled Campaign request", + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "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" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "403": { + "description": "\"send_at\": \"You cannot update the send_at value of non-scheduled campaign.\"", + "examples": { + "application/json": { + "errors": [ + { + "field": "send_at", + "message": "You cannot update the send_at value of non-scheduled campaign." + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"\": \"not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a Scheduled Campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_campaigns-campaignid-schedules", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to schedule a specific date and time for your campaign to be sent.**\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "POST_campaigns-campaign_id-schedules", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "403": { + "description": "\"\": \"You cannot POST to a campaign that has already sent or scheduled. However you can update a scheduled campaign with a PATCH.\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"\": \"not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Schedule a Campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_campaigns-campaignid-schedules", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/campaigns/{campaign_id}/schedules/now": { + "parameters": [ + { + "in": "path", + "name": "campaign_id", + "required": true, + "type": "integer" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to immediately send a campaign at the time you make the API call.**\n\nNormally a POST would have a request body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed.\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "POST_campaigns-campaign_id-schedules-now", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "id": 1234, + "status": "Scheduled" + } + }, + "schema": { + "properties": { + "id": { + "format": "int64", + "type": "integer" + }, + "status": { + "type": "string" + } + }, + "required": [ + "id", + "status" + ], + "title": "Send a Campaign response", + "type": "object" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "403": { + "description": "\"\": \"You may only send a campaign when it is in draft mode.\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "You may only send a campaign when it is in draft mode." + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"\": \"not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Send a Campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_campaigns-campaignid-schedules-now", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/campaigns/{campaign_id}/schedules/test": { + "parameters": [ + { + "in": "path", + "name": "campaign_id", + "required": true, + "type": "integer" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "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\"]\n\nFor more information:\n\n* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)", + "operationId": "POST_campaigns-campaign_id-schedules-test", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "properties": { + "to": { + "type": "string" + } + }, + "required": [ + "to" + ], + "title": "Send a Test Campaign request", + "type": "object" + } + }, + "400": { + "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.\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"\": \"not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Send a Test Campaign", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_campaigns-campaignid-schedules-test", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/categories": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all of your categories.**\n\nCategories can help organize your email analytics by enabling you to \u201ctag\u201d emails by type or broad topic. You can define your own custom categories. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html).", + "operationId": "GET_categories", + "parameters": [ + { + "default": 50, + "description": "The number of categories to display per page.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "Allows you to perform a prefix search on this particular category.", + "in": "query", + "name": "category", + "type": "string" + }, + { + "default": 0, + "description": "The point in the list that you would like to begin displaying results.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all categories", + "tags": [ + "Categories" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_categories", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/categories/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nCategories allow you to group your emails together according to broad topics that you define. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html). ", + "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, + "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, + "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, + "type": "string" + }, + { + "default": 500, + "description": "The number of results to include.", + "in": "query", + "maximum": 500, + "name": "limit", + "required": false, + "type": "integer" + }, + { + "description": "The number of results to skip.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": "#/definitions/category_stats" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Email Statistics for Categories", + "tags": [ + "Stats - Category Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_categories-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/categories/stats/sums": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nCategories allow you to group your emails together according to broad topics that you define. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html). ", + "operationId": "GET_categories-stats-sums", + "parameters": [ + { + "default": "delivered", + "description": "The metric that you want to sort by. Must be a single metric.", + "in": "query", + "name": "sort_by_metric", + "required": false, + "type": "string" + }, + { + "default": "desc", + "description": "The direction you want to sort.", + "enum": [ + "desc", + "asc" + ], + "in": "query", + "name": "sort_by_direction", + "required": false, + "type": "string" + }, + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "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, + "type": "string" + }, + { + "default": 5, + "description": "Limits the number of results returned.", + "in": "query", + "name": "limit", + "required": false, + "type": "integer" + }, + { + "default": 0, + "description": "The point in the list to begin retrieving results.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": { + "properties": { + "": { + "$ref": "#/definitions/category_stats" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?]", + "tags": [ + "Stats - Category Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_categories-stats-sums", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/clients/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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 [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).", + "operationId": "GET_clients-stats", + "parameters": [ + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "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, + "type": "string" + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "$ref": "#/definitions/advanced_stats_opens" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by client type.", + "tags": [ + "Stats - Advanced Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_clients-stats", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/clients/{client_type}/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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 [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).", + "operationId": "GET_clients-client_type-stats", + "parameters": [ + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "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, + "type": "string" + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "$ref": "#/definitions/advanced_stats_opens" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve stats by a specific client type.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_clients-clienttype-stats", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "Specifies the type of client to retrieve stats for. Must be either \"phone\", \"tablet\", \"webmail\", or \"desktop\".", + "enum": [ + "phone", + "tablet", + "webmail", + "desktop" + ], + "in": "path", + "name": "client_type", + "required": true, + "type": "string" + } + ] + }, + "/contactdb/custom_fields": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all custom fields.** \n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "GET_contactdb-custom_fields", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/contactdb_custom_field_with_id" + }, + "type": "array" + } + }, + "required": [ + "custom_fields" + ], + "title": "List All Custom Fields response", + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all custom fields", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-customfields", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create a custom field.**\n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "POST_contactdb-custom_fields", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "pet", + "type": "text" + }, + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "id": 1, + "name": "pet", + "type": "text" + } + }, + "schema": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "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": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Custom Field", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_contactdb-customfields", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/contactdb/custom_fields/{custom_field_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a custom field by ID.**\n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "DELETE_contactdb-custom_fields-custom_field_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "202": { + "description": "", + "examples": { + "application/json": { + "message": "Custom Field delete is processing." + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "400": { + "description": "\"id\" : \"Returned if custom_field_id is not valid\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "Custom field in use by one or more segment conditions" + }, + { + "message": "Custom field ID does not exist" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"custom_field_id\" : \"Returned if custom_field_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "Custom field ID does not exist" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Custom Field", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_contactdb-customfields-customfieldid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a custom field by ID.**\n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "GET_contactdb-custom_fields-custom_field_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "id": 1, + "name": "pet", + "type": "text" + } + }, + "schema": { + "$ref": "#/definitions/contactdb_custom_field_with_id" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "message": "invalid id" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"custom_field_id\" : \"Returned if custom_field_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "Custom field ID does not exist" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Custom Field", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-customfields-customfieldid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the custom field that you want to retrieve.", + "in": "path", + "name": "custom_field_id", + "required": true, + "type": "integer" + } + ] + }, + "/contactdb/lists": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete multiple recipient lists.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "DELETE_contactdb-lists", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": [ + 1, + 2, + 3, + 4 + ], + "items": { + "type": "number" + }, + "type": "array" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "400": { + "description": "\"id\" : \"Returned if all list ids are not valid\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "list id was invalid" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Multiple lists", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_contactdb-lists", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "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.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "GET_contactdb-lists", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "lists": [ + { + "id": 1, + "name": "the jones", + "recipient_count": 1 + } + ] + } + }, + "schema": { + "properties": { + "lists": { + "items": { + "$ref": "#/definitions/contactdb_list" + }, + "type": "array" + } + }, + "required": [ + "lists" + ], + "title": "List All Lists response", + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all lists", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-lists", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create a list for your recipients.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "POST_contactdb-lists", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "your list name" + }, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Create a List request", + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "id": 1, + "name": "your list name", + "recipient_count": 0 + } + }, + "schema": { + "$ref": "#/definitions/contactdb_list" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a List", + "tags": [ + "Contacts API - Lists" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_contactdb-lists", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/contactdb/lists/{list_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a specific recipient list with the given ID.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "DELETE_contactdb-lists-list_id", + "parameters": [ + { + "description": "Adds the ability to delete all contacts on the list in addition to deleting the list.", + "enum": [ + true, + false + ], + "in": "query", + "name": "delete_contacts", + "type": "boolean" + }, + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "202": { + "description": "", + "schema": { + "type": "null" + } + }, + "400": { + "description": "\"list_id\" : \"Returned if list_id is not valid\"\n\"delete_contacts\" : \"Returned if delete_contacts is not valid\"", + "examples": { + "application/json": { + "errors": [ + { + "field": "delete_contacts", + "message": "delete_contacts not a bool" + }, + { + "field": "list_id", + "message": "Returned if list_id is not valid" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"list_id\" : \"Returned if list_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "List not found: 5" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a List", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_contactdb-lists-listid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "This endpoint allows you to retrieve a single recipient list.\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "GET_contactdb-lists-list_id", + "parameters": [ + { + "description": "The ID of the list to retrieve.", + "in": "query", + "name": "list_id", + "type": "number" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "id": 1, + "name": "listname", + "recipient_count": 0 + } + }, + "schema": { + "$ref": "#/definitions/contactdb_list" + } + }, + "400": { + "description": "\"list_id\" : \"Returned if list_id is not valid\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "invalid id" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"list_id\" : \"Returned if list_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "List ID does not exist" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a single list", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-lists-listid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "list_id", + "required": true, + "type": "string" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update the name of one of your recipient lists.**\n\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "PATCH_contactdb-lists-list_id", + "parameters": [ + { + "description": "The ID of the list you are updating.", + "in": "query", + "name": "list_id", + "required": true, + "type": "number" + }, + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "newlistname" + }, + "properties": { + "name": { + "description": "The new name for your list. ", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Update a List request", + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "type": "object" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "invalid id" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"list_id\" : \"Returned if list_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "List ID does not exist" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a List", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_contactdb-lists-listid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/contactdb/lists/{list_id}/recipients": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all recipients on the list with the given ID.** \n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "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, + "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, + "type": "integer" + }, + { + "description": "The ID of the list whose recipients you are requesting.", + "in": "query", + "name": "list_id", + "required": true, + "type": "number" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/contactdb_recipient" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"list_id\" : \"Returned if list_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id is invalid" + } + ] + } + }, + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all recipients on a List", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-lists-listid-recipients", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the list of recipients you want to retrieve.", + "in": "path", + "name": "list_id", + "required": true, + "type": "integer" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "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.\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "POST_contactdb-lists-list_id-recipients", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": [ + "recipient_id1", + "recipient_id2" + ], + "items": { + "type": "string" + }, + "type": "array" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "schema": { + "type": "null" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"list_id\": \"Returned if list_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "field": "list_id", + "message": "list_id does not exist" + }, + { + "field": "recipient_id", + "message": "recipient_id does not exist" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add Multiple Recipients to a List", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_contactdb-lists-listid-recipients", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/contactdb/lists/{list_id}/recipients/{recipient_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a single recipient from a list.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "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, + "type": "number" + }, + { + "description": "The ID of the recipient to take off the list.", + "in": "query", + "name": "recipient_id", + "required": true, + "type": "number" + }, + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "400": { + "description": "\"list_id\" : \"Returned if list_id is not valid\"\n\"recipient_id\" : \"Returned if recipient_id is not valid\"", + "examples": { + "application/json": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id is invalid" + }, + { + "field": "recipient_id", + "message": "no valid recipients were provided" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"list_id\" : \"Returned if list_id does not exist\"\n\"recipient_id\" : \"Returned if recipient_id does not exist\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Single Recipient from a Single List", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_contactdb-lists-listid-recipients-recipientid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the list that you want to add the recipient to.", + "in": "path", + "name": "list_id", + "required": true, + "type": "integer" + }, + { + "description": "The ID of the recipient you are adding to the list.", + "in": "path", + "name": "recipient_id", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to add a single recipient to a list.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "POST_contactdb-lists-list_id-recipients-recipient_id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "schema": { + "type": "null" + } + }, + "400": { + "description": "\"list_id\" : \"Returned if list_id is invalid\"\n\"recipient_id\" : \"Returned if recipient_id is invalid\"", + "examples": { + "application/json": { + "errors": [ + { + "field": "list_id", + "message": "Returned if list_id is invalid" + }, + { + "field": "recipient_id", + "message": "Returned if recipient_id is invalid" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"list_id\" : \"Returned if list_id does not exist\"\n\"recipient_id\" : \"Returned if recipient_id does not exist\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add a Single Recipient to a List", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_contactdb-lists-listid-recipients-recipientid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/contactdb/recipients": { + "delete": { + "consumes": [ + "application/json" + ], + "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.\n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "DELETE_contactdb-recipients", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": [ + "recipient_id1", + "recipient_id2" + ], + "items": { + "type": "string" + }, + "type": "array" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "type": "object" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "No recipient ids provided" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete Recipient", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_contactdb-recipients", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "GET_contactdb-recipients", + "parameters": [ + { + "description": "Page index of first recipients to return (must be a positive integer)", + "in": "query", + "name": "page", + "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", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "properties": { + "recipients": { + "items": { + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "recipients" + ], + "title": "List Recipients response", + "type": "object" + } + }, + "400": { + "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\"", + "schema": { + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-recipients", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "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.\n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "PATCH_contactdb-recipients", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/contactdb_recipient_response" + } + }, + "400": { + "description": "\"\" : \"Returned if request body is not valid json\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "Request body is not valid json" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Recipient", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_contactdb-recipients", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to add a Marketing Campaigns recipient.**\n\nIt is of note that you 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 Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "POST_contactdb-recipients", + "parameters": [ + { + "in": "body", + "name": "body", + "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": { + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/contactdb_recipient_response" + } + }, + "400": { + "description": "\"\" : \"Returned if request body is not valid json\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "Request body is not valid json" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_contactdb-recipients", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/contactdb/recipients/billable_count": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "GET_contactdb-recipients-billable_count", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "recipient_count": 1234 + } + }, + "schema": { + "$ref": "#/definitions/contactdb_recipient_count" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the count of billable recipients", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-recipients-billablecount", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/contactdb/recipients/count": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.**\n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "GET_contactdb-recipients-count", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "recipient_count": 1234 + } + }, + "schema": { + "$ref": "#/definitions/contactdb_recipient_count" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Count of Recipients", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-recipients-count", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/contactdb/recipients/search": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "GET_contactdb-recipients-search", + "parameters": [ + { + "in": "query", + "name": "{field_name}", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/contactdb_recipient" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "400": { + "description": "\"\" : \"Returned if no search params are specified\"\n\"field\" : \"Returned if the provided field is invalid or does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "The following parameters are not custom fields or reserved fields: [{field_name}]" + }, + { + "message": "No search params are specified" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve recipients matching search criteria", + "tags": [ + "Contacts API - Recipients" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-recipients-search", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/contactdb/recipients/{recipient_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a single recipient with the given ID from your contact database.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "DELETE_contactdb-recipients-recipient_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "400": { + "description": "\"recipient_id\" : \"Returned if recipient_id is not valid\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "recipient not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"recipient_id\" : \"Returned if record for recipient id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "recipient_id is not valid" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Recipient", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_contactdb-recipients-recipientid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a single recipient by ID from your contact database.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "GET_contactdb-recipients-recipient_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/contactdb_recipient" + } + }, + "400": { + "description": "\"recipient_id\" : \"Returned if recipient_id is not valid\"", + "schema": { + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"recipient_id\" : \"Returned if record for recipient id does not exist\"", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a single recipient", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-recipients-recipientid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the recipient that you want to retrieve.", + "in": "path", + "name": "recipient_id", + "required": true, + "type": "string" + } + ] + }, + "/contactdb/recipients/{recipient_id}/lists": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.", + "operationId": "GET_contactdb-recipients-recipient_id-lists", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "lists": [ + { + "id": 1234, + "name": "Example list", + "recipient_count": 42 + } + ] + } + }, + "schema": { + "properties": { + "lists": { + "items": { + "$ref": "#/definitions/contactdb_list" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "400": { + "description": "\"recipient_id\" : \"Returned if recipient_id is not valid\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "recipient ID is invalid" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"recipient_id\" : \"Returned if record for the recipient id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "recipient id not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the lists that a recipient is on", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-recipients-recipientid-lists", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the recipient for whom you are retrieving lists.", + "in": "path", + "name": "recipient_id", + "required": true, + "type": "string" + } + ] + }, + "/contactdb/reserved_fields": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to list all fields that are reserved and can't be used for custom field names.**\n\nThe contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).", + "operationId": "GET_contactdb-reserved_fields", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "my_custom_field", + "type": "text" + } + ] + } + }, + "schema": { + "properties": { + "reserved_fields": { + "description": "The reserved fields that are already set up within custom fields.", + "items": { + "$ref": "#/definitions/contactdb_custom_field" + }, + "type": "array" + } + }, + "required": [ + "reserved_fields" + ], + "title": "List fields that are reserved and can't be used for custom field names. response", + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve reserved fields", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-reservedfields", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/contactdb/segments": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all of your segments.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.\n\nFor more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).", + "operationId": "GET_contactdb-segments", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/contactdb_segments" + }, + "type": "array" + } + }, + "required": [ + "segments" + ], + "title": "List All Segments response", + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all segments", + "tags": [ + "Contacts API - Segments" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-segments", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create a segment.**\n\nAll recipients in your contactdb will be added or removed automatically depending on whether they match the criteria for this segment.\n\nList Id:\n\n* Send this to segment from an existing list\n* Don't send this in order to segment from your entire contactdb.\n\nValid operators for create and update depend on the type of the field you are segmenting: \n\n* **Dates:** \"eq\", \"ne\", \"lt\" (before), \"gt\" (after) \n* **Text:** \"contains\", \"eq\" (is - matches the full field), \"ne\" (is not - matches any field where the entire field is not the condition value) \n* **Numbers:** \"eq\", \"lt\", \"gt\" \n* **Email Clicks and Opens:** \"eq\" (opened), \"ne\" (not opened) \n\nSegment conditions using \"eq\" or \"ne\" for email clicks and opens should provide a \"field\" of either *clicks.campaign_identifier* or *opens.campaign_identifier*. The condition value should be a string containing the id of a completed campaign. \n\nSegments may contain multiple condtions, joined by an \"and\" or \"or\" in the \"and_or\" field. The first condition in the conditions list must have an empty \"and_or\", and subsequent conditions must all specify an \"and_or\".\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.\n\nFor more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).", + "operationId": "POST_contactdb-segments", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/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" + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/contactdb_segments_with_id" + } + }, + "400": { + "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\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Segment", + "tags": [ + "Contacts API - Segments" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_contactdb-segments", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/contactdb/segments/{segment_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "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.\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.\n\nFor more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-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", + "type": "boolean" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "400": { + "description": "\"segment_id\" : \"Returned if segment_id is not valid\"\n\"delete_contacts\" : \"Returned if delete_contacts is not a valid boolean\"", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"segment_id\" : \"Returned if segment_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "field": "segment_id", + "message": "segment_id does not exist" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a segment", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_contactdb-segments-segmentid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a single segment with the given ID.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.\n\nFor more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).", + "operationId": "GET_contactdb-segments-segment_id", + "parameters": [ + { + "description": "The ID of the segment you want to request.", + "in": "query", + "name": "segment_id", + "required": true, + "type": "number" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "conditions": [ + { + "and_or": "", + "field": "last_name", + "operator": "eq", + "value": "Miller" + } + ], + "id": 1, + "list_id": 4, + "name": "Last Name Miller", + "recipient_count": 1 + } + }, + "schema": { + "$ref": "#/definitions/contactdb_segments" + } + }, + "400": { + "description": "\"segment_id\" : \"Returned if segment_id is not valid\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "if segment_id is not valid" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"segment_id\" : \"Returned if segment_id does not exist\"", + "examples": { + "application/json": { + "errors": [ + { + "message": "segment_id not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a segment", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-segments-segmentid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "segment_id", + "required": true, + "type": "string" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update a segment.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.\n\nFor more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).", + "operationId": "PATCH_contactdb-segments-segment_id", + "parameters": [ + { + "description": "The ID of the segment you are updating.", + "in": "query", + "name": "segment_id", + "type": "string" + }, + { + "in": "body", + "name": "body", + "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": "#/definitions/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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "conditions": [ + { + "and_or": "", + "field": "last_name", + "operator": "eq", + "value": "Miller" + } + ], + "id": 5, + "list_id": 5, + "name": "The Millers", + "recipient_count": 1 + } + }, + "schema": { + "$ref": "#/definitions/contactdb_segments" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a segment", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_contactdb-segments-segmentid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/contactdb/segments/{segment_id}/recipients": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all of the recipients in a segment with the given ID.**\n\nThe Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.\n\nFor more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).", + "operationId": "GET_contactdb-segments-segment_id-recipients", + "parameters": [ + { + "in": "query", + "name": "page", + "type": "integer" + }, + { + "in": "query", + "name": "page_size", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/contactdb_recipient" + }, + "type": "array" + } + }, + "required": [ + "recipients" + ], + "title": "List Recipients On a Segment response", + "type": "object" + } + }, + "400": { + "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\"", + "schema": { + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"segment_id\" : \"Returned if segment_id is not valid\"\n\"segment_id\" : \"Returned if segment_id does not exist\"", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve recipients on a segment", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_contactdb-segments-segmentid-recipients", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The ID of the segment from which you want to retrieve recipients.", + "in": "path", + "name": "segment_id", + "required": true, + "type": "integer" + } + ] + }, + "/devices/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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 [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).", + "operationId": "GET_devices-stats", + "parameters": [ + { + "description": "The end date of the statistics to retrieve. Defaults to today.", + "in": "query", + "name": "end_date", + "required": false, + "type": "string" + }, + { + "description": "How many results to include on each page.", + "in": "query", + "name": "limit", + "required": false, + "type": "integer" + }, + { + "description": "How many results to exclude.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + }, + { + "description": "The starting date of the statistics to retrieve.", + "in": "query", + "name": "start_date", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "$ref": "#/definitions/advanced_stats_opens" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by device type.", + "tags": [ + "Stats - Advanced Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_devices-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/geo/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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": "How many results to include on each page.", + "in": "query", + "name": "limit", + "required": false, + "type": "integer" + }, + { + "description": "How many results to exclude.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + }, + { + "description": "How you would like the statistics to be grouped. Must be either \"day\", \"week\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + }, + { + "description": "The starting date of the statistics to retrieve. Must be in format YYYY-MM-DD", + "in": "query", + "name": "start_date", + "required": true, + "type": "string" + }, + { + "default": "The date the request is made.", + "description": "The end date of the statistics to retrieve. ", + "in": "query", + "name": "end_date", + "required": false, + "type": "string" + }, + { + "description": "The country you would like to see statistics for. Currently only supported for US and CA.", + "enum": [ + "US", + "CA" + ], + "in": "query", + "name": "country", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "$ref": "#/definitions/advanced_stats_country" + }, + "type": "array" + } + } + }, + "summary": "Retrieve email statistics by country and state/province.", + "tags": [ + "Stats - Advanced Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_geo-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/ips": { + "get": { + "consumes": [ + "application/json" + ], + "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 whitelabel 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", + "type": "string" + }, + { + "description": "Should we exclude whitelabels?", + "in": "query", + "name": "exclude_whitelabels", + "type": "boolean" + }, + { + "description": "The subuser you are requesting for.", + "in": "query", + "name": "subuser", + "type": "string" + }, + { + "default": 10, + "description": "The number of IPs you want returned at the same time.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "default": 0, + "description": "The offset for the number of IPs that you are requesting.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "ip": "127.0.0.1", + "pools": [], + "rdns": "o1.em.example.com", + "start_date": 1250337600, + "subusers": [ + "example_subuser1", + "example_subuser2" + ], + "warmup": true, + "whitelabeled": true + }, + { + "ip": "127.0.0.1", + "pools": [], + "start_date": null, + "subusers": [], + "warmup": false, + "whitelabeled": false + } + ] + }, + "schema": { + "items": { + "properties": { + "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.", + "type": [ + "number", + "null" + ] + }, + "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 has been whitelabeled.", + "type": "boolean" + } + }, + "required": [ + "ip", + "subusers", + "pools", + "warmup", + "start_date", + "whitelabeled" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IP addresses", + "tags": [ + "IP Addresses" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_ips", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/ips/assigned": { + "get": { + "consumes": [ + "application/json" + ], + "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", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all assigned IPs", + "tags": [ + "IP Addresses" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_ips-assigned", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/ips/pools": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retreive all of your IP pools.**\n\nIP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and 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\nIP pools can only be used with whitelabeled IP addresses.\n\nIf an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.", + "operationId": "GET_ips-pools", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "name": "marketing" + }, + { + "name": "transactional" + } + ] + }, + "schema": { + "items": { + "$ref": "#/definitions/ip_pool" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IP pools.", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_ips-pools", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create an IP pool.**\n\n**Each user can create up to 10 different IP pools.**\n\nIP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and 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\nIP pools can only be used with whitelabeled IP addresses.\n\nIf an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.", + "operationId": "POST_ips-pools", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "marketing" + }, + "properties": { + "name": { + "description": "The name of your new IP pool.", + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "name": "marketing" + } + }, + "schema": { + "$ref": "#/definitions/ip_pool" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create an IP pool.", + "tags": [ + "IP Pools" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_ips-pools", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/pools/{pool_name}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete an IP pool.**\n\nIP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and 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\nIP pools can only be used with whitelabeled IP addresses.\n\nIf an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.", + "operationId": "DELETE_ips-pools-pool_name", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete an IP pool.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_ips-pools-poolname", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to list all of the IP addresses that are in a specific IP pool.**\n\nIP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and 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\nIP pools can only be used with whitelabeled IP addresses.\n\nIf an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.", + "operationId": "GET_ips-pools-pool_name", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "properties": { + "ips": { + "description": "The list of IP addresses that belong to this IP pool.", + "items": { + "type": "string" + }, + "type": "array" + }, + "pool_name": { + "description": "The name of the IP pool.", + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "pool_name" + ], + "type": "object" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IPs in a specified pool.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "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 from.", + "in": "path", + "name": "pool_name", + "required": true, + "type": "string" + } + ], + "put": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update the name of an IP pool.**\n\nIP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and 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\nIP pools can only be used with whitelabeled IP addresses.\n\nIf an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.", + "operationId": "PUT_ips-pools-pool_name", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "new_pool_name" + }, + "properties": { + "name": { + "description": "The new name for your IP pool.", + "maxLength": 64, + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "name": "new_pool_name" + } + }, + "schema": { + "$ref": "#/definitions/ip_pool" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "ip pool not found" + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "properties": { + "field": { + "type": "null" + }, + "message": { + "description": "A message explaining why the name of your IP pool could not be updated.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update an IP pool\u2019s name.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "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 that you want to add an IP address to.", + "in": "path", + "name": "pool_name", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "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\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": "POST_ips-pools-pool_name-ips", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "ip": "0.0.0.0" + }, + "properties": { + "ip": { + "description": "The IP address that you want to add to an IP pool.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "ip": "000.00.00.0", + "pools": [ + "test1" + ], + "start_date": 1409616000, + "warmup": true + } + }, + "schema": { + "properties": { + "ip": { + "description": "The IP address.", + "type": "string" + }, + "pools": { + "description": "The list of 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 IP address.", + "type": "integer" + }, + "warmup": { + "description": "Indicates if the IP address is in warmup.", + "type": "boolean" + } + }, + "required": [ + "ip", + "pools", + "start_date", + "warmup" + ], + "type": "object" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "resource not found" + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "description": "The error returned.", + "items": { + "properties": { + "field": { + "type": "null" + }, + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add an IP address to a pool", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_ips-pools-poolname-ips", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/pools/{pool_name}/ips/{ip}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove an IP address from an IP pool.**\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": "DELETE_ips-pools-pool_name-ips-ip", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove an IP address from a pool.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "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, + "type": "string" + }, + { + "description": "The IP address that you are removing.", + "in": "path", + "name": "ip", + "required": true, + "type": "string" + } + ] + }, + "/ips/warmup": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all of your IP addresses that are currently warming up.**\n\nSendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.\n\nFor more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).", + "operationId": "GET_ips-warmup", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "ip": "0.0.0.0", + "start_date": 1409616000 + } + ] + }, + "schema": { + "$ref": "#/definitions/ip_warmup_response" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IPs currently in warmup", + "tags": [ + "IP Warmup" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_ips-warmup", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to enter an IP address into warmup mode.**\n\nSendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.\n\nFor more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).", + "operationId": "POST_ips-warmup", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "ip": "0.0.0.0" + }, + "properties": { + "ip": { + "description": "The IP address that you want to begin warming up.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "ip": "0.0.0.0", + "start_date": 1409616000 + } + ] + }, + "schema": { + "$ref": "#/definitions/ip_warmup_response" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "resource not found" + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "description": "The errors that were encountered.", + "items": { + "properties": { + "field": { + "type": "null" + }, + "message": { + "description": "A message explaining why the IP couldn't entered into warmup mode.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add an IP to warmup", + "tags": [ + "IP Warmup" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_ips-warmup", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/ips/warmup/{ip_address}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove an IP address from warmup mode.**\n\nSendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.\n\nFor more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).", + "operationId": "DELETE_ips-warmup-ip_address", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "resource not found" + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "description": "The errors that were encountered.", + "items": { + "properties": { + "field": { + "type": "null" + }, + "message": { + "description": "A message explaining why the IP couldn't be removed from warmup.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove an IP from warmup", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_ips-warmup-ipaddress", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the warmup status for a specific IP address.**\n\nSendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.\n\nFor more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).", + "operationId": "GET_ips-warmup-ip_address", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ip_warmup_response" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "resource not found" + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "description": "The errors that were encountered.", + "items": { + "properties": { + "field": { + "type": "null" + }, + "message": { + "description": "A message explaining why the warmup status could not be retrieved.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve warmup status for a specific IP address", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_ips-warmup-ipaddress", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The IP address that you want to remove from warmup mode.", + "in": "path", + "name": "ip_address", + "required": true, + "type": "string" + } + ] + }, + "/ips/{ip_address}": { + "get": { + "consumes": [ + "application/json" + ], + "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", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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.", + "type": [ + "integer", + "null" + ] + }, + "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 has been whitelabeled.", + "type": "boolean" + } + }, + "required": [ + "ip", + "subusers", + "rdns", + "pools", + "warmup", + "start_date", + "whitelabeled" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IP pools an IP address belongs to", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "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, + "type": "string" + } + ] + }, + "/mail/batch": { + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to generate a new batch ID. This batch ID can be associated with scheduled sends via the mail/send endpoint.**\n\nIf you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at anytime up to 10 minutes before the schedule date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint. \n\nMore Information:\n\n* [Scheduling Parameters > Batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html)", + "operationId": "POST_mail-batch", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "batch_id": "YOUR_BATCH_ID" + } + }, + "schema": { + "$ref": "#/definitions/mail_batch_id" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a batch ID", + "tags": [ + "Cancel Scheduled Sends" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_mail-batch", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail/batch/{batch_id}": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to validate a batch ID.**\n\nIf you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at anytime up to 10 minutes before the schedule date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint. \n\nMore Information:\n\n* [Scheduling Parameters > Batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html)", + "operationId": "GET_mail-batch-batch_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi" + } + }, + "schema": { + "$ref": "#/definitions/mail_batch_id" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "invalid batch id" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "Unexpected error in API call. See HTTP response body for details.", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate batch ID", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mail-batch-batchid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "batch_id", + "required": true, + "type": "string" + } + ] + }, + "/mail/send/beta": { + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "This endpoint allows you to send email over SendGrid\u2019s v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, please see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).\n\n* Top level parameters are referred to as \"global\".\n* Individual fields within the personalizations array will override any other global, or \u201cmessage level\u201d, parameters that are defined outside of personalizations.\n\nFor an overview of the v3 Mail Send endpoint, please visit our [v3 API Reference](https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html)\n\nFor more detailed information about how to use the v3 Mail Send endpoint, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/index.html).", + "operationId": "POST_mail-send-beta", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "asm": { + "group_id": 1, + "groups_to_display": [ + 1, + 2, + 3 + ] + }, + "attachments": [ + { + "content": "[BASE64 encoded content block here]", + "content_id": "ii_139db99fdb5c3704", + "disposition": "inline", + "filename": "file1.jpg", + "name": "file1", + "type": "jpg" + } + ], + "batch_id": "[YOUR BATCH ID GOES HERE]", + "categories": [ + "category1", + "category2" + ], + "content": [ + { + "type": "text/html", + "value": "

Hello, world!

" + } + ], + "custom_args": { + "New Argument 1": "New Value 1", + "activationAttempt": "1", + "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]" + }, + "from": { + "email": "sam.smith@example.com", + "name": "Sam Smith" + }, + "headers": {}, + "ip_pool_name": "[YOUR POOL NAME GOES HERE]", + "mail_settings": { + "bcc": { + "email": "ben.doe@example.com", + "enable": true + }, + "bypass_list_management": { + "enable": true + }, + "footer": { + "enable": true, + "html": "

Thanks
The SendGrid Team

", + "text": "Thanks,/n The SendGrid Team" + }, + "sandbox_mode": { + "enable": false + }, + "spam_check": { + "enable": true, + "post_to_url": "http://example.com/compliance", + "threshold": 3 + } + }, + "personalizations": [ + { + "bcc": [ + { + "email": "sam.doe@example.com", + "name": "Sam Doe" + } + ], + "cc": [ + { + "email": "jane.doe@example.com", + "name": "Jane Doe" + } + ], + "custom_args": { + "New Argument 1": "New Value 1", + "activationAttempt": "1", + "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]" + }, + "headers": { + "X-Accept-Language": "en", + "X-Mailer": "MyApp" + }, + "send_at": 1409348513, + "subject": "Hello, World!", + "substitutions": { + "sub": { + "%name%": [ + "John", + "Jane", + "Sam" + ] + } + }, + "to": [ + { + "email": "john.doe@example.com", + "name": "John Doe" + } + ] + } + ], + "reply_to": { + "email": "sam.smith@example.com", + "name": "Sam Smith" + }, + "sections": { + "section": { + ":sectionName1": "section 1 text", + ":sectionName2": "section 2 text" + } + }, + "send_at": 1409348513, + "subject": "Hello, World!", + "template_id": "[YOUR TEMPLATE ID GOES HERE]", + "tracking_settings": { + "click_tracking": { + "enable": true, + "enable_text": true + }, + "ganalytics": { + "enable": true, + "utm_campaign": "[NAME OF YOUR REFERRER SOURCE]", + "utm_content": "[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]", + "utm_medium": "[NAME OF YOUR MARKETING MEDIUM e.g. email]", + "utm_name": "[NAME OF YOUR CAMPAIGN]", + "utm_term": "[IDENTIFY PAID KEYWORDS HERE]" + }, + "open_tracking": { + "enable": true, + "substitution_tag": "%opentrack" + }, + "subscription_tracking": { + "enable": true, + "html": "If you would like to unsubscribe and stop receiving these emails <% clickhere %>.", + "substitution_tag": "<%click here%>", + "text": "If you would like to unsubscribe and stop receiveing these emails <% click here %>." + } + } + }, + "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 in which 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 content id for the attachment. This is used when the disposition is set to \u201cinline\u201d 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 content-disposition of the attachment specifying how you would like the attachment to be displayed. For example, \u201cinline\u201d results in the attached file being displayed automatically within the message while \u201cattachment\u201d results in the attached file requiring some action to be taken before it is displayed (e.g. opening or downloading the file).", + "enum": [ + "inline", + "attachment" + ], + "type": "string" + }, + "filename": { + "description": "The filename of the attachment.", + "type": "string" + }, + "type": { + "description": "The mime type of the content you are attaching. For example, \u201ctext/plain\u201d or \u201ctext/html\u201d.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "content", + "filename" + ], + "type": "object" + }, + "type": "array" + }, + "batch_id": { + "description": "This ID represents 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, and also enables you to cancel or pause the delivery of that batch. For more information, see https://sendgrid.com/docs/API_Reference/Web_API_v3/cancel_schedule_send.html ", + "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 in which you may specify the content of your email. You can include multiple mime types of content, but you must specify at least one mime type. To include more than one mime type, simply 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. For example, \u201ctext/plain\u201d or \u201ctext/html\u201d.", + "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. 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 personalizations[x].custom_args if that parameter has been defined. Total custom args size may not exceed 10,000 bytes.", + "type": "object" + }, + "from": { + "description": "An email object containing the email address and name of the sender.", + "properties": { + "": { + "$ref": "#/definitions/email_object" + } + }, + "type": "object" + }, + "headers": { + "description": "An object containing key/value pairs of header names and the value to substitute for them. You must ensure these are properly encoded if they contain unicode characters. Must not 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": { + "bcc": { + "description": "This allows you to have a blind carbon copy automatically sent to the specified email address for every email that is sent.", + "properties": { + "email": { + "description": "The email address that you would like to receive the BCC.", + "format": "email", + "type": "string" + }, + "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.", + "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": "This 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" + }, + "spam_check": { + "description": "This allows you to test the content of your email for spam.", + "properties": { + "enable": { + "description": "Indicates if this setting is enabled.", + "type": "boolean" + }, + "post_to_url": { + "description": "An Inbound Parse URL that you would like a copy of your email along with the spam report to be sent to.", + "type": "string" + }, + "threshold": { + "description": "The threshold used to determine if your content qualifies as spam on a scale from 1 to 10, with 10 being most strict, or most likely to be considered as spam.", + "maximum": 10, + "minimum": 1, + "type": "integer" + } + }, + "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.", + "items": { + "properties": { + "bcc": { + "description": "An array of recipients who will receive a blind carbon copy of your email. Each object within this array may contain the name, but must always contain the email, of a recipient.", + "items": { + "properties": { + "": { + "$ref": "#/definitions/email_object" + } + }, + "type": "object" + }, + "maxItems": 100, + "type": "array" + }, + "cc": { + "description": "An array of recipients who will receive a copy of your email. Each object within this array may contain the name, but must always contain the email, of a recipient.", + "items": { + "properties": { + "": { + "$ref": "#/definitions/email_object" + } + }, + "type": "object" + }, + "maxItems": 100, + "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. May not exceed 10,000 bytes.", + "type": "object" + }, + "headers": { + "description": "A collection of JSON key/value pairs allowing you to specify specific 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 you want your email to be delivered. Scheduling more than 72 hours in advance is forbidden.", + "type": "integer" + }, + "subject": { + "description": "The subject of your email. Char length requirements, according to the RFC - http://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit#answer-1592310", + "minLength": 1, + "type": "string" + }, + "substitutions": { + "description": "A collection of key/value pairs following the pattern \"substitution_tag\":\"value to substitute\". All are assumed to 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.", + "maxProperties": 10000, + "type": "object" + }, + "to": { + "description": "An array of recipients. Each object within this array may contain the name, but must always contain the email, of a recipient.", + "items": { + "properties": { + "": { + "$ref": "#/definitions/email_object" + } + }, + "type": "object" + }, + "maxItems": 100, + "minItems": 1, + "type": "array" + } + }, + "required": [ + "to" + ], + "type": "object" + }, + "maxItems": 100, + "type": "array", + "uniqueItems": false + }, + "reply_to": { + "description": "An email object containing the email address and name of the individual who should receive responses to your email.", + "properties": { + "": { + "$ref": "#/definitions/email_object" + } + }, + "type": "object" + }, + "sections": { + "description": "An object of key/value pairs that define block sections of code to be used as substitutions.", + "type": "object" + }, + "send_at": { + "description": "A unix timestamp allowing you to specify when you want your email to be delivered. This may be overridden by the personalizations[x].send_at parameter. Scheduling more ta 72 hours in advance is forbidden.", + "type": "integer" + }, + "subject": { + "description": "The global, or \u201cmessage level\u201d, subject of your email. This may be overridden by personalizations[x].subject.", + "minLength": 1, + "type": "string" + }, + "template_id": { + "description": "The id of a template that you would like to use. If you use a template that contains a subject and content (either text or html), you do not need to specify those at the personalizations nor 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 whether 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.\t", + "type": "string" + }, + "utm_content": { + "description": "Used to differentiate your campaign from advertisements.\t", + "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.\t", + "type": "string" + } + }, + "type": "object" + }, + "open_tracking": { + "description": "Allows you to track whether the email was opened or not, but including a single pixel image in the body of the content. When the pixel is loaded, we 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\u2019s 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", + "reply_to", + "subject", + "content" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "202": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + }, + "400": { + "description": "", + "schema": { + "$ref": "#/definitions/errors" + } + }, + "401": { + "description": "", + "schema": { + "$ref": "#/definitions/errors" + } + }, + "413": { + "description": "", + "schema": { + "$ref": "#/definitions/errors" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "v3 Mail Send Beta", + "tags": [ + "Mail Send" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_mail-send-beta", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all mail settings.**\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings", + "parameters": [ + { + "description": "The number of settings to return.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "Where in the list of results to begin displaying settings.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "result": [ + { + "description": "Address / domains that should never have email suppressed.", + "enabled": false, + "name": "address_whitelist", + "title": "Address Whitelist" + }, + { + "description": "Automatically BCC an address for every e-mail sent.", + "enabled": false, + "name": "bcc", + "title": "BCC" + }, + { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/mail_settings/address_whitelist": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current email address whitelist settings.**\n\nThe address whitelist setting whitelists a specified email address or domain for which mail should never be suppressed. For example, you own the domain \u201cexample.com,\u201d and one or more of your recipients use email@example.com addresses, by placing example.com in the address whitelist setting, all bounces, blocks, and unsubscribes logged for that domain will be ignored and sent as if under normal sending conditions.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-address_whitelist", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false, + "list": [ + "example.com" + ] + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_address_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve address whitelist mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-addresswhitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current email address whitelist settings.**\n\nThe address whitelist setting whitelists a specified email address or domain for which mail should never be suppressed. For example, you own the domain \u201cexample.com,\u201d and one or more of your recipients use email@example.com addresses, by placing example.com in the address whitelist setting, all bounces, blocks, and unsubscribes logged for that domain will be ignored and sent as if under normal sending conditions.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-address_whitelist", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true, + "list": [ + "email1@example.com" + ] + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_address_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update address whitelist mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-addresswhitelist", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/bcc": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current BCC mail settings.**\n\nWhen the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-bcc", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "example@example.com", + "enabled": false + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_bcc" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all BCC mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-bcc", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current BCC mail settings.**\n\nWhen the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-bcc", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/mail_settings_patch", + "example": { + "email": "email@example.com", + "enabled": false + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "example@example.com", + "enabled": false + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_patch" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update BCC mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-bcc", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/bounce_purge": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current bounce purge settings.**\n\nThis setting allows you to set a schedule for SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-bounce_purge", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false, + "hard_bounces": null, + "soft_bounces": 1234 + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_bounce_purge" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve bounce purge mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-bouncepurge", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current bounce purge settings.**\n\nThis setting allows you to set a schedule for SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-bounce_purge", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/mail_settings_bounce_purge", + "example": { + "enabled": true, + "hard_bounces": 5, + "soft_bounces": 5 + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false, + "hard_bounces": null, + "soft_bounces": null + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_bounce_purge" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update bounce purge mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-bouncepurge", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/footer": { + "get": { + "consumes": [ + "application/json" + ], + "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 the text and HTML bodies. Use the embedded HTML editor and plain text entry fields to create the content of the footers to be inserted into your emails.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-footer", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true, + "html_content": "Example HTML content", + "plain_content": "Example plain content" + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_footer" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve footer mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-footer", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "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 the text and HTML bodies. Use the embedded HTML editor and plain text entry fields to create the content of the footers to be inserted into your emails.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-footer", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/mail_settings_footer", + "example": { + "enabled": true, + "html_content": "...", + "plain_content": "..." + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true, + "html_content": "Example HTML content", + "plain_content": "Example plain content" + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_footer" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update footer mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-footer", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/forward_bounce": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current bounce forwarding mail settings.**\n\nActivating this setting allows you to specify an email address to which bounce reports are forwarded.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-forward_bounce", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": null, + "enabled": false + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_forward_bounce" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve forward bounce mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-forwardbounce", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current bounce forwarding mail settings.**\n\nActivating this setting allows you to specify an email address to which bounce reports are forwarded.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-forward_bounce", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/mail_settings_forward_bounce", + "example": { + "email": "example@example.com", + "enabled": true + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "", + "enabled": true + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_forward_bounce" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update forward bounce mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-forwardbounce", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/forward_spam": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current Forward Spam mail settings.**\n\nEnabling the forward spam setting allows you to specify an email address to which spam reports will be forwarded.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-forward_spam", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "", + "enabled": true + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_forward_spam" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve forward spam mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-forwardspam", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current Forward Spam mail settings.**\n\nEnabling the forward spam setting allows you to specify an email address to which spam reports will be forwarded.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-forward_spam", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/mail_settings_forward_spam", + "example": { + "email": "", + "enabled": false + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "", + "enabled": false + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_forward_spam" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update forward spam mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-forwardspam", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/plain_content": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current Plain Content mail settings.**\n\nThe plain content setting will automatically convert any plain text emails that you send to HTML before sending.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-plain_content", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false + } + }, + "schema": { + "properties": { + "enabled": { + "description": "Indicates if the Plain Content mail setting is enabled.", + "type": "boolean" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve plain content mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-plaincontent", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current Plain Content mail settings.**\n\nThe plain content setting will automatically convert any plain text emails that you send to HTML before sending.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-plain_content", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "enabled": false + }, + "properties": { + "enabled": { + "description": "The new setting you would like to use for your Plain Content mail setting.", + "type": "boolean" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false + } + }, + "schema": { + "properties": { + "enabled": { + "description": "Indicates if your Plain Content mail setting is enabled.", + "type": "boolean" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update plain content mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-plaincontent", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/spam_check": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current Spam Checker mail settings.**\n\nThe spam checker filter notifies you when emails are detected that exceed a predefined spam threshold.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-spam_check", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false, + "max_score": 6, + "url": "http://example.com" + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_spam_check" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve spam check mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-spamcheck", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current spam checker mail settings.**\n\nThe spam checker filter notifies you when emails are detected that exceed a predefined spam threshold.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-spam_check", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "enabled": true, + "max_score": 5, + "url": "url" + }, + "properties": { + "enabled": { + "description": "Indicates if you want the spam check mail setting to be enabled or not.", + "type": "boolean" + }, + "max_score": { + "default": 5, + "description": "The new max score, or spam threshold that you would like to set for the spam checker.", + "maximum": 10, + "minimum": 1, + "type": "integer" + }, + "url": { + "description": "The Inbound Parse URL where you would like your spam reports to be sent to.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false, + "max_score": 6, + "url": "http://example.com" + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_spam_check" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update spam check mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-spamcheck", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mail_settings/template": { + "get": { + "consumes": [ + "application/json" + ], + "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 [transactional templates](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). \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.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "GET_mail_settings-template", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false, + "html_content": "

<% body %>Example

\n" + } + }, + "schema": { + "$ref": "#/definitions/mail_settings_template" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve legacy template mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailsettings-template", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "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 [transactional templates](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). \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.\n\nMail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid\u2019s [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).", + "operationId": "PATCH_mail_settings-template", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": false, + "html_content": "

<% body %>Example

\n" + } + }, + "schema": { + "properties": { + "enabled": { + "type": "boolean" + }, + "html_content": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update template mail settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_mailsettings-template", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/mailbox_providers/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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 [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).", + "operationId": "GET_mailbox_providers-stats", + "parameters": [ + { + "description": "The number of results to include on each page.", + "in": "query", + "name": "limit", + "required": false, + "type": "integer" + }, + { + "description": "The number of results to exclude.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + }, + { + "description": "How to group the stats. Must be either \"day\", \"wee\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + }, + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "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, + "type": "string" + }, + { + "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", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "date": "2015-10-11", + "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-12", + "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-13", + "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-14", + "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-15", + "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-16", + "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-17", + "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-18", + "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-19", + "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-20", + "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-21", + "stats": [ + { + "metrics": { + "blocks": 0, + "bounces": 0, + "clicks": 0, + "deferred": 0, + "delivered": 1, + "drops": 0, + "opens": 1, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "spam_reports": 0, + "unique_clicks": 0, + "unique_opens": 0 + }, + "name": "Gmail", + "type": "mailbox_provider" + } + ] + } + ] + }, + "schema": { + "items": { + "$ref": "#/definitions/advanced_stats_mailbox_provider" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics by mailbox provider.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_mailboxproviders-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/partner_settings": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all partner settings that you can enable.**\n\nOur partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).", + "operationId": "GET_partner_settings", + "parameters": [ + { + "description": "The number of settings to return per page.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "The paging offset.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "result": [ + { + "description": "A description of a partner.", + "enabled": true, + "name": "partner_name", + "title": "Partner title" + } + ] + } + }, + "schema": { + "properties": { + "result": { + "items": { + "properties": { + "description": { + "description": "A description of this partner setting.", + "type": "string" + }, + "enabled": { + "description": "Indicates if this partner setting has been enabled.", + "type": "boolean" + }, + "name": { + "description": "The name of the partner setting.", + "type": "string" + }, + "title": { + "description": "The title of the partner.", + "type": "string" + } + }, + "required": [ + "title", + "enabled", + "name", + "description" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Returns a list of all partner settings.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_partnersettings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/partner_settings/new_relic": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current New Relic partner settings.**\n\nOur partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).\n\nBy integrating with New Relic, you can send your SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).", + "operationId": "GET_partner_settings-new_relic", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enable_subuser_statistics": false, + "enabled": true, + "license_key": "" + } + }, + "schema": { + "$ref": "#/definitions/partner_settings_new_relic" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Returns all New Relic partner settings.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_partnersettings-newrelic", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update or change your New Relic partner settings.**\n\nOur partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).\n\nBy integrating with New Relic, you can send your SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).", + "operationId": "PATCH_partner_settings-new_relic", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "enable_subuser_statistics": true, + "enabled": true, + "license_key": "" + }, + "properties": { + "enable_subuser_statistics": { + "description": "Indicates if your subuser statistics will be sent to your New Relic Dashboard.", + "type": "boolean" + }, + "enabled": { + "description": "Indicates if this partner setting is enabled.", + "type": "boolean" + }, + "license_key": { + "description": "The license key for your New Relic account.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enable_subuser_statistics": true, + "enabled": true, + "license_key": "" + } + }, + "schema": { + "$ref": "#/definitions/partner_settings_new_relic" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Updates New Relic partner settings.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_partnersettings-newrelic", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/scopes": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint returns a list of all scopes that this user has access to.**\n\nAPI Keys can be used to authenticate the use of [SendGrid\u2019s v3 Web API](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html), or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). 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 permissios, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/api_keys.html#-API-Key-Permissions) or [Classroom](https://sendgrid.com/docs/Classroom/Basics/API/api_key_permissions.html). ", + "operationId": "GET_scopes", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "scopes": [ + "mail.send", + "alerts.create", + "alerts.read" + ] + } + }, + "schema": { + "properties": { + "scopes": { + "description": "The list of scopes for which this user has access.", + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "scopes" + ], + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "description": "This 401 response indicates that the user making the call doesn't have the authorization to view the list of scopes.", + "items": { + "properties": { + "field": { + "description": "This empty field is returned instead of the list of scopes if the user making the call doesn't have the authorization required.", + "type": "null" + }, + "message": { + "description": "Explains why the scopes cannot be returned.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a list of scopes for which this user has access.", + "tags": [ + "API Key Permissions" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_scopes", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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": [ + { + "description": "The number of results to return.", + "in": "query", + "name": "limit", + "required": false, + "type": "integer" + }, + { + "description": "The point in the list to begin retrieving results.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + }, + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "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, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "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" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "date", + "stats" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve global email statistics", + "tags": [ + "Stats - Global Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/subusers": { + "get": { + "consumes": [ + "application/json" + ], + "description": "This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.\n\nFor more information about Subusers:\n\n* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)\n* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)", + "operationId": "GET_subusers", + "parameters": [ + { + "description": "The username of this subuser.", + "in": "query", + "name": "username", + "type": "string" + }, + { + "description": "The number of results you would like to get in each request.", + "in": "query", + "name": "limit", + "type": "number" + }, + { + "description": "The number of subusers to skip.", + "in": "query", + "name": "offset", + "type": "number" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": "#/definitions/subuser" + }, + "type": "array" + } + }, + "401": { + "description": "Unexpected error in API call. See HTTP response body for details.", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "List all Subusers", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_subusers", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.\n\nFor more information about Subusers:\n\n* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)\n* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)", + "operationId": "POST_subusers", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "authorization_token": "", + "credit_allocation": { + "type": "unlimited" + }, + "email": "example@example.com", + "signup_session_token": "", + "user_id": 1234, + "username": "example_subuser" + } + }, + "schema": { + "$ref": "#/definitions/subuser_post" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "message": "username exists" + }, + { + "message": "unable to validate IPs at this time" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "403": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "message": "you dont have permission to access this resource" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "500": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "message": "unable to validate IPs at this time" + } + ] + } + }, + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create Subuser", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_subusers", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/subusers/reputations": { + "get": { + "consumes": [ + "application/json" + ], + "description": "Subuser 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 effect your sender rating.\n\nThis endpoint allows you to request the reputations for your subusers.", + "operationId": "GET_subusers-reputations", + "parameters": [ + { + "in": "query", + "name": "usernames", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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" + } + }, + "401": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Subuser Reputations", + "tags": [ + "Subusers API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_subusers-reputations", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/subusers/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nWhile you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.\n\nFor more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).", + "operationId": "GET_subusers-stats", + "parameters": [ + { + "description": "Limits the number of results returned per page.", + "in": "query", + "name": "limit", + "required": false, + "type": "integer" + }, + { + "description": "The point in the list to begin retrieving results from.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + }, + { + "description": "How to group the statistics. Must be either \"day\", \"week\", or \"month\".", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "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, + "type": "string" + }, + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "type": "string" + }, + { + "description": "The end date of the statistics to retrieve. Defaults to today.", + "in": "query", + "name": "end_date", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "$ref": "#/definitions/stats" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve email statistics for your subusers.", + "tags": [ + "Stats - Subuser Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_subusers-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/subusers/stats/monthly": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.**\n\nWhile you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.\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`.\n\nFor more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).", + "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, + "type": "string" + }, + { + "description": "A substring search of your subusers.", + "in": "query", + "name": "subuser", + "required": false, + "type": "string" + }, + { + "default": "delivered", + "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, + "type": "string" + }, + { + "default": "desc", + "description": "The direction you want to sort.", + "enum": [ + "desc", + "asc" + ], + "in": "query", + "name": "sort_by_direction", + "required": false, + "type": "string" + }, + { + "default": 5, + "description": "Optional field to limit the number of results returned.", + "in": "query", + "name": "limit", + "required": false, + "type": "integer" + }, + { + "default": 0, + "description": "Optional beginning point in the list to retrieve from.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/subuser_stats" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve monthly stats for all subusers", + "tags": [ + "Stats - Subuser Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_subusers-stats-monthly", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/subusers/stats/sums": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.**\n\n\nWhile you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.\n\nFor more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).", + "operationId": "GET_subusers-stats-sums", + "parameters": [ + { + "default": "desc", + "description": "The direction you want to sort. ", + "enum": [ + "desc", + "asc" + ], + "in": "query", + "name": "sort_by_direction", + "required": false, + "type": "string" + }, + { + "description": "The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "start_date", + "required": true, + "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, + "type": "string" + }, + { + "default": 5, + "description": "Limits the number of results returned per page.", + "in": "query", + "name": "limit", + "required": false, + "type": "integer" + }, + { + "default": 0, + "description": "The point in the list to begin retrieving results from.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + }, + { + "description": "How to group the statistics. Defaults to today. Must follow format YYYY-MM-DD.", + "in": "query", + "name": "aggregated_by", + "required": false, + "type": "string" + }, + { + "default": "delivered", + "description": "The metric that you want to sort by. Must be a single metric.", + "in": "query", + "name": "sort_by_metric", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "date": "2015-10-11", + "stats": [] + } + }, + "schema": { + "$ref": "#/definitions/category_stats" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": " Retrieve the totals for each email statistic metric for all subusers.", + "tags": [ + "Stats - Subuser Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_subusers-stats-sums", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/subusers/{subuser_name}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved.\n\nFor more information about Subusers:\n\n* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)\n* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)", + "operationId": "DELETE_subusers-subuser_name", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a subuser", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_subusers-subusername", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "subuser_name", + "required": true, + "type": "string" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "This endpoint allows you to enable or disable a subuser.\n\nFor more information about Subusers:\n\n* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)\n* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)", + "operationId": "PATCH_subusers-subuser_name", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "disabled": false + }, + "properties": { + "disabled": { + "description": "Whether or not this subuser is disabled. True means disabled, False means enabled.", + "type": "boolean" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "message": "invalid username" + }, + { + "message": "no fields provided" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "500": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "message": "unable to enable user" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Enable/disable a subuser", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_subusers-subusername", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/subusers/{subuser_name}/ips": { + "parameters": [ + { + "in": "path", + "name": "subuser_name", + "required": true, + "type": "string" + } + ], + "put": { + "consumes": [ + "application/json" + ], + "description": "Each 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 their own, or multiple, IP addresses as well. \n\nMore information:\n\n* [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html)\n* [IPs can be whitelabeled](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/ips.html)", + "operationId": "PUT_subusers-subuser_name-ips", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": [ + "127.0.0.1" + ], + "items": { + "format": "ipv4", + "type": "string" + }, + "type": "array" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "ips": [ + "127.0.0.1" + ] + } + }, + "schema": { + "properties": { + "ips": { + "items": { + "format": "ipv4", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "summary": "Update IPs assigned to a subuser", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PUT_subusers-subusername-ips", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/subusers/{subuser_name}/monitor": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.", + "operationId": "DELETE_subusers-subuser_name-monitor", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "No monitor settings for this user" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "summary": "Delete monitor settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_subusers-subusername-monitor", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.", + "operationId": "GET_subusers-subuser_name-monitor", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "example@example.com", + "frequency": 500 + } + }, + "schema": { + "$ref": "#/definitions/monitor" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "No monitor settings for this user" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve monitor settings for a subuser", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_subusers-subusername-monitor", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The name of the subuser for which to retrieve monitor settings.", + "in": "path", + "name": "subuser_name", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.", + "operationId": "POST_subusers-subuser_name-monitor", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/monitor", + "example": { + "email": "example@example.com", + "frequency": 50000 + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "example@example.com", + "frequency": 50000 + } + }, + "schema": { + "$ref": "#/definitions/monitor" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "User already has a monitor" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create monitor settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_subusers-subusername-monitor", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "put": { + "consumes": [ + "application/json" + ], + "description": "Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.", + "operationId": "PUT_subusers-subuser_name-monitor", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/monitor", + "example": { + "email": "example@example.com", + "frequency": 500 + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "example@example.com", + "frequency": 500 + } + }, + "schema": { + "$ref": "#/definitions/monitor" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": "email", + "message": "Email is required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Monitor Settings for a subuser", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PUT_subusers-subusername-monitor", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/subusers/{subuser_name}/stats/monthly": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrive the monthly email statistics for a specific subuser.**\n\nWhile you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.\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`.\n\nFor more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).", + "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, + "type": "string" + }, + { + "default": "delivered", + "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, + "type": "string" + }, + { + "default": "desc", + "description": "The direction you want to sort.", + "enum": [ + "desc", + "asc" + ], + "in": "query", + "name": "sort_by_direction", + "required": false, + "type": "string" + }, + { + "default": 5, + "description": "Optional field to limit the number of results returned.", + "in": "query", + "name": "limit", + "required": false, + "type": "number" + }, + { + "default": 0, + "description": "Optional beginning point in the list to retrieve from.", + "in": "query", + "name": "offset", + "required": false, + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/subuser_stats" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve the monthly email statistics for a single subuser", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_subusers-subusername-stats-monthly", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "subuser_name", + "required": true, + "type": "string" + } + ] + }, + "/suppression/blocks": { + "delete": { + "consumes": [ + "application/json" + ], + "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 some blocked emails by specifying the email addresses in an array in the request body.\n\n[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).", + "operationId": "DELETE_suppression-blocks", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete blocks", + "tags": [ + "Blocks API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_suppression-blocks", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.**\n\n[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).", + "operationId": "GET_suppression-blocks", + "parameters": [ + { + "description": "Refers start of the time range in unix timestamp when a blocked email was created (inclusive).", + "in": "query", + "name": "start_time", + "type": "integer" + }, + { + "description": "Refers end of the time range in unix timestamp when a blocked email was created (inclusive).", + "in": "query", + "name": "end_time", + "type": "integer" + }, + { + "description": "Limit the number of results to be displayed per page.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "The point in the list to begin displaying results.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "created": 1443651154, + "email": "user1@example.com", + "reason": "error dialing remote address: dial tcp 10.57.152.165:25: no route to host", + "status": "4.0.0" + } + ] + }, + "schema": { + "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.", + "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" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all blocks", + "tags": [ + "Blocks API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-blocks", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/suppression/blocks/{email}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a specific email address from your blocks list.**\n\n[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).", + "operationId": "DELETE_suppression-blocks-email", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "summary": "Delete a specific block", + "tags": [ + "Blocks API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_suppression-blocks-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a specific email address from your blocks list.**\n\n[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).", + "operationId": "GET_suppression-blocks-email", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "created": 1443651154, + "email": "user1@example.com", + "reason": "error dialing remote address: dial tcp 10.57.152.165:25: no route to host", + "status": "4.0.0" + } + ] + }, + "schema": { + "items": { + "properties": { + "created": { + "description": "A Unix timestamp indicating when the block was created.", + "type": "integer" + }, + "email": { + "description": "The email address of the recipient that was blocked.", + "type": "string" + }, + "reason": { + "description": "The reason why the email was blocked.", + "type": "string" + }, + "status": { + "description": "The status of the block.", + "type": "string" + } + }, + "required": [ + "created", + "email", + "reason" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific block", + "tags": [ + "Blocks API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-blocks-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The blocked email address that you want to delete.", + "in": "path", + "name": "email", + "required": true, + "type": "string" + } + ] + }, + "/suppression/bounces": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.**\n\nBounces are messages that are returned to the server that sent it.\n\nFor more information see: \n\n* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information\n* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)\n* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)\n\nNote: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes.", + "operationId": "DELETE_suppression-bounces", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "delete_all": true, + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete bounces", + "tags": [ + "Bounces API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_suppression-bounces", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all of your bounces.**\n\nBounces are messages that are returned to the server that sent it. \n\nFor more information see: \n\n* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information\n* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)", + "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", + "type": "number" + }, + { + "description": "Refers end of the time range in unix timestamp when a bounce was created (inclusive).", + "in": "query", + "name": "end_time", + "type": "number" + }, + { + "description": "", + "in": "header", + "name": "Allow", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "properties": { + "created": { + "type": "number" + }, + "email": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all bounces", + "tags": [ + "Bounces API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-bounces", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/suppression/bounces/{email}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove an email address from your bounce list.**\n\nBounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email addresses from your bounce list. \n\nFor more information see: \n\n* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information\n* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)\n* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)", + "operationId": "DELETE_suppression-bounces-email", + "parameters": [ + { + "description": "The email address you would like to remove from the bounce list.", + "format": "email", + "in": "query", + "name": "email_address", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a bounce", + "tags": [ + "Bounces API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_suppression-bounces-email", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a specific bounce for a given email address.**\n\nBounces are messages that are returned to the server that sent it.\n\nFor more information see: \n\n* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information\n* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)\n* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)", + "operationId": "GET_suppression-bounces-email", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": { + "properties": { + "created": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Bounce", + "tags": [ + "Bounces API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-bounces-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "email", + "required": true, + "type": "string" + } + ] + }, + "/suppression/invalid_emails": { + "delete": { + "consumes": [ + "application/json" + ], + "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.\n\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\u2019s mail server.\n\nExamples include addresses without the \u201c@\u201d 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 [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).", + "operationId": "DELETE_suppression-invalid_emails", + "parameters": [ + { + "in": "body", + "name": "body", + "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": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + ], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete invalid emails", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_suppression-invalidemails", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all invalid email addresses.**\n\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\u2019s mail server.\n\nExamples include addresses without the \u201c@\u201d 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 [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).", + "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", + "type": "integer" + }, + { + "description": "Refers end of the time range in unix timestamp when an invalid email was created (inclusive).", + "in": "query", + "name": "end_time", + "type": "integer" + }, + { + "description": "Limit the number of results to be displayed per page.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "Paging offset. The point in the list to begin displaying results.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "created": 1449953655, + "email": "user1@example.com", + "reason": "Mail domain mentioned in email address is unknown" + }, + { + "created": 1449939373, + "email": "user1@example.com", + "reason": "Mail domain mentioned in email address is unknown" + } + ] + }, + "schema": { + "description": "The list of invalid email addresses.", + "items": { + "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.", + "type": "string" + }, + "reason": { + "description": "The reason that the email address was marked as invalid.", + "type": "string" + } + }, + "required": [ + "created", + "email", + "reason" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all invalid emails", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-invalidemails", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/suppression/invalid_emails/{email}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove a specific email address from the invalid email address list.**\n\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\u2019s mail server.\n\nExamples include addresses without the \u201c@\u201d 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 [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).", + "operationId": "DELETE_suppression-invalid_emails-email", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "summary": "Delete a specific invalid email", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_suppression-invalidemails-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a specific invalid email addresses.**\n\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\u2019s mail server.\n\nExamples include addresses without the \u201c@\u201d 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 [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).", + "operationId": "GET_suppression-invalid_emails-email", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "created": 1454433146, + "email": "test1@example.com", + "reason": "Mail domain mentioned in email address is unknown" + } + ] + }, + "schema": { + "items": { + "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.", + "type": "string" + }, + "reason": { + "description": "A reason explaining why the email address was marked as invalid.", + "type": "string" + } + }, + "required": [ + "created", + "email", + "reason" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "summary": "Retrieve a specific invalid email", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-invalidemails-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The invalid email address that you want to remove.", + "in": "path", + "name": "email", + "required": true, + "type": "string" + } + ] + }, + "/suppression/spam_report/{email}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a specific spam report.**\n\n[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).", + "operationId": "DELETE_suppression-spam_report-email", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a specific spam report", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_suppression-spamreport-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a specific spam report.**\n\n[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).", + "operationId": "GET_suppression-spam_report-email", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "created": 1454433146, + "email": "test1@example.com", + "ip": "10.89.32.5" + } + ] + }, + "schema": { + "items": { + "properties": { + "created": { + "description": "A Unix timestamp that indicates when the recipient marked your message as spam.", + "type": "integer" + }, + "email": { + "description": "The email address of the recipient that marked your message as spam.", + "type": "string" + }, + "ip": { + "description": "The IP address that the message was sent from.", + "type": "string" + } + }, + "required": [ + "created", + "email", + "ip" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific spam report", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-spamreport-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The email address for the spam report that you want to delete.", + "in": "path", + "name": "email", + "required": true, + "type": "string" + } + ] + }, + "/suppression/spam_reports": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete your spam reports.**\n\nThere are two options for deleting spam reports: \n\n1) You can delete all spam reports by setting \"delete_all\" to true in the request body. \n2) You can delete some spam reports by specifying the email addresses in an array in the request body.\n\n[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).", + "operationId": "DELETE_suppression-spam_reports", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete spam reports", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_suppression-spamreports", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all spam reports.**\n\n[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).", + "operationId": "GET_suppression-spam_reports", + "parameters": [ + { + "description": "Refers start of the time range in unix timestamp when a spam report was created (inclusive).", + "in": "query", + "name": "start_time", + "type": "integer" + }, + { + "description": "Refers end of the time range in unix timestamp when a spam report was created (inclusive).", + "in": "query", + "name": "end_time", + "type": "integer" + }, + { + "description": "Limit the number of results to be displayed per page.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "Paging offset. The point in the list to begin displaying results.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "created": 1443651141, + "email": "user1@example.com", + "ip": "10.63.202.100" + }, + { + "created": 1443651154, + "email": "user2@example.com", + "ip": "10.63.202.100" + } + ] + }, + "schema": { + "items": { + "properties": { + "created": { + "description": "A Unix timestamp indicating when the spam report was made.", + "type": "integer" + }, + "email": { + "description": "The email address of the recipient who marked your message as spam.", + "type": "string" + }, + "ip": { + "description": "The IP address that the message was sent on.", + "type": "string" + } + }, + "required": [ + "created", + "email", + "ip" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all spam reports", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-spamreports", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/suppression/unsubscribes": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all email address that are globally suppressed.**\n\nA 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 [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html).", + "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", + "type": "integer" + }, + { + "description": "Refers end of the time range in unix timestamp when an unsubscribe email was created (inclusive).", + "in": "query", + "name": "end_time", + "type": "integer" + }, + { + "description": "The number of results to display on each page.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "The point in the list of results to begin displaying global suppressions.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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.", + "type": "string" + } + }, + "required": [ + "created", + "email" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all global suppressions", + "tags": [ + "Suppression Management - Global Suppressions" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_suppression-unsubscribes", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/templates": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all transactional templates.**\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 templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).", + "operationId": "GET_templates", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "items": { + "$ref": "#/definitions/transactional_template" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all transactional templates.", + "tags": [ + "Transactional Templates" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_templates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create a transactional template.**\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 templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).", + "operationId": "POST_templates", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "example_name" + }, + "properties": { + "name": { + "description": "The name for the new transactional template.", + "maxLength": 100, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "id": "733ba07f-ead1-41fc-933a-3976baa23716", + "name": "example_name", + "versions": [] + } + }, + "schema": { + "$ref": "#/definitions/transactional_template" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a transactional template.", + "tags": [ + "Transactional Templates" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_templates", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates/{template_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a transactional template.**\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 templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).\n", + "operationId": "DELETE_templates-template_id", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a template.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_templates-templateid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a single transactional template.**\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 templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).\n", + "operationId": "GET_templates-template_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/transactional_template" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a single transactional template.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_templates-templateid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the transactional template you want to delete.", + "in": "path", + "name": "template_id", + "required": true, + "type": "string" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to edit a transactional template.**\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 templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).\n", + "operationId": "PATCH_templates-template_id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "name": "new_example_name" + }, + "properties": { + "name": { + "description": "The name of the transactional template.", + "maxLength": 100, + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "id": "733ba07f-ead1-41fc-933a-3976baa23716", + "name": "new_example_name", + "versions": [] + } + }, + "schema": { + "$ref": "#/definitions/transactional_template" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Edit a transactional template.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_templates-templateid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates/{template_id}/versions": { + "parameters": [ + { + "in": "path", + "name": "template_id", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create a new version of a template.**\n\nEach 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 [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).\n", + "operationId": "POST_templates-template_id-versions", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/transactional_template_version", + "example": { + "active": 1, + "html_content": "<%body%>", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "active": 1, + "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": "2014-03-19 18:56:33" + } + }, + "schema": { + "properties": { + "Transactional Template Version": { + "$ref": "#/definitions/transactional_template_version" + }, + "id": { + "description": "The id of the new transactional template version.", + "type": "string" + }, + "updated_at": { + "description": "The date and time that this transactional template version was updated.", + "type": "string" + } + }, + "required": [ + "id", + "updated_at" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a new transactional template version.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_templates-templateid-versions", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates/{template_id}/versions/{version_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete one of your transactional template versions.**\n\nEach 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 [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| template_id | string | The ID of the original template |\n| version_id | string | The ID of the template version |", + "operationId": "DELETE_templates-template_id-versions-version_id", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a transactional template version.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_templates-templateid-versions-versionid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a specific version of a template.**\n\nEach 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 [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| template_id | string | The ID of the original template |\n| version_id | string | The ID of the template version |", + "operationId": "GET_templates-template_id-versions-version_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "active": 1, + "html_content": "<%body%>", + "id": "5997fcf6-2b9f-484d-acd5-7e9a99f0dc1f", + "name": "version 1 name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "d51480ca-ca3f-465c-bc3e-ceb71d73c38d", + "updated_at": "2014-03-19 18:56:33" + } + }, + "schema": { + "properties": { + "Transactional Template Version": { + "$ref": "#/definitions/transactional_template_version" + }, + "id": { + "description": "The ID of the template version.", + "type": "string" + }, + "updated_at": { + "description": "The date and time that the template version was last updated.", + "type": "string" + } + }, + "required": [ + "id", + "updated_at" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a specific transactional template version.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_templates-templateid-versions-versionid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "template_id", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "version_id", + "required": true, + "type": "string" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to edit a version of one of your transactional templates.**\n\nEach 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 [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| template_id | string | The ID of the original template |\n| version_id | string | The ID of the template version |", + "operationId": "PATCH_templates-template_id-versions-version_id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "active": 1, + "html_content": "<%body%>", + "name": "updated_example_name", + "plain_content": "<%body%>", + "subject": "<%subject%>" + }, + "properties": { + "active": { + "description": "Indicates if the template version is active.", + "type": "integer" + }, + "html_content": { + "description": "The HTML content of the template version.", + "type": "string" + }, + "name": { + "description": "The name of the template version.", + "type": "string" + }, + "plain_content": { + "description": "The text/plain content of the template version.", + "type": "string" + }, + "subject": { + "description": "The subject of the template version.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "active": 1, + "html_content": "<%body%>", + "id": "5997fcf6-2b9f-484d-acd5-7e9a99f0dc1f", + "name": "version 1 name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "d51480ca-ca3f-465c-bc3e-ceb71d73c38d", + "updated_at": "2014-03-19 18:56:33" + } + }, + "schema": { + "properties": { + "Transactional Template Version": { + "$ref": "#/definitions/transactional_template_version" + }, + "id": { + "description": "The ID of the template version.", + "type": "string" + }, + "updated_at": { + "description": "The date and time that the template version was last updated.", + "type": "string" + } + }, + "required": [ + "id", + "updated_at" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Edit a transactional template version.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_templates-templateid-versions-versionid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/templates/{template_id}/versions/{version_id}/activate": { + "parameters": [ + { + "in": "path", + "name": "template_id", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "version_id", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to activate a version of one of your templates.**\n\nEach 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\n\nFor more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| template_id | string | The ID of the original template |\n| version_id | string | The ID of the template version |", + "operationId": "POST_templates-template_id-versions-version_id-activate", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "active": 1, + "html_content": "<%body%>", + "id": "8aefe0ee-f12b-4575-b5b7-c97e21cb36f3", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "e3a61852-1acb-4b32-a1bc-b44b3814ab78", + "updated_at": "2014-06-12 11:33:00" + } + }, + "schema": { + "properties": { + "Transactional Template Version": { + "$ref": "#/definitions/transactional_template_version" + }, + "id": { + "description": "The ID of the template version.", + "type": "string" + }, + "updated_at": { + "description": "The date and time that the version was last updated.", + "type": "string" + } + }, + "required": [ + "id", + "updated_at" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Activate a transactional template version.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_templates-templateid-versions-versionid-activate", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/tracking_settings": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.**\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "GET_tracking_settings", + "parameters": [ + { + "description": "The number of settings to return.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "Where in the list of results you want to begin retrieving settings.", + "in": "query", + "name": "offset", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Tracking Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_trackingsettings", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/tracking_settings/click": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current click tracking setting.**\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "GET_tracking_settings-click", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enable_text": false, + "enabled": true + } + }, + "schema": { + "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" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Click Track Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_trackingsettings-click", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.**\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "PATCH_tracking_settings-click", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "enabled": true + }, + "properties": { + "enabled": { + "description": "The setting you want to use for click tracking.", + "type": "boolean" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enable_text": false, + "enabled": true + } + }, + "schema": { + "properties": { + "enable_text": { + "description": "Indicates if click tracking is enabled for plain text emails", + "type": "boolean" + }, + "enabled": { + "description": "The new setting new setting for click tracking.", + "type": "boolean" + } + }, + "required": [ + "enable_text", + "enabled" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Click Tracking Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_trackingsettings-click", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/tracking_settings/google_analytics": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current setting for Google Analytics.**\n\nFor more information about using Google Analytics, please refer to [Google\u2019s 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\u2019s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html).\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "GET_tracking_settings-google_analytics", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true, + "utm_campaign": "", + "utm_content": "lotsandlotsofcontent", + "utm_medium": "", + "utm_source": "", + "utm_term": "" + } + }, + "schema": { + "$ref": "#/definitions/google_analytics_settings" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Google Analytics Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_trackingsettings-googleanalytics", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current setting for Google Analytics.**\n\nFor more information about using Google Analytics, please refer to [Google\u2019s 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\u2019s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html).\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "PATCH_tracking_settings-google_analytics", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/google_analytics_settings", + "example": { + "enabled": true, + "utm_campaign": "website", + "utm_content": "", + "utm_medium": "email", + "utm_source": "sendgrid.com", + "utm_term": "" + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true, + "utm_campaign": "", + "utm_content": "lotsandlotsofcontent", + "utm_medium": "", + "utm_source": "", + "utm_term": "" + } + }, + "schema": { + "$ref": "#/definitions/google_analytics_settings" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Google Analytics Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_trackingsettings-googleanalytics", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/tracking_settings/open": { + "get": { + "consumes": [ + "application/json" + ], + "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. If the email recipient has images enabled on their email client, a request to SendGrid\u2019s server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "GET_tracking_settings-open", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true + } + }, + "schema": { + "properties": { + "enabled": { + "description": "Indicates if open tracking is enabled.", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get Open Tracking Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_trackingsettings-open", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "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. If the email recipient has images enabled on their email client, a request to SendGrid\u2019s server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "PATCH_tracking_settings-open", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "enabled": true + }, + "properties": { + "enabled": { + "description": "The new status that you want to set for open tracking.", + "type": "boolean" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true + } + }, + "schema": { + "properties": { + "enabled": { + "description": "Indicates if open tracking is enabled.", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Open Tracking Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_trackingsettings-open", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/tracking_settings/subscription": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "GET_tracking_settings-subscription", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true, + "html_content": "

Something something unsubscribe <% %> something something

\n", + "landing": "

subscribehere

\n", + "plain_content": "Something something unsubscribe <% %> something something", + "replace": "thetag", + "url": "" + } + }, + "schema": { + "$ref": "#/definitions/subscription_tracking_settings" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Subscription Tracking Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_trackingsettings-subscription", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "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.\n\nYou can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.\n\nFor more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).", + "operationId": "PATCH_tracking_settings-subscription", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/subscription_tracking_settings", + "example": { + "enabled": true, + "html_content": "html content", + "landing": "landing page html", + "plain_content": "text content", + "replace": "replacement tag", + "url": "url" + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "enabled": true, + "html_content": "html content", + "landing": "landing page html", + "plain_content": "text content", + "replace": "replacement tag", + "url": "url" + } + }, + "schema": { + "$ref": "#/definitions/subscription_tracking_settings" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Subscription Tracking Settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_trackingsettings-subscription", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/user/account": { + "get": { + "consumes": [ + "application/json" + ], + "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.\n\nKeeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.\n\nFor more information about your user profile:\n\n* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)", + "operationId": "GET_user-account", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get a user's account information.", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-account", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/user/credits": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the current credit balance for your account.**\n\nYour monthly credit allotment limits the number of emails you may send before incurring overage charges. For more information about credits and billing, please visit our [Clssroom](https://sendgrid.com/docs/Classroom/Basics/Billing/billing_info_and_faqs.html).", + "operationId": "GET_user-credits", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve your credit balance", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-credits", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/user/email": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the email address currently on file for your account.**\n\nKeeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.\n\nFor more information about your user profile:\n\n* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)", + "operationId": "GET_user-email", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "email": "test@example.com" + } + }, + "schema": { + "properties": { + "email": { + "description": "The email address currently on file for your account.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve your account email address", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "put": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update the email address currently on file for your account.**\n\nKeeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.\n\nFor more information about your user profile:\n\n* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)", + "operationId": "PUT_user-email", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "properties": { + "email": { + "description": "The current email address on file for your account.", + "type": "string" + } + }, + "required": [ + "email" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update your account email address", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PUT_user-email", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/password": { + "parameters": [], + "put": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your password.**\n\nKeeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.\n\nFor more information about your user profile:\n\n* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)", + "operationId": "PUT_user-password", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [], + "responses": { + "200": { + "description": "", + "schema": { + "properties": {}, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update your password", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PUT_user-password", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/profile": { + "get": { + "consumes": [ + "application/json" + ], + "description": "Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.\n\nFor more information about your user profile:\n\n* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)", + "operationId": "GET_user-profile", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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" + } + }, + "401": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get a user's profile", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-profile", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update your current profile details.**\n\nKeeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.\n\nFor more information about your user profile:\n\n* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)\n\nIt should be noted that any one or more of the parameters can be updated via the PATCH /user/profile endpoint. The only requirement is that you include at least one when you PATCH.", + "operationId": "PATCH_user-profile", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/user_profile", + "example": { + "city": "Orange", + "first_name": "Example", + "last_name": "User" + } + } + }, + { + "description": "You can enter a subuser name as the value for this header, in order to update the subuser's profile.", + "in": "header", + "name": "on-behalf-of", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/user_profile" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a user's profile", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_user-profile", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/scheduled_sends": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all cancel/paused scheduled send information.**\n\nThe Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.", + "operationId": "GET_user-scheduled_sends", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "batch_id": "YzJlNTkxMmEtOWM3Ny0xMWU1LTkwM2UtNTI1NDAwNmQzZmYzLTVlM2NhNWIwYg", + "status": "cancel" + }, + { + "batch_id": "UtNTI1NDAwNmQzZmYzLTVlM2NhNWIwYgYzJlNTkxMmEtOWM3Ny0xMWU1LTkwM2", + "status": "cancel" + } + ] + }, + "schema": { + "items": { + "$ref": "#/definitions/user_scheduled_send_status" + }, + "type": "array" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all scheduled sends", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-scheduledsends", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to cancel or pause an email that has been scheduled to be sent.**\n\nIf the maximum number of cancellations/pauses are added, HTTP 400 will\nbe returned.\n\nThe Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.", + "operationId": "POST_user-scheduled_sends", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/user_scheduled_send_status" + } + }, + "400": { + "description": "\"\" : \"max limit reached\"\n\"batch_id\" : \"invalid batch id\"\n\"batch_id\" : \"a status for this batch id exists, try PATCH to update the status\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "max limit reached" + }, + { + "field": "batch_id", + "message": "invalid batch id" + }, + { + "field": "batch_id", + "message": "a status for this batch id exists, try PATCH to update the status" + } + ] + } + }, + "schema": { + "type": "object" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Cancel or pause a scheduled send", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_user-scheduledsends", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/user/scheduled_sends/{batch_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete the cancellation/pause of a scheduled send.**\n\nThe Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.", + "operationId": "DELETE_user-scheduled_sends-batch_id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "type": "null" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "batch id not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a cancellation or pause of a scheduled send", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_user-scheduledsends-batchid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.**\n\nThe Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.", + "operationId": "GET_user-scheduled_sends-batch_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi", + "status": "cancel" + }, + { + "batch_id": "IbLdyLYULb7Rj8GKSx7u025ouWVlAiMg", + "status": "pause" + } + ] + }, + "schema": { + "items": { + "$ref": "#/definitions/user_scheduled_send_status" + }, + "title": "Retrieve scheduled send response", + "type": "array" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve scheduled send", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-scheduledsends-batchid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "batch_id", + "required": true, + "type": "string" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.**\n\nThe Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.", + "operationId": "PATCH_user-scheduled_sends-batch_id", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "null" + } + }, + "400": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": "status", + "message": "status must be either cancel or pause" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "401": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "authorization required" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + }, + "404": { + "description": "\"\" : \"batch id not found\"", + "examples": { + "application/json": { + "errors": [ + { + "field": null, + "message": "batch id not found" + } + ] + } + }, + "schema": { + "$ref": "#/definitions/global:ErrorResponse" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update user scheduled send information", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_user-scheduledsends-batchid", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/settings/enforced_tls": { + "get": { + "consumes": [ + "application/json" + ], + "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. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS.\n\n**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with \u201cTLS required but not supported\u201d as the description.", + "operationId": "GET_user-settings-enforced_tls", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "require_tls": false, + "require_valid_cert": false + } + }, + "schema": { + "properties": { + "require_tls": { + "description": "Indicates if the recipient is required to support TLS.", + "type": "boolean" + }, + "require_valid_cert": { + "description": "Indicates if the recipient is required to have a valid certificate.", + "type": "boolean" + } + }, + "required": [ + "require_tls", + "require_valid_cert" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve current Enforced TLS settings.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-settings-enforcedtls", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update 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. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS.\n\n**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with \u201cTLS required but not supported\u201d as the description.", + "operationId": "PATCH_user-settings-enforced_tls", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "require_tls": true, + "require_valid_cert": false + }, + "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" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "require_tls": true, + "require_valid_cert": false + } + }, + "schema": { + "properties": { + "require_tls": { + "description": "Indicates if your recipients are required to support TLS.", + "type": "boolean" + }, + "require_valid_cert": { + "description": "Indicates if your recipients are required to have a valid certificate.", + "type": "boolean" + } + }, + "required": [ + "require_tls", + "require_valid_cert" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Enforced TLS settings", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_user-settings-enforcedtls", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/username": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current account username.**\n\nKeeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.\n\nFor more information about your user profile:\n\n* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)", + "operationId": "GET_user-username", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve your username", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-username", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "put": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update the username for your account.**\n\nKeeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.\n\nFor more information about your user profile:\n\n* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)", + "operationId": "PUT_user-username", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "username": "test_username" + }, + "properties": { + "username": { + "description": "The new username you would like to use for your account.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "username": "test_username" + } + }, + "schema": { + "properties": { + "username": { + "description": "The current username on file for your account.", + "type": "string" + } + }, + "required": [ + "username" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update your username", + "tags": [ + "Users API" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PUT_user-username", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/event/settings": { + "get": { + "consumes": [ + "application/json" + ], + "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\u2019s 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": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "bounce": true, + "click": true, + "deferred": true, + "delivered": true, + "dropped": true, + "enabled": true, + "group_resubscribe": true, + "group_unsubscribe": true, + "open": true, + "processed": true, + "spam_report": true, + "unsubscribe": true, + "url": "url" + } + }, + "schema": { + "$ref": "#/definitions/event_webhook_settings" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Event Webhook settings", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-webhooks-event-settings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "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\u2019s 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": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/event_webhook_settings", + "example": { + "bounce": true, + "click": true, + "deferred": true, + "delivered": true, + "dropped": true, + "enabled": true, + "group_resubscribe": true, + "group_unsubscribe": true, + "open": true, + "processed": true, + "spam_report": true, + "unsubscribe": true, + "url": "url" + } + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "bounce": true, + "click": true, + "deferred": true, + "delivered": true, + "dropped": true, + "enabled": true, + "group_resubscribe": true, + "group_unsubscribe": true, + "open": true, + "processed": true, + "spam_report": true, + "unsubscribe": true, + "url": "url" + } + }, + "schema": { + "$ref": "#/definitions/event_webhook_settings" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update Event Notification Settings", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_user-webhooks-event-settings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/event/test": { + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.**\n\nSendGrid\u2019s 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": "POST_user-webhooks-event-test", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "url": "url" + }, + "properties": { + "url": { + "description": "The URL where you would like the test notification to be sent.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Test Event Notification Settings ", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_user-webhooks-event-test", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + } + }, + "/user/webhooks/parse/settings": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve your current inbound parse webhook settings.**\n\nSendGrid can parse the attachments and contents of incoming emails. The Parse API will POST the parsed email to a URL that you specify. For more information, see our Inbound [Parse Webhook documentation](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).", + "operationId": "GET_user-webhooks-parse-settings", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "result": [ + { + "hostname": "example.com", + "send_raw": false, + "spam_check": false, + "url": "http://example.com/example" + } + ] + } + }, + "schema": { + "properties": { + "result": { + "description": "The array containing the parse webhook settings.", + "items": { + "properties": { + "hostname": { + "description": "The hostname of the URL where you would like your parsed emails to be posted.", + "type": "string" + }, + "send_raw": { + "description": "Indicates if the raw content that was parsed will be posted.", + "type": "boolean" + }, + "spam_check": { + "description": "Indicates if the parsed content will be checked for spam.", + "type": "boolean" + }, + "url": { + "description": "The URL where you want your parsed emails to be posted.", + "type": "string" + } + }, + "required": [ + "hostname", + "url", + "spam_check", + "send_raw" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "result" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Parse Webhook settings", + "tags": [ + "Webhooks" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-webhooks-parse-settings", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/user/webhooks/parse/stats": { + "get": { + "consumes": [ + "application/json" + ], + "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 20MB 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, + "type": "string" + }, + { + "description": "The number of statistics to skip.", + "in": "query", + "name": "offset", + "required": false, + "type": "string" + }, + { + "description": "How you would like the statistics to by grouped. ", + "enum": [ + "day", + "week", + "month" + ], + "in": "query", + "name": "aggregated_by", + "required": false, + "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, + "type": "string" + }, + { + "default": "The day the request is made.", + "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, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieves Inbound Parse Webhook statistics.", + "tags": [ + "Stats - Parse Webhook Stats" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_user-webhooks-parse-stats", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/whitelabel/domains": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a list of all domain whitelabels you have created.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n", + "operationId": "GET_whitelabel-domains", + "parameters": [ + { + "description": "Number of domains to return.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "Paging offset.", + "in": "query", + "name": "offset", + "type": "integer" + }, + { + "description": "Exclude subuser domains from the result.", + "in": "query", + "name": "exclude_subusers", + "type": "boolean" + }, + { + "description": "The username associated with a whitelabel.", + "in": "query", + "name": "username", + "type": "string" + }, + { + "description": "Search for domain whitelabels that match the given domain.", + "in": "query", + "name": "domain", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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 + }, + "spf": { + "data": "v=spf1 include:u7.wl.sendgrid.net -all", + "host": "example.com", + "type": "txt", + "valid": true + } + }, + "domain": "example.com", + "id": 1, + "ips": [ + "192.168.1.1", + "192.168.1.2" + ], + "legacy": false, + "subdomain": "mail", + "user_id": 7, + "username": "john@example.com", + "valid": true + }, + { + "automatic_security": true, + "custom_spf": false, + "default": true, + "dns": { + "dkim": { + "data": "k=rsa; t=s; p=publicKey", + "host": "example2.com", + "type": "txt", + "valid": false + }, + "domain_spf": { + "data": "v=spf1 include:news.example2.com -all", + "host": "example2.com", + "type": "txt", + "valid": false + }, + "mail_server": { + "data": "sendgrid.net", + "host": "news.example2.com", + "type": "mx", + "valid": false + }, + "subdomain_spf": { + "data": "v=spf1 include:sendgrid.net ~all", + "host": "news.example2.com", + "type": "txt", + "valid": false + } + }, + "domain": "example2.com", + "id": 2, + "ips": [], + "legacy": false, + "subdomain": "news", + "user_id": 8, + "username": "jane@example2.com", + "valid": false + } + ] + }, + "schema": { + "items": { + "properties": { + "automatic_security": { + "description": "Indicates if this whitelabel uses automated security.", + "type": "boolean" + }, + "custom_spf": { + "description": "Indicates if this whitelabel has custom SPF.", + "type": "boolean" + }, + "default": { + "description": "Indicates if this whitelabel has been set as the default whitelabel.", + "type": "boolean" + }, + "dns": { + "description": "The DNS records for this whitelabel that are used for authenticating the sending domain.", + "properties": { + "dkim": { + "description": "The DNS record used when creating the DKIM signature.", + "properties": { + "data": { + "description": "The DNS record.", + "type": "string" + }, + "host": { + "description": "The domain that these DNS records will be applied to.", + "format": "hostname", + "type": "string" + }, + "type": { + "description": "The type of DNS record.", + "enum": [ + "cname", + "mx", + "txt" + ], + "type": "string" + }, + "valid": { + "description": "Indicates if this DNS record is valid.", + "type": "boolean" + } + }, + "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.", + "type": "string" + }, + "host": { + "description": "The domain sending the messages.", + "type": "string" + }, + "type": { + "description": "The type of DNS record.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid DNS record with no conflicts.", + "type": "boolean" + } + }, + "type": "object" + }, + "subdomain_spf": { + "description": "The SPF record for the subdomain used to create this whitelabel.", + "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 the SPF record is valid.", + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "domain": { + "description": "The domain that this whitelabel was created for.", + "type": "string" + }, + "id": { + "description": "The ID of the domain whitelabel.", + "type": "number" + }, + "ips": { + "description": "The IPs that will be included in the custom SPF record.", + "items": { + "type": "string" + }, + "type": "array" + }, + "legacy": { + "description": "Indicates if this is whitelabel was created with the legacy whitelabel tool.", + "type": "boolean" + }, + "subdomain": { + "description": "The subdomain created for this domain whitelabel.", + "type": "string" + }, + "user_id": { + "description": "The ID of the user that this whitelabel will be associated with.", + "type": "number" + }, + "username": { + "description": "The username that this whitelabel is associated with.", + "type": "string" + }, + "valid": { + "description": "Indicates if this is a valid whitelabel or not.", + "type": "boolean" + } + }, + "required": [ + "id", + "user_id", + "subdomain", + "domain", + "username", + "ips", + "custom_spf", + "default", + "legacy", + "automatic_security", + "valid", + "dns" + ], + "type": "object" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "List all domain whitelabels.", + "tags": [ + "Whitelabel - Domains" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-domains", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create a whitelabel for one of your domains.**\n\nIf you are creating a domain whitelabel that you would like a subuser to use, you have two options:\n1. Use the \"username\" parameter. This allows you to create a whitelabel on behalf of your subuser. This means the subuser is able to see and modify the created whitelabel.\n2. Use the Association workflow (see Associate Domain section). This allows you to assign a whitelabel created by the parent to a subuser. This means the subuser will default to the assigned whitelabel, but will not be able to see or modify that whitelabel. However, if the subuser creates their own whitelabel it will overwrite the assigned whitelabel.\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)", + "operationId": "POST_whitelabel-domains", + "parameters": [ + { + "in": "body", + "name": "body", + "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_spf": { + "description": "Specify whether to use a custom SPF or allow SendGrid to manage your SPF. This option is only available to domain whitelabels setup for manual security.", + "type": "boolean" + }, + "default": { + "description": "Whether to use this whitelabel as the fallback if no domain whitelabels match the sender's domain.", + "type": "boolean" + }, + "domain": { + "description": "Domain being whitelabeled.", + "type": "string" + }, + "ips": { + "description": "The IP addresses that will be included in the custom SPF record for this whitelabel.", + "items": { + "type": "string" + }, + "type": "array" + }, + "subdomain": { + "description": "The subdomain to use for this domain whitelabel.", + "type": "string" + }, + "username": { + "description": "The username that this whitelabel will be associated with.", + "type": "string" + } + }, + "required": [ + "domain", + "subdomain" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/whitelabel::domain" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a domain whitelabel.", + "tags": [ + "Whitelabel - Domains" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-domains", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/domains/default": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the default whitelabel for a domain.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| domain | string |The domain to find a default domain whitelabel for. |", + "operationId": "GET_whitelabel-domains-default", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/whitelabel:domain_spf" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Get the default domain whitelabel.", + "tags": [ + "Whitelabel - Domains" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-domains-default", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/whitelabel/domains/subuser": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to disassociate a specific whitelabel from a subuser.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nDomain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n\n## URI Parameters\n| URI Parameter | Type | Required? | Description |\n|---|---|---|---|\n| username | string | required | Username for the subuser to find associated whitelabels for. |", + "operationId": "DELETE_whitelabel-domains-subuser", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Disassociate a domain whitelabel from a given user.", + "tags": [ + "Whitelabel - Domains" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_whitelabel-domains-subuser", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all of the whitelabels that have been assigned to a specific subuser.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nDomain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| username | string | Username of the subuser to find associated whitelabels for. |", + "operationId": "GET_whitelabel-domains-subuser", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/whitelabel:domain_spf" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "List the domain whitelabel associated with the given user.", + "tags": [ + "Whitelabel - Domains" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-domains-subuser", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/whitelabel/domains/{domain_id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a domain whitelabel.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)", + "operationId": "DELETE_whitelabel-domains-domain_id", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a domain whitelabel.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_whitelabel-domains-domainid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a specific domain whitelabel.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n", + "operationId": "GET_whitelabel-domains-domain_id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/whitelabel::domain" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a domain whitelabel.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-domains-domainid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update the settings for a domain whitelabel.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)", + "operationId": "PATCH_whitelabel-domains-domain_id", + "parameters": [ + { + "in": "body", + "name": "body", + "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 domain whitelabel should be considered the default.", + "type": "boolean" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "schema": { + "properties": { + "custom_spf false": { + "description": "Indicates whether to generate a custom SPF record for manual security. Defaults to false.", + "type": "boolean" + }, + "default false": { + "description": "Inidcates whether this domain whitelabel should be considered the default. Defaults to false.", + "type": "boolean" + } + }, + "title": "Update a Domain response", + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a domain whitelabel.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_whitelabel-domains-domainid", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/domains/{domain_id}/subuser": { + "parameters": [ + { + "in": "path", + "name": "domain_id", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to associate a specific domain whitelabel with a subuser.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nDomain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| domain_id | integer | ID of the domain whitelabel to associate with the subuser. |", + "operationId": "POST_whitelabel-domains-domain_id-subuser", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "username": "jane@example.com" + }, + "properties": { + "username": { + "description": "Username to associate with the domain whitelabel.", + "type": "string" + } + }, + "required": [ + "username" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/whitelabel:domain_spf" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Associate a domain whitelabel with a given user.", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-domains-domainid-subuser", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/domains/{id}/ips": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to add an IP address to a domain whitelabel.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| id | integer | ID of the domain to which you are adding an IP |", + "operationId": "POST_whitelabel-domains-id-ips", + "parameters": [ + { + "in": "body", + "name": "body", + "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" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/whitelabel:domain_spf" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Add an IP to a domain whitelabel.", + "tags": [ + "Whitelabel - Domains" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-domains-id-ips", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/domains/{id}/ips/{ip}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to remove a domain's IP address from that domain's whitelabel.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| id | integer | ID of the domain whitelabel to delete the IP from. |\n| ip | string | IP to remove from the domain whitelabel. |", + "operationId": "DELETE_whitelabel-domains-id-ips-ip", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/whitelabel:domain_spf" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Remove an IP from a domain whitelabel.", + "tags": [ + "Whitelabel - Domains" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_whitelabel-domains-id-ips-ip", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "ip", + "required": true, + "type": "string" + } + ] + }, + "/whitelabel/domains/{id}/validate": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "type": "string" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to validate a domain whitelabel. If it fails, it will return an error message describing why the whitelabel could not be validated.**\n\nA domain whitelabel allows you to remove the \u201cvia\u201d or \u201csent on behalf of\u201d message that your recipients see when they read your emails. Whitelabeling 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 be given 2 TXT records and 1 MX record.\n\nFor more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)\n\n## URI Parameters\n| URI Parameter | Type | Description |\n|---|---|---|\n| id | integer |ID of the domain whitelabel to validate. |", + "operationId": "POST_whitelabel-domains-id-validate", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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 domain whitelabel.", + "type": "integer" + }, + "valid": { + "description": "Indicates if this is a valid whitelabel.", + "type": "boolean" + }, + "validation_resuts": { + "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 domain whitelabel.", + "properties": { + "reason": { + "type": "null" + }, + "valid": { + "description": "Indicates if the DNS record is valid.", + "type": "boolean" + } + }, + "type": "object" + }, + "dkim2": { + "description": "A DNS record for this whitelabel.", + "properties": { + "reason": { + "type": "null" + }, + "valid": { + "description": "Indicates if the DNS record is valid.", + "type": "boolean" + } + }, + "type": "object" + }, + "mail_cname": { + "description": "The CNAME record for the domain whitelabel.", + "properties": { + "reason": { + "description": "The reason this record is invalid.", + "type": "string" + }, + "valid": { + "description": "Indicates if this DNS record is valid.", + "type": "boolean" + } + }, + "type": "object" + }, + "spf": { + "description": "The SPF record for the whitelabel.", + "properties": { + "reason": { + "type": "null" + }, + "valid": { + "description": "Indicates if the SPF record is valid.", + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "400": { + "description": "Unexpected error in API call. See HTTP response body for details.", + "schema": { + "type": "object" + } + }, + "500": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate a domain whitelabel.", + "tags": [ + "Whitelabel - Domains" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-domains-id-validate", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/ips": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all of the IP whitelabels that have been createdy by this account.**\n\nYou may include a search key by using the \"ip\" parameter. This enables you to perform a prefix search for a given IP segment (e.g. \"192.\").\n\nA IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).", + "operationId": "GET_whitelabel-ips", + "parameters": [ + { + "description": "The number of results to retrieve.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "description": "The point in the list of results to begin retrieving IPs from.", + "in": "query", + "name": "offset", + "type": "integer" + }, + { + "description": "The IP segment that you would like to use in a prefix search.", + "in": "query", + "name": "ip", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": "#/definitions/ip_whitelabel" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all IP whitelabels", + "tags": [ + "Whitelabel - IPs" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-ips", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create an IP whitelabel.**\n\nWhen creating an IP whitelable, you should use the same subdomain that you used when you created a domain whitelabel.\n\nA IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).", + "operationId": "POST_whitelabel-ips", + "parameters": [ + { + "in": "body", + "name": "body", + "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.", + "type": "string" + }, + "ip": { + "description": "The IP address that you want to whitelabel.", + "type": "string" + }, + "subdomain": { + "description": "The subdomain that will be used to send emails from the IP. Should be the same as the subdomain used for your domain whitelabel.", + "type": "string" + } + }, + "required": [ + "ip", + "subdomain", + "domain" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/ip_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create an IP whitelabel", + "tags": [ + "Whitelabel - IPs" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-ips", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/ips/{id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete an IP whitelabel.**\n\nA IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).", + "operationId": "DELETE_whitelabel-ips-id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "message": "Whitelabel ip not found." + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "description": "The errors preventing the IP whitelabel from being deleted.", + "items": { + "properties": { + "message": { + "description": "A message explaining why the IP whitelabel could not be deleted.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete an IP whitelabel", + "tags": [ + "Whitelabel - IPs" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_whitelabel-ips-id", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve an IP whitelabel.**\n\nA IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).", + "operationId": "GET_whitelabel-ips-id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/ip_whitelabel" + } + }, + "404": { + "description": "", + "examples": { + "application/json": { + "errors": [ + { + "message": "Whitelabel ip not found." + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "description": "The errors preventing the retrieval of the IP whitelabel.", + "items": { + "properties": { + "message": { + "description": "A message explaining why the IP whitelabel could not be found.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve an IP whitelabel", + "tags": [ + "Whitelabel - IPs" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-ips-id", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the IP whitelabel that you would like to retrieve.", + "in": "path", + "name": "id", + "required": true, + "type": "string" + } + ] + }, + "/whitelabel/ips/{id}/validate": { + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "type": "integer" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to validate an IP whitelabel.**\n\nA IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).", + "operationId": "POST_whitelabel-ips-id-validate", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "id": 1, + "valid": true, + "validation_results": { + "a_record": { + "reason": null, + "valid": true + } + } + } + }, + "schema": { + "properties": { + "id": { + "description": "The id of the IP whitelabel.", + "type": "integer" + }, + "valid": { + "description": "Indicates if the IP whitelabel 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 IP whitelabel could not be validated. Is null if the whitelabel was validated.", + "type": [ + "null", + "string" + ] + }, + "valid": { + "description": "Indicates if the IP whitelabel could be validated.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "required": [ + "valid", + "reason" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "id", + "valid", + "validation_results" + ], + "type": "object" + } + }, + "404": { + "description": "Unexpected error in API call. See HTTP response body for details.", + "examples": { + "application/json": { + "errors": [ + { + "message": "Whitelabel ip not found." + } + ] + } + }, + "schema": { + "properties": { + "errors": { + "description": "The error messages for the failed validation.", + "items": { + "properties": { + "message": { + "description": "A message describing why the IP could not be validated.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + }, + "500": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate an IP whitelabel", + "tags": [ + "Whitelabel - IPs" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-ips-id-validate", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/links": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve all link whitelabels.**\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "GET_whitelabel-links", + "parameters": [ + { + "description": "Limits the number of results returned per page.", + "in": "query", + "name": "limit", + "type": "integer" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": [ + { + "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": "#/definitions/link_whitelabel" + }, + "type": "array" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve all link whitelabels", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-links", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to create a new link whitelabel.**\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "POST_whitelabel-links", + "parameters": [ + { + "default": 50, + "description": "Number of domains to return.", + "in": "query", + "name": "limit", + "type": "integer" + }, + { + "default": 0, + "description": "Paging offset.", + "in": "query", + "name": "offset", + "type": "integer" + }, + { + "in": "body", + "name": "body", + "schema": { + "example": { + "default": true, + "domain": "example.com", + "subdomain": "mail" + }, + "properties": { + "default": { + "description": "Indicates if you want to use this link whitelabel as the fallback, or default, whitelabel.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "domain": { + "description": "The root domain for your subdomain that you are creating the whitelabel for. This should match your FROM email address.", + "type": "string" + }, + "subdomain": { + "description": "The subdomain to create the link whitelabel for. Must be different from the subdomain you used for a domain whitelabel.", + "type": "string" + } + }, + "required": [ + "domain", + "subdomain" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/link_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Create a Link Whitelabel", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-links", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/links/default": { + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the default link whitelabel.**\n\nDefault link whitelabel is the actual link whitelabel to be used when sending messages. If there are multiple link whitelabels, the default is determined by the following order:\n\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "GET_whitelabel-links-default", + "parameters": [ + { + "description": "The domain to match against when finding a corresponding link whitelabel.", + "in": "query", + "name": "domain", + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/link_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Default Link Whitelabel", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-links-default", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [] + }, + "/whitelabel/links/subuser": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to disassociate a link whitelabel from a subuser.**\n\nLink whitelables can be associated with subusers from the parent account. This functionality allows\nsubusers to send mail using their parent's linke whitelabels. To associate a link whitelabel, the parent account\nmust first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "DELETE_whitelabel-links-subuser", + "parameters": [ + { + "description": "The username of the subuser account that you want to disassociate a link whitelabel from.", + "in": "query", + "name": "username", + "required": true, + "type": "string" + } + ], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Disassociate a Link Whitelabel", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_whitelabel-links-subuser", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve the associated link whitelabel for a subuser.**\n\nLink whitelables can be associated with subusers from the parent account. This functionality allows\nsubusers to send mail using their parent's linke whitelabels. To associate a link whitelabel, the parent account\nmust first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "GET_whitelabel-links-subuser", + "parameters": [ + { + "description": "The username of the subuser to retrieve associated link whitelabels for.", + "in": "query", + "name": "username", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/link_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve Associated Link Whitelabel", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-links-subuser", + "mock": { + "dynamic": false, + "enabled": false, + "statusCode": 200 + }, + "public": true + } + }, + "parameters": [] + }, + "/whitelabel/links/{id}": { + "delete": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to delete a link whitelabel.**\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "DELETE_whitelabel-links-id", + "parameters": [], + "produces": [], + "responses": { + "204": { + "description": "", + "schema": { + "type": "object" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Delete a Link Whitelabel", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "DELETE_whitelabel-links-id", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "get": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to retrieve a specific link whitelabel.**\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "GET_whitelabel-links-id", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/link_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Retrieve a Link Whitelabel", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "GET_whitelabel-links-id", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + }, + "parameters": [ + { + "description": "The id of the link whitelabel you want to retrieve.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + } + ], + "patch": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to update a specific link whitelabel. You can use this endpoint to change a link whitelabel's default status.**\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "PATCH_whitelabel-links-id", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "default": true + }, + "properties": { + "default": { + "description": "Indicates if the link whitelabel is set as the default, or fallback, whitelabel.", + "enum": [ + true, + false + ], + "type": "boolean" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/link_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Update a Link Whitelabel", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "PATCH_whitelabel-links-id", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/links/{id}/validate": { + "parameters": [ + { + "description": "The id of the link whitelabel that you want to validate.", + "in": "path", + "name": "id", + "required": true, + "type": "integer" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to validate a link whitelabel.**\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "POST_whitelabel-links-id-validate", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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 link whitelabel.", + "type": "integer" + }, + "valid": { + "description": "Indicates if the link whitelabel is valid.", + "enum": [ + true, + false + ], + "type": "boolean" + }, + "validation_results": { + "description": "The individual validations results for each of the DNS records associated with this link whitelabel.", + "properties": { + "domain_cname": { + "description": "The DNS record generated for the sending domain used for this link whitelabel.", + "properties": { + "reason": { + "description": "Null if the DNS record is valid. If the DNS record is invalid, this will explain why.", + "type": [ + "string", + "null" + ] + }, + "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 link whitelabel.", + "properties": { + "reason": { + "description": "Null if valid. If the DNS record is invalid, this will explain why.", + "type": [ + "null", + "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" + } + }, + "400": { + "description": "Unexpected error in API call. See HTTP response body for details.", + "schema": { + "type": "object" + } + }, + "500": { + "description": "", + "examples": { + "application/json": { + "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" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Validate a Link Whitelabel", + "tags": [ + "Whitelabel - Links" + ], + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-links-id-validate", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + }, + "/whitelabel/links/{link_id}/subuser": { + "parameters": [ + { + "description": "The id of the link whitelabel you want to associate.", + "in": "path", + "name": "link_id", + "required": true, + "type": "integer" + } + ], + "post": { + "consumes": [ + "application/json" + ], + "description": "**This endpoint allows you to associate a link whitelabel with a subuser account.**\n\nLink whitelables can be associated with subusers from the parent account. This functionality allows\nsubusers to send mail using their parent's linke whitelabels. To associate a link whitelabel, the parent account\nmust first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.\n\nEmail link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.\n\nFor more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).", + "operationId": "POST_whitelabel-links-link_id-subuser", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "example": { + "username": "jane@example.com" + }, + "properties": { + "username": { + "description": "The username of the subuser account that you want to associate the link whitelabel with.", + "type": "string" + } + }, + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "", + "examples": { + "application/json": { + "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": "#/definitions/link_whitelabel" + } + } + }, + "security": [ + { + "Authorization": [] + } + ], + "summary": "Associate a Link Whitelabel", + "x-stoplight": { + "afterScript": null, + "beforeScript": null, + "id": "POST_whitelabel-links-linkid-subuser", + "mock": { + "dynamic": false, + "enabled": null, + "statusCode": null + }, + "public": true + } + } + } + }, + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "securityDefinitions": { + "Authorization": { + "in": "header", + "name": "Authorization", + "type": "apiKey" + } + }, + "swagger": "2.0", + "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}", + "beforeScript": "function (ctx, request) {\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 }\n \n}", + "functions": { + "Audit_LogDataInResponse": { + "description": "", + "name": "Audit_LogDataInResponse", + "script": "function(ctx, request, response) {\n /*\n This function is added to your calls if you want, by adding ?audit=true to your URI\n */\n\n var output = \"\";\n var spacer = \"\\t\";\n \n //fill in the date in the spreadsheet, so you don't have to\n var date = new Date();\n date.setHours(date.getHours() - 7); // time is UTC, so subtract 6 hrs to compensate to CT, 7 for MST\n var todays_date = date.toLocaleDateString(\"en-US\")+\"\\t\";\n \n //do we even snake case, bro?\n var regex_camel_case = new RegExp(\"^[a-zA-Z0-9_]*$\");\n \n //output += \"Limit: \" + response.header.get(\"X-RateLimit-Limit\") + \"//\";\n var checkHeader = function(header, test) {\n \n if (test) {\n return (response.header.get(header).indexOf(test) != -1 ? \"Yes\\t\" : \"No\\t\");\n } else {\n \n return (response.header.get(header) ? \"Yes\\t\" : \"No\\t\");\n }\n \n };\n \n \n \n \n var accept_header_block = \"DOES NOT INCLUDE ACCEPT HEADER BLOCK: \";\n\n //test the Accept header\n var code = response.statusCode.get();\n accept_header_block = (code == 406 ? \" \\tYes\\t \\tYes\\t\" : \"Yes\\tNo\\tYes\\tNo\\t\") + todays_date + spacer;\n \n \n \n var request_body_block = \"DOES NOT INCLUDE REQUEST BODY BLOCK: \";\n \n var req_body = response.body.get();\n var req_keys = Object.keys(req_body);\n \n var req_is_camel_case = 0, req_has_bool_vals = 0;\n\n for (var i=0; i 0 ? (is_camel_case > 0 ? \"No\" : \"Yes\") : \"\" ) + spacer + //snake case\n (req_body.length > 0 ? \"\" : \"N/A\" ) + spacer + //allows null/empty req, if no req - this is N/A\n (req_body.length > 0 ? (req_has_bool_vals > 0 ? \"Yes\" : \"\") : \"\") + spacer + //has bool values?\n spacer + todays_date + //todays date\n spacer; // the empty column\n \n var authorization_block = spacer + spacer + spacer + spacer + todays_date + spacer;\n \n\n \n //get headers: X-RateLimit-Limit, X-RateLimit-Remaining. X-RateLimit-Reset, Content-Type. Modified, Etags, Link\n var rate_limit = response.header.get(\"X-RateLimit-Limit\")+\"\\t\";\n var rateLimit_remaining_header = checkHeader(\"X-RateLimit-Remaining\");\n var rateLimit_limit_header = checkHeader(\"X-RateLimit-Limit\");\n var ratelimit_reset_header = checkHeader(\"X-RateLimit-Reset\");\n \n //Content-Type is specified as application/json\n var content_type_header = checkHeader(\"Content-Type\", \"application/json\");\n\n //Modified Header?\n //Response includes \"Not Modified\"\n //This is a shitty check, because SG doesn't have this header right now 12/9/15\n var modified_check = (response.statusCode.get() == 304 ? \"Yes\\t\" : \"No\\t\");\n \n //get the headers we want to check\n var access_control_allow_headers = response.header.get(\"Access-Control-Allow-Headers\")+spacer;\n var access_control_allow_methods = response.header.get(\"Access-Control-Allow-Methods\")+spacer;\n var etags_header = checkHeader(\"ETags\");\n var link_header = checkHeader(\"Link\");\n var request_id_header = checkHeader(\"X-RequestID\");\n \n var headers_block = rate_limit + rateLimit_remaining_header + rateLimit_limit_header + ratelimit_reset_header + content_type_header + \n modified_check + access_control_allow_headers + access_control_allow_methods + spacer + etags_header + link_header + request_id_header + \n todays_date + spacer;\n\n //get the body keys\n var resp_body = response.body.get();\n var resp_keys = Object.keys(resp_body);\n \n //check if the result key is there.\n var result_key_check = (resp_keys.length == 1 && resp_body.result && resp_body.result != \"undefined\" ? \"Yes\"+spacer : \"No\"+spacer);\n\n var is_camel_case = 0, \n has_empties = 0, \n has_bool_vals = false,\n pagination_params = 0, \n resp_is_unixtime = 0;\n \n // //validate response params are \"^[a-zA-Z0-9_]*$\"\n for (var l=0; l 0 otherwise 0=passes test\n is_camel_case = (resp_keys.length > 0 ? (is_camel_case > 0 ? \"No\" : \"Yes\") : \"N/A\" ) + spacer;\n \n //if has_bool_vals > 0, Yes -- otherwise blank, because we can't predict the params should be bool right now\n has_bool_vals = (resp_keys.length > 0 ? (has_bool_vals > 0 ? \"Yes\" : \"\") : \"N/A\" ) + spacer;\n \n //if resp_is_unixtime, there's a good chance we have dates\n resp_is_unixtime = (resp_keys.length > 0 ? (resp_is_unixtime > 1 ? \"Yes\" : \"\") : \"N/A\" ) + spacer;\n \n //do we have any empty strings or empty arrays? Return No if we do, becasue this is bad. If we don't return blank because we need to eyeball verify\n has_empties = (resp_keys.length > 0 ? (has_empties > 0 ? \"Yes\" : \"\") : \"N/A\" ) + spacer;\n \n //if we have params that are called \"link\"\n pagination_params = (resp_keys.length > 0 ? (pagination_params > 0 ? \"Yes\" : \"No\") : \"N/A\" ) + spacer;\n \n var validation_block = result_key_check + is_camel_case + has_bool_vals + resp_is_unixtime + \n has_empties + pagination_params + todays_date;\n \n /*\n The following would require making a second call to the endpoint, but we can't parse the response right now, so this will wait - Matt Bernier 12/9/15\n \t\t\t\t\t\t\tError block follows guidelines\t\n \t\t\t\t\t\t\tError codes conform to allowed Response Codes\t\n \t\t\t\t\t\t\tDate Updated\n */\n \n\n \n var error_block = spacer + spacer + spacer + todays_date;\n \n //put the blocks together in one string for output\n output += accept_header_block + \n request_body_block + \n authorization_block + \n headers_block + \n validation_block +\n error_block;\n \n // This is how we set the output! \n var current_body = response.body.get();\n //response.body.set(current_body + output);\n //response.body.set(output);\n response.logInfo({audit_results:output});\n /*\n Need echo.stoplight.io spec to make this work\n SL.sendRequest(request.method.get(), request.url.path.get(), 'application/json', request.body.get(), {\"headers\" : request.header.get()});\n */\n}" + }, + "RunSpecifiedTests": { + "description": "", + "name": "RunSpecifiedTests", + "script": "//This will only run if you have ?test=something on the query string\n//See the Master Environment \"After\" Scripts for the logic that gets us to this test\n//@todo we will need to secure this somehow so that no one else but SendGrid can run these tests.\n\nfunction(ctx, request, response) {\n // This should be able to call other tests, based on the request param \"test\"\n var resp_body = response.body.get();\n var test_responses = {\"what?\": \"Yeah dude\"};\n \n var tests = [\"string_camel_case\"];//these could be passed in the request body\n \n if (resp_body.test) {\n tests = request.body.get('test');\n }\n \n resp_body.tests = \"\";\n \n //@todo we will need to test whether this is an object or an array first, then inspect either params or an array of objects\n //@todo we really need to parse through the response object (rather than the tests) and pass the data to the test function\n for (var i=0; i < tests.length; i++) {\n \n //test = \"SL.utilities.Validator_\"+tests[i]+\"()\";\n var test = \"SL.utilities.Validator_string_camel_case()\";\n \n resp_body.tests += (resp_body.tests.length > 1 ? \",\" : \"\") + tests[i] + \":\" + eval(test);\n \n }\n \n response.body.set(resp_body); \n}" + }, + "Validator_header": { + "description": "", + "name": "Validator_header", + "script": "function(response, header, testString) {\n \n if (test) {\n return (response.header.get(header).indexOf(testString) != -1 ? \"Yes\\t\" : \"No\\t\");\n } else {\n \n return (response.header.get(header) ? \"Yes\\t\" : \"No\\t\");\n }\n}" + }, + "Validator_is_array": { + "description": "", + "name": "Validator_is_array", + "script": "function(item) {\n return Array.isArray(item);\n}" + }, + "Validator_is_boolean": { + "description": "", + "name": "Validator_is_boolean", + "script": "function(item) {\n return typeof item === \"boolean\"\n}" + }, + "Validator_is_null": { + "description": "", + "name": "Validator_is_null", + "script": "function(item) {\n return (item === null && typeof item === \"object\");\n}" + }, + "Validator_is_number": { + "description": "", + "name": "Validator_is_number", + "script": "function(item) {\n return typeof item === \"number\"\n}" + }, + "Validator_is_object": { + "description": "", + "name": "Validator_is_object", + "script": "function(item) {\n return typeof item === \"object\"\n}" + }, + "Validator_is_string": { + "description": "", + "name": "Validator_is_string", + "script": "function(item) {\n // You have access to the global SL object here.\n // You can change the function parameters to whatever you like.\n return typeof item === \"string\"\n}" + }, + "Validator_obj_has_key_value": { + "description": "", + "name": "Validator_obj_has_key_value", + "script": "function(obj, key) {\n // You have access to the global SL object here.\n // You can change the function parameters to whatever you like.\n return (obj.key);\n}" + }, + "Validator_obj_has_value": { + "description": "", + "name": "Validator_obj_has_value", + "script": "function(obj, key, value) {\n // You have access to the global SL object here.\n // You can change the function parameters to whatever you like.\n return (SL.utilities.Validator_obj_has_value(obj, key) && obj.key == value);\n}" + }, + "Validator_string_camel_case": { + "description": "", + "name": "Validator_string_camel_case", + "script": "function(string) {\n \n var regex_camel_case = new RegExp(\"[a-z0-9_]*$\");\n \n return (regex_camel_case.exec(rq_keys[i]) ? true : false);\n \n}" + }, + "VerifyAuthWithMockingOn": { + "description": "", + "name": "VerifyAuthWithMockingOn", + "script": "/*\nWritten by Marc@stoplight.io\n*/\nfunction (ctx, request) {\n // if mocking is enabled for this request\n if (ctx.mock.get()) {\n // does this request match an endpoint, and if so, does that\n // endpoint definition have auth required?\n if (ctx.endpoint && ctx.endpoint.auth.required()) {\n if (request.header.get('Authorization') === '') {\n // respond immediately with a 403, or whatever you normally\n // respond with for auth errors.\n request.hijack(401, 'application/json', {\n error: \"Authorization required\"\n })\n }\n } \n }\n}" + }, + "addRandomLatency": { + "description": "Sleep for a random amount of time. Useful to simulate latency.", + "name": "addRandomLatency", + "script": "function (min, max) {\n SL.sleep(SL.rand(min, max))\n}" + }, + "onlyProcessPath": { + "description": "If your API lives at a subpath, for example, localhost:3000/api, then this function is useful to only learn / log requests that match the given subpath.", + "name": "onlyProcessPath", + "script": "function (ctx, request, subpath) {\n // for example, onlyProcessPath(ctx, request, \"api\") will turn off logging/learning for any\n // requests that don't have \"api\" in their path.\n if (request.url.path.get().indexOf(subpath) == -1) {\n ctx.log.set(false)\n ctx.learn.set(false)\n }\n}" + }, + "queryStringMocking": { + "description": "This extends the basic mocking functionality, and makes it possible to control mocking behavior via the request query string.", + "name": "queryStringMocking", + "script": "function (ctx, request) {\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}" + }, + "validateRequest": { + "description": "Calling this function will validate the request, and add a request header indicating wether or not validation passed. It also adds all the validation errors to the entry messages, which are viewable in an entry tab.", + "name": "validateRequest", + "script": "function (ctx, request) {\n var messages = request.validate(),\n isValid = true\n\n if (messages.length) {\n isValid = false\n\n for (var i in messages) {\n request.logError(messages[i])\n }\n\n // Uncomment the line below to respond immediately\n // with the validation error messages. Useful to let\n // developers know exactly what is wrong with their API request.\n //\n // var response = request.hijack(400, \"application/json\", messages)\n }\n\n request.header.set(\"Validation-Passed\", isValid)\n ctx.isValid = isValid\n request.valid.set(isValid)\n}" + }, + "validateResponse": { + "description": "Calling this function will validate the response, and add a response header indicating wether or not validation passed. It also adds all the validation errors to the entry messages, which are viewable in an entry tab. Lastly, it extends mocking with useful error messages.", + "name": "validateResponse", + "script": "function (ctx, response) {\n var messages = response.validate(),\n isValid = true\n \n if (messages.length) {\n isValid = false\n for (var i in messages) {\n response.logError(messages[i])\n }\n \n // If mocking is enabled and validation fails, this means \n // the example mock we've set for this endpoint/status code \n // does not match the schema.. we don't want developers working \n // off of an invalid example, so here we ovewrite the response\n // with the the validation error messages.\n if (ctx.mock.enabled.get()) {\n response.body.set(messages)\n }\n }\n \n response.header.set(\"Validation-Passed\", isValid)\n ctx.isValid = isValid\n response.valid.set(isValid)\n}" + } + }, + "mock": { + "dynamic": false, + "enabled": false + }, + "textSections": {}, + "version": { + "groups": { + "docs": [ + { + "items": [ + { + "_id": "POST_mail-send-beta", + "type": "endpoints" + }, + { + "_id": "email_object", + "type": "schemas" + }, + { + "_id": "errors", + "type": "schemas" + } + ], + "name": "Mail Send" + }, + { + "items": [ + { + "_id": "GET_accesssettings-activity", + "type": "endpoints" + }, + { + "_id": "GET_accesssettings-whitelist", + "type": "endpoints" + }, + { + "_id": "POST_accesssettings-whitelist", + "type": "endpoints" + }, + { + "_id": "DELETE_accesssettings-whitelist", + "type": "endpoints" + }, + { + "_id": "GET_accesssettings-whitelist-ruleid", + "type": "endpoints" + }, + { + "_id": "DELETE_accesssettings-whitelist-ruleid", + "type": "endpoints" + } + ], + "name": "IP Access Management" + }, + { + "items": [ + { + "_id": "api_key_name_id", + "type": "schemas" + }, + { + "_id": "api_key_name_id_scopes", + "type": "schemas" + }, + { + "_id": "GET_apikeys", + "type": "endpoints" + }, + { + "_id": "POST_apikeys", + "type": "endpoints" + }, + { + "_id": "GET_apikeys-apikeyid", + "type": "endpoints" + }, + { + "_id": "DELETE_apikeys-apikeyid", + "type": "endpoints" + }, + { + "_id": "PATCH_apikeys-apikeyid", + "type": "endpoints" + }, + { + "_id": "PUT_apikeys-apikeyid", + "type": "endpoints" + } + ], + "name": "API Keys" + }, + { + "items": [ + { + "_id": "GET_scopes", + "type": "endpoints" + } + ], + "name": "API Key Permissions" + }, + { + "description": null, + "items": [ + { + "_id": "GET_suppression-blocks", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-blocks", + "type": "endpoints" + }, + { + "_id": "GET_suppression-blocks-email", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-blocks-email", + "type": "endpoints" + } + ], + "name": "Blocks API" + }, + { + "items": [ + { + "_id": "suppression_bounce", + "type": "schemas" + }, + { + "_id": "GET_suppression-bounces", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-bounces", + "type": "endpoints" + }, + { + "_id": "GET_suppression-bounces-email", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-bounces-email", + "type": "endpoints" + } + ], + "name": "Bounces API" + }, + { + "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" + }, + { + "items": [ + { + "_id": "mail_batch_id", + "type": "schemas" + }, + { + "_id": "POST_mail-batch", + "type": "endpoints" + }, + { + "_id": "GET_mail-batch-batchid", + "type": "endpoints" + }, + { + "_id": "POST_user-scheduledsends", + "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" + } + ], + "name": "Cancel Scheduled Sends" + }, + { + "items": [ + { + "_id": "GET_categories", + "type": "endpoints" + } + ], + "name": "Categories" + }, + { + "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" + }, + { + "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" + }, + { + "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": "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" + } + ], + "name": "Contacts API - Recipients" + }, + { + "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" + }, + { + "items": [ + { + "_id": "credentials", + "type": "schemas" + } + ], + "name": "Credentials" + }, + { + "description": null, + "items": [ + { + "_id": "GET_suppression-invalidemails", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-invalidemails", + "type": "endpoints" + }, + { + "_id": "GET_suppression-invalidemails-email", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-invalidemails-email", + "type": "endpoints" + } + ], + "name": "Invalid Emails API" + }, + { + "items": [ + { + "_id": "POST_ips-pools-poolname-ips", + "type": "endpoints" + }, + { + "_id": "GET_ips", + "type": "endpoints" + }, + { + "_id": "GET_ips-assigned", + "type": "endpoints" + }, + { + "_id": "GET_ips-ipaddress", + "type": "endpoints" + }, + { + "_id": "DELETE_ips-pools-poolname-ips-ip", + "type": "endpoints" + } + ], + "name": "IP Addresses" + }, + { + "items": [ + { + "_id": "ip_pool", + "type": "schemas" + }, + { + "_id": "POST_ips-pools", + "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" + } + ], + "name": "IP Pools" + }, + { + "items": [ + { + "_id": "ip_warmup_response", + "type": "schemas" + }, + { + "_id": "GET_ips-warmup", + "type": "endpoints" + }, + { + "_id": "GET_ips-warmup-ipaddress", + "type": "endpoints" + }, + { + "_id": "POST_ips-warmup", + "type": "endpoints" + }, + { + "_id": "DELETE_ips-warmup-ipaddress", + "type": "endpoints" + } + ], + "name": "IP Warmup" + }, + { + "items": [ + { + "_id": "GET_user-settings-enforcedtls", + "type": "endpoints" + }, + { + "_id": "PATCH_user-settings-enforcedtls", + "type": "endpoints" + } + ], + "name": "Settings - Enforced TLS" + }, + { + "items": [ + { + "_id": "mail_settings_address_whitelabel", + "type": "schemas" + }, + { + "_id": "mail_settings_bcc", + "type": "schemas" + }, + { + "_id": "mail_settings_bounce_purge", + "type": "schemas" + }, + { + "_id": "mail_settings_footer", + "type": "schemas" + }, + { + "_id": "mail_settings_forward_bounce", + "type": "schemas" + }, + { + "_id": "mail_settings_forward_spam", + "type": "schemas" + }, + { + "_id": "mail_settings_spam_check", + "type": "schemas" + }, + { + "_id": "mail_settings_template", + "type": "schemas" + }, + { + "_id": "mail_settings_patch", + "type": "schemas" + }, + { + "_id": "GET_mailsettings", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-bcc", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-bcc", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-addresswhitelist", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-addresswhitelist", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-footer", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-footer", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-forwardspam", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-forwardspam", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-plaincontent", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-plaincontent", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-spamcheck", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-spamcheck", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-template", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-template", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-bouncepurge", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-bouncepurge", + "type": "endpoints" + }, + { + "_id": "GET_mailsettings-forwardbounce", + "type": "endpoints" + }, + { + "_id": "PATCH_mailsettings-forwardbounce", + "type": "endpoints" + } + ], + "name": "Settings - Mail" + }, + { + "items": [ + { + "_id": "partner_settings_new_relic", + "type": "schemas" + }, + { + "_id": "GET_partnersettings", + "type": "endpoints" + }, + { + "_id": "GET_partnersettings-newrelic", + "type": "endpoints" + }, + { + "_id": "PATCH_partnersettings-newrelic", + "type": "endpoints" + } + ], + "name": "Settings - Partner" + }, + { + "items": [ + { + "_id": "subscription_tracking_settings", + "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": null, + "items": [ + { + "_id": "GET_suppression-spamreports", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-spamreports", + "type": "endpoints" + }, + { + "_id": "GET_suppression-spamreport-email", + "type": "endpoints" + }, + { + "_id": "DELETE_suppression-spamreport-email", + "type": "endpoints" + } + ], + "name": "Spam Reports API" + }, + { + "items": [ + { + "_id": "GET_stats", + "type": "endpoints" + } + ], + "name": "Stats - Global Stats" + }, + { + "items": [ + { + "_id": "category_stats", + "type": "schemas" + }, + { + "_id": "GET_categories-stats", + "type": "endpoints" + }, + { + "_id": "GET_categories-stats-sums", + "type": "endpoints" + } + ], + "name": "Stats - Category Stats" + }, + { + "items": [ + { + "_id": "stats", + "type": "schemas" + }, + { + "_id": "subuser_stats", + "type": "schemas" + }, + { + "_id": "GET_subusers-stats", + "type": "endpoints" + }, + { + "_id": "GET_subusers-stats-sums", + "type": "endpoints" + }, + { + "_id": "GET_subusers-stats-monthly", + "type": "endpoints" + }, + { + "_id": "GET_subusers-subusername-stats-monthly", + "type": "endpoints" + } + ], + "name": "Stats - Subuser Stats" + }, + { + "items": [ + { + "_id": "advanced_stats_mailbox_provider", + "type": "schemas" + }, + { + "_id": "advanced_stats_clicks", + "type": "schemas" + }, + { + "_id": "advanced_stats_opens", + "type": "schemas" + }, + { + "_id": "advanced_stats_country", + "type": "schemas" + }, + { + "_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" + } + ], + "name": "Stats - Advanced Stats" + }, + { + "items": [ + { + "_id": "GET_user-webhooks-parse-stats", + "type": "endpoints" + } + ], + "name": "Stats - Parse Webhook Stats" + }, + { + "items": [ + { + "_id": "subuser", + "type": "schemas" + }, + { + "_id": "subuser_post", + "type": "schemas" + }, + { + "_id": "monitor", + "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-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" + }, + { + "_id": "GET_subusers-reputations", + "type": "endpoints" + }, + { + "_id": "PUT_subusers-subusername-ips", + "type": "endpoints" + } + ], + "name": "Subusers API" + }, + { + "items": [ + { + "_id": "suppression_group_unsubscribes", + "type": "schemas" + }, + { + "_id": "suppression_group", + "type": "schemas" + }, + { + "_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" + } + ], + "name": "Suppression Management - Unsubscribe Groups" + }, + { + "items": [ + { + "_id": "POST_asm-groups-groupid-suppressions", + "type": "endpoints" + }, + { + "_id": "GET_asm-groups-groupid-suppressions", + "type": "endpoints" + }, + { + "_id": "DELETE_asm-groups-groupid-suppressions-email", + "type": "endpoints" + }, + { + "_id": "GET_asm-suppressions", + "type": "endpoints" + }, + { + "_id": "GET_asm-suppressions-email", + "type": "endpoints" + }, + { + "_id": "POST_asm-groups-groupid-suppressions", + "type": "endpoints" + } + ], + "name": "Suppression Management - Suppressions" + }, + { + "items": [ + { + "_id": "GET_suppression-unsubscribes", + "type": "endpoints" + }, + { + "_id": "POST_asm-suppressions-global", + "type": "endpoints" + }, + { + "_id": "GET_asm-suppressions-global-email", + "type": "endpoints" + }, + { + "_id": "DELETE_asm-suppressions-global-email", + "type": "endpoints" + } + ], + "name": "Suppression Management - Global Suppressions" + }, + { + "items": [ + { + "_id": "transactional_template", + "type": "schemas" + }, + { + "_id": "POST_templates", + "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" + }, + { + "items": [ + { + "_id": "transactional_template_version", + "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" + }, + { + "items": [ + { + "_id": "user_scheduled_send_status", + "type": "schemas" + }, + { + "_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": null, + "items": [ + { + "_id": "event_webhook_settings", + "type": "schemas" + }, + { + "_id": "GET_user-webhooks-event-settings", + "type": "endpoints" + }, + { + "_id": "PATCH_user-webhooks-event-settings", + "type": "endpoints" + }, + { + "_id": "POST_user-webhooks-event-test", + "type": "endpoints" + }, + { + "_id": "GET_user-webhooks-parse-settings", + "type": "endpoints" + } + ], + "name": "Webhooks" + }, + { + "items": [ + { + "_id": "whitelabel::domain", + "type": "schemas" + }, + { + "_id": "whitelabel:domain_spf", + "type": "schemas" + }, + { + "_id": "GET_whitelabel-domains", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-domains", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-domains-domainid", + "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": "Whitelabel - Domains" + }, + { + "items": [ + { + "_id": "ip_whitelabel", + "type": "schemas" + }, + { + "_id": "GET_whitelabel-ips", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-ips", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-ips-id", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-ips-id", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-ips-id-validate", + "type": "endpoints" + } + ], + "name": "Whitelabel - IPs" + }, + { + "items": [ + { + "_id": "link_whitelabel", + "type": "schemas" + }, + { + "_id": "GET_whitelabel-links", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-links", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-links-id", + "type": "endpoints" + }, + { + "_id": "PATCH_whitelabel-links-id", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-links-id", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-links-default", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-links-id-validate", + "type": "endpoints" + }, + { + "_id": "GET_whitelabel-links-subuser", + "type": "endpoints" + }, + { + "_id": "DELETE_whitelabel-links-subuser", + "type": "endpoints" + }, + { + "_id": "POST_whitelabel-links-linkid-subuser", + "type": "endpoints" + } + ], + "name": "Whitelabel - Links" + }, + { + "items": [ + { + "_id": "global:ErrorResponse", + "type": "schemas" + }, + { + "_id": "global:id", + "type": "schemas" + }, + { + "_id": "global:empty_request", + "type": "schemas" + } + ], + "name": "Global" + } + ], + "utilFuncs": [ + { + "_id": "ZwcqTZkzjF2hNntT5", + "items": [ + { + "_id": "ieMJ5BCmAnf6ZdkaA", + "type": "utilFuncs" + }, + { + "_id": "SYZMwqfdvsyj8dgKq", + "type": "utilFuncs" + }, + { + "_id": "AMhRq4HwRmT4EME5F", + "type": "utilFuncs" + }, + { + "_id": "9DJJvt8QQ8aqK2g5E", + "type": "utilFuncs" + }, + { + "_id": "46FovcZCtnsXfFYoY", + "type": "utilFuncs" + }, + { + "_id": "ggjEf8YBnJwXJHoiG", + "type": "utilFuncs" + }, + { + "_id": "Nk8T4vxmmetE9CPjJ", + "type": "utilFuncs" + }, + { + "_id": "eNwcffGK7GTQfBYZ6", + "type": "utilFuncs" + }, + { + "_id": "KkZGt3WpDLgEr37WD", + "type": "utilFuncs" + }, + { + "_id": "GMsTXdfaEoZDRYtmR", + "type": "utilFuncs" + } + ], + "name": "Validators" + }, + { + "_id": "WFhNwgMKnYBKn3sEk", + "items": [ + { + "_id": "htyRsPnxibgYjw5MA", + "type": "utilFuncs" + }, + { + "_id": "pyhvF3auvfitRBxSW", + "type": "utilFuncs" + } + ], + "name": "mb@sendgrid.com" + }, + { + "_id": "g7GwFhQGL4sDdSATe", + "items": [ + { + "_id": "RcX8K7AvAAATrt9r4", + "type": "utilFuncs" + } + ], + "name": "marc@stoplight.io" + }, + { + "_id": "LtG5iuBuCSgTfGioT", + "items": [ + { + "_id": "563a5309daad691100fb05b2", + "type": "utilFuncs" + }, + { + "_id": "563a5309daad691100fb05b4", + "type": "utilFuncs" + }, + { + "_id": "563a5309daad691100fb05b3", + "type": "utilFuncs" + }, + { + "_id": "563a5309daad691100fb05ae", + "type": "utilFuncs" + }, + { + "_id": "563a5309daad691100fb05b0", + "type": "utilFuncs" + } + ], + "name": "Stoplight Defaults" + } + ] + } + } + } +}