object segment_write
{
  "type": "object",
  "title": "segment_write",
  "required": [
    "name",
    "query_dsl"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1
    },
    "query_dsl": {
      "type": "string",
      "description": "Use this field for adding your query string."
    }
  }
}
object segment_write_v2
{
  "type": "object",
  "title": "segment_write",
  "required": [
    "name",
    "query_dsl"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "description": "Name of the segment."
    },
    "query_dsl": {
      "type": "string",
      "description": "SQL query which will filter contacts based on the conditions provided"
    },
    "parent_list_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future",
      "uniqueItems": true
    }
  }
}
object selfmetadata
{
  "type": "object",
  "title": "selfMetadata",
  "properties": {
    "self": {
      "type": "string",
      "description": "A link to this object."
    }
  }
}
object sender-id-request
{
  "type": "object",
  "title": "Sender ID Request",
  "example": {
    "zip": "80202",
    "city": "Denver",
    "from": {
      "name": "Example INC",
      "email": "from@example.com"
    },
    "state": "Colorado",
    "address": "123 Elm St.",
    "country": "United States",
    "nickname": "My Sender ID",
    "reply_to": {
      "name": "Example INC",
      "email": "replyto@example.com"
    },
    "address_2": "Apt. 456"
  },
  "properties": {
    "zip": {
      "type": "string",
      "description": "The zipcode of the sender identity."
    },
    "city": {
      "type": "string",
      "description": "The city of the sender identity."
    },
    "from": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name appended to the from email field. Typically your name or company name."
        },
        "email": {
          "type": "string",
          "description": "The email address from which your recipient will receive emails."
        }
      }
    },
    "state": {
      "type": "string",
      "description": "The state of the sender identity."
    },
    "address": {
      "type": "string",
      "description": "The physical address of the sender identity."
    },
    "country": {
      "type": "string",
      "description": "The country of the sender identity."
    },
    "nickname": {
      "type": "string",
      "description": "A nickname for the sender identity. Not used for sending."
    },
    "reply_to": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name appended to the reply to email field. Typically your name or company name."
        },
        "email": {
          "type": "string",
          "description": "The email address to which your recipient will reply."
        }
      }
    },
    "address_2": {
      "type": "string",
      "description": "Additional sender identity address information."
    }
  }
}
object senderID
{
  "allOf": [
    {
      "$ref": "#/components/schemas/sender-id-request"
    },
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The unique identifier of the sender identity."
        },
        "locked": {
          "type": "boolean",
          "description": "True when the sender id is associated to a campaign in the Draft, Scheduled, or In Progress status. You cannot update or delete a locked sender identity."
        },
        "verified": {
          "type": "boolean",
          "description": "If the sender identity is verified or not. Only verified sender identities can be used to send email."
        },
        "created_at": {
          "type": "integer",
          "description": "The time the sender identity was created."
        },
        "updated_at": {
          "type": "integer",
          "description": "The time the sender identity was last updated."
        }
      }
    },
    {
      "type": "object",
      "required": [
        "nickname",
        "address",
        "city",
        "country"
      ]
    }
  ],
  "title": "Sender ID",
  "example": {
    "id": 1,
    "zip": "80202",
    "city": "Denver",
    "from": {
      "name": "Example INC",
      "email": "from@example.com"
    },
    "state": "Colorado",
    "locked": false,
    "address": "123 Elm St.",
    "country": "United States",
    "nickname": "My Sender ID",
    "reply_to": {
      "name": "Example INC",
      "email": "replyto@example.com"
    },
    "verified": true,
    "address_2": "Apt. 456",
    "created_at": 1449872165,
    "updated_at": 1449872165
  }
}
object senders-id-request-body
{
  "type": "object",
  "title": "Senders ID Request Body",
  "required": [
    "nickname",
    "from",
    "address",
    "city",
    "country"
  ],
  "properties": {
    "zip": {
      "type": "string",
      "description": "The zipcode of the sender identity."
    },
    "city": {
      "type": "string",
      "description": "The city of the sender identity."
    },
    "from": {
      "type": "object",
      "required": [
        "email",
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "This is the name appended to the from email field. IE - Your name or company name."
        },
        "email": {
          "type": "string",
          "description": "This is where the email will appear to originate from for your recipient"
        }
      }
    },
    "state": {
      "type": "string",
      "description": "The state of the sender identity."
    },
    "address": {
      "type": "string",
      "description": "The physical address of the sender identity."
    },
    "country": {
      "type": "string",
      "description": "The country of the sender identity."
    },
    "nickname": {
      "type": "string",
      "description": "A nickname for the sender identity. Not used for sending."
    },
    "reply_to": {
      "type": "object",
      "required": [
        "email"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "This is the name appended to the reply to email field. IE - Your name or company name."
        },
        "email": {
          "type": "string",
          "description": "This is the email that your recipient will reply to."
        }
      }
    },
    "address_2": {
      "type": "string",
      "description": "Additional sender identity address information."
    }
  }
}
object single-contact-request
{
  "type": "object",
  "title": "single contact request",
  "properties": {
    "contact": {
      "type": "object",
      "properties": {
        "city": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "postal_code": {
          "type": "string"
        },
        "custom_fields": {
          "type": "object",
          "properties": {
            "custom_field_name1": {
              "type": "string"
            },
            "custom_field_name2": {
              "type": "string"
            }
          }
        },
        "primary_email": {
          "type": "string"
        },
        "address_line_1": {
          "type": "string"
        },
        "address_line_2": {
          "type": "string"
        },
        "alternate_emails": {
          "type": "string"
        },
        "state_province_region": {
          "type": "string"
        }
      }
    },
    "list_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "maxItems": 100,
      "minItems": 0,
      "description": "The contact's list IDs."
    }
  }
}
object singlesend_request
{
  "type": "object",
  "title": "singlesend_request",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "description": "The name of the Single Send."
    },
    "send_at": {
      "type": "string",
      "format": "date-time",
      "description": "The ISO 8601 time at which to send the Single Send — this must be set for a future time."
    },
    "send_to": {
      "type": "object",
      "properties": {
        "all": {
          "type": "boolean",
          "default": false,
          "description": "Set to `true` to send to All Contacts. If set to `false`, at least one `list_ids` or `segment_ids` value must be provided before the Single Send is scheduled to be sent to recipients."
        },
        "list_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "maxItems": 10,
          "description": "The recipient List IDs that will receive the Single Send."
        },
        "segment_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "maxItems": 10,
          "description": "The recipient Segment IDs that will receive the Single Send."
        }
      }
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10,
      "description": "The categories to associate with this Single Send.",
      "uniqueItems": true
    },
    "email_config": {
      "type": "object",
      "properties": {
        "editor": {
          "enum": [
            "code",
            "design"
          ],
          "type": "string",
          "default": "code",
          "description": "The editor — `\"design\"` or `\"code\"` — used to modify the Single Send's design in the Marketing Campaigns App."
        },
        "ip_pool": {
          "type": "string",
          "nullable": true,
          "description": "The name of the IP Pool from which the Single Send emails are sent."
        },
        "subject": {
          "type": "string",
          "description": "The subject line of the Single Send. Do not include this field when using a `design_id`."
        },
        "design_id": {
          "type": "string",
          "description": "A `design_id` can be used in place of `html_content`, `plain_content`, and/or `subject`. You can retrieve a design's ID from the [\"List Designs\" endpoint](https://sendgrid.api-docs.io/v3.0/designs-api/list-designs) or by pulling it from the design's detail page URL in the Marketing Campaigns App."
        },
        "sender_id": {
          "type": "integer",
          "nullable": true,
          "description": "The ID of the verified Sender. You can retrieve a verified Sender's ID from the [\"Get Verified Senders\" endpoint](https://sendgrid.api-docs.io/v3.0/sender-verification/get-verified-senders) or by pulling it from the Sender's detail page URL in the SendGrid App."
        },
        "html_content": {
          "type": "string",
          "description": "The HTML content of the Single Send. Do not include this field when using a `design_id`."
        },
        "plain_content": {
          "type": "string",
          "description": "The plain text content of the Single Send. Do not include this field when using a `design_id`."
        },
        "suppression_group_id": {
          "type": "integer",
          "nullable": true,
          "description": "The ID of the Suppression Group to allow recipients to unsubscribe — you must provide this or the `custom_unsubscribe_url`."
        },
        "custom_unsubscribe_url": {
          "type": "string",
          "format": "uri",
          "nullable": true,
          "description": "The URL allowing recipients to unsubscribe — you must provide this or the `suppression_group_id`."
        },
        "generate_plain_content": {
          "type": "boolean",
          "default": true,
          "description": "If set to `true`, `plain_content` is always generated from `html_content`. If set to false, `plain_content` is not altered."
        }
      }
    }
  }
}
object singlesend_response
{
  "allOf": [
    {
      "$ref": "#/components/schemas/singlesend_request"
    },
    {
      "type": "object",
      "required": [
        "id",
        "status",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "status": {
          "enum": [
            "draft",
            "scheduled",
            "triggered"
          ],
          "type": "string",
          "description": "current status of the Single Send"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "warning_id": {
                "type": "string"
              }
            }
          }
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "the ISO 8601 time at which the Single Send was created"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "the ISO 8601 time at which the Single Send was last updated"
        }
      }
    }
  ],
  "title": "singlesend_response",
  "example": {
    "id": "27c21bbf-a12c-440b-b8bf-c526975328caX",
    "name": "Example API Created Single Send",
    "status": "scheduled",
    "send_at": "2020-06-16T00:19:55.106Z",
    "send_to": {
      "list_ids": [
        "f2fe66a1-43f3-4e3a-87b1-c6a600d805f0"
      ]
    },
    "categories": [
      "unique opens"
    ],
    "created_at": "2020-05-18T17:28:27.272Z",
    "email_config": {
      "editor": "code",
      "ip_pool": null,
      "subject": "",
      "sender_id": null,
      "html_content": "",
      "plain_content": "",
      "suppression_group_id": null,
      "custom_unsubscribe_url": null,
      "generate_plain_content": true
    }
  }
}
object singlesend_response_short
{
  "type": "object",
  "title": "singlesend_response_short",
  "required": [
    "id",
    "name",
    "abtest",
    "status",
    "categories",
    "is_abtest",
    "updated_at",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "description": "name of the Single Send"
    },
    "abtest": {
      "$ref": "#/components/schemas/abtest_summary"
    },
    "status": {
      "enum": [
        "draft",
        "scheduled",
        "triggered"
      ],
      "type": "string",
      "description": "current status of the Single Send"
    },
    "send_at": {
      "type": "string",
      "format": "date-time",
      "description": "the ISO 8601 time at which to send the Single Send; must be in future"
    },
    "is_abtest": {
      "type": "boolean",
      "description": "true if the Single Send's AB Test functionality has been toggled on"
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10,
      "description": "categories to associate with this Single Send",
      "uniqueItems": true
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "the ISO 8601 time at which the Single Send was created"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "the ISO 8601 time at which the Single Send was last updated"
    }
  }
}
object singlesend_schedule
{
  "type": "object",
  "title": "singlesend-schedule",
  "required": [
    "send_at"
  ],
  "properties": {
    "status": {
      "enum": [
        "draft",
        "scheduled",
        "triggered"
      ],
      "type": "string"
    },
    "send_at": {
      "type": "string",
      "format": "date-time",
      "description": "This is the ISO 8601 time at which to send the Single Send; must be in future, or the string \"now\""
    }
  }
}
object singlesend_search
{
  "type": "object",
  "title": "singlesend_search",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "description": "leading and trailing wildcard search on name of the Single Send"
    },
    "status": {
      "type": "array",
      "items": {
        "enum": [
          "draft",
          "scheduled",
          "triggered"
        ],
        "type": "string"
      },
      "description": "current status of the Single Send",
      "uniqueItems": true
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "categories to associate with this Single Send, match any single send that has at least one of the categories",
      "uniqueItems": true
    }
  }
}
object singlesend_warning
{
  "type": "object",
  "title": "singlesend_warning",
  "properties": {
    "warnings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "warning_id": {
            "type": "string"
          }
        }
      }
    }
  }
}
object singlesends-link-stats-response
{
  "type": "object",
  "title": "singlesends-link-stats-response",
  "required": [
    "results",
    "_metadata"
  ],
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "url",
          "ab_variation",
          "ab_phase",
          "clicks"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "This is the URL of the link clicked. If `{{custom_fields}}` are part of the URL, they will be included."
          },
          "clicks": {
            "type": "integer",
            "minimum": 1,
            "description": "the number of clicks on this particular link"
          },
          "ab_phase": {
            "enum": [
              "send",
              "test",
              "all"
            ],
            "type": "string",
            "description": "This is the A/B phase of the Single Send stat returned. If the `ab_phase` query parameter was not provided, it will return `\"all\"`."
          },
          "ab_variation": {
            "type": "string",
            "format": "uuid",
            "description": "This is the A/B variation of the Single Send stat returned. It is set to `\"all\"` if the `ab_variation` query parameter was not set in the request and `group_by` doesn't contain `ab_variation`."
          },
          "url_location": {
            "type": "integer",
            "minimum": 0,
            "description": "This is the location of the link clicked in each Single Send A/B variation, or in the Single Send itself if there are no variations. Links are numbered from the top down; the topmost link is index `0`."
          }
        }
      },
      "description": "This is the index of the link's location in the email contents."
    },
    "_metadata": {
      "$ref": "#/components/schemas/link-tracking-metadata"
    },
    "total_clicks": {
      "type": "integer"
    }
  }
}
object singlesends-response
{
  "type": "object",
  "title": "singlesends-response",
  "required": [
    "results",
    "_metadata"
  ],
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "ab_variation",
          "ab_phase"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "This is the ID of the Single Dend you require stats for."
          },
          "stats": {
            "$ref": "#/components/schemas/metrics"
          },
          "ab_phase": {
            "enum": [
              "send",
              "test",
              "all"
            ],
            "type": "string",
            "default": "all",
            "description": "This is the A/B phase of the Single Send stat returned. If the `group_by` parameter doesn't include `ab_phase` in the request, then the value is \"all\"."
          },
          "aggregation": {
            "type": "string",
            "default": "total",
            "description": "This describes the time unit to which the stat is rolled up. It is based on the `aggregated_by` parameter included in the request. It can be \"total\" or the date (in YYYY-MM-DD format) the stats are for."
          },
          "ab_variation": {
            "type": "string",
            "format": "uuid",
            "default": "all",
            "description": "This is the A/B variation of the Single Send stat returned. If the `group_by` parameter doesn't include `ab_variation` in the request, then the value is \"all\"."
          }
        }
      }
    },
    "_metadata": {
      "$ref": "#/components/schemas/metadata"
    }
  }
}
array spam-reports-response
{
  "type": "array",
  "items": {
    "type": "object",
    "required": [
      "created",
      "email",
      "ip"
    ],
    "properties": {
      "ip": {
        "type": "string",
        "description": "The IP address that the message was sent from."
      },
      "email": {
        "type": "string",
        "format": "email",
        "description": "The email address of the recipient that marked your message as spam."
      },
      "created": {
        "type": "integer",
        "description": "A Unix timestamp that indicates when the recipient marked your message as spam."
      }
    }
  },
  "title": "Spam Reports Response",
  "example": [
    {
      "ip": "10.63.202.100",
      "email": "user1@example.com",
      "created": 1443651141
    },
    {
      "ip": "10.63.202.100",
      "email": "user2@example.com",
      "created": 1443651154
    }
  ]
}
object sso-certificate-body
{
  "type": "object",
  "title": "Single Sign-On Certificate Body",
  "example": {
    "id": 66138975,
    "not_after": 1621289880,
    "not_before": 1621289880,
    "intergration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312",
    "public_certificate": "<your x509 certificate>"
  },
  "properties": {
    "id": {
      "type": "number",
      "description": "A unique ID assigned to the certificate by SendGrid."
    },
    "not_after": {
      "type": "number",
      "description": "A unix timestamp (e.g., 1603915954) that indicates the time after which the certificate is no longer valid."
    },
    "not_before": {
      "type": "number",
      "description": "A unix timestamp (e.g., 1603915954) that indicates the time before which the certificate is not valid."
    },
    "intergration_id": {
      "type": "string",
      "description": "An ID that matches a certificate to a specific IdP integration."
    },
    "public_certificate": {
      "type": "string",
      "description": "This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta. This is called the X509 certificate in the Twilio SendGrid UI."
    }
  }
}
array sso-error-response
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "field": {
        "type": "string",
        "nullable": true
      },
      "message": {
        "type": "string"
      },
      "error_id": {
        "type": "string"
      }
    }
  },
  "title": "SSO Error Response"
}
object sso-integration
{
  "allOf": [
    {
      "$ref": "#/components/schemas/create-integration-request"
    },
    {
      "type": "object",
      "required": [
        "last_updated"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "A unique ID assigned to the configuration by SendGrid."
        },
        "audience_url": {
          "type": "string",
          "description": "The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Single Sign-On URL when using SendGrid."
        },
        "last_updated": {
          "type": "number",
          "description": "A timestamp representing the last time the configuration was modified."
        },
        "single_signon_url": {
          "type": "string",
          "description": "The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Audience URL when using SendGrid."
        }
      }
    }
  ],
  "title": "Single Sign-On Integration"
}
object sso-teammate-common-fields
{
  "type": "object",
  "title": "Single Sing-On Teammate Common Fields",
  "required": [
    "first_name",
    "last_name",
    "email"
  ],
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "description": "The Teammate’s email address. This email address will also function as the Teammate’s username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created."
    },
    "is_admin": {
      "type": "boolean",
      "description": "Indicates if the Teammate has admin permissions."
    },
    "last_name": {
      "type": "string",
      "description": "The Teammate’s last name."
    },
    "first_name": {
      "type": "string",
      "description": "The Teammate’s first name."
    },
    "is_read_only": {
      "type": "boolean",
      "description": "Indicates if the Teammate has read_only permissions."
    }
  }
}
object sso-teammate-request
{
  "allOf": [
    {
      "$ref": "#/components/schemas/sso-teammate-common-fields"
    },
    {
      "type": "object",
      "required": [
        "scopes"
      ],
      "properties": {
        "scopes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The permission scopes assigned to the Teammate."
        }
      }
    }
  ],
  "title": "Single Sign-On Teammate Request"
}
object sso-teammate-response
{
  "allOf": [
    {
      "$ref": "#/components/schemas/sso-teammate-common-fields"
    },
    {
      "type": "object",
      "properties": {
        "is_sso": {
          "type": "boolean",
          "description": "Indicates if the Teammate authenticates with SendGrid using SSO or with a username and password."
        },
        "username": {
          "type": "string",
          "description": "This should be set to the Teammate's email address."
        }
      }
    }
  ],
  "title": "Single Sign-On Teammate Response"
}
object sso-teammates-patch-response
{
  "allOf": [
    {
      "$ref": "#/components/schemas/sso-teammate-response"
    },
    {
      "type": "object",
      "properties": {
        "zip": {
          "type": "string",
          "description": "The Teammate’s zip code."
        },
        "city": {
          "type": "string",
          "description": "The Teammate's city."
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone": {
          "type": "string",
          "description": "The Teammate’s stored phone number."
        },
        "state": {
          "type": "string",
          "description": "The Teammate’s state or province."
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The permission scopes assigned to the Teammate."
        },
        "address": {
          "type": "string",
          "description": "The Teammate’s street address."
        },
        "company": {
          "type": "string",
          "description": "The Teammate’s company name."
        },
        "country": {
          "type": "string",
          "description": "The Teammate’s country of residence."
        },
        "website": {
          "type": "string",
          "description": "A website associated with the Teammate"
        },
        "address2": {
          "type": "string",
          "description": "The Teammate’s apartment number, suite number, or other secondary address information that is not part of the physical street address."
        },
        "user_type": {
          "enum": [
            "admin",
            "owner",
            "teammate"
          ],
          "type": "string",
          "description": "A Teammate can be an “admin,” “owner,” or “teammate.” Each role is associated with the scope of the Teammate’s permissions."
        }
      }
    }
  ],
  "title": "Single Sign-On Teammates PATCH Response"
}
object stats-advanced-global-stats
{
  "allOf": [
    {
      "$ref": "#/components/schemas/advanced_stats_clicks_opens"
    },
    {
      "type": "object",
      "properties": {
        "blocks": {
          "type": "integer",
          "description": "The number of emails that were not allowed to be delivered by ISPs."
        },
        "bounces": {
          "type": "integer",
          "description": "The number of emails that bounced instead of being delivered."
        },
        "deferred": {
          "type": "integer",
          "description": "The number of emails that temporarily could not be delivered. "
        },
        "requests": {
          "type": "integer",
          "description": "The number of emails that were requested to be delivered."
        },
        "delivered": {
          "type": "integer",
          "description": "The number of emails SendGrid was able to confirm were actually delivered to a recipient."
        },
        "processed": {
          "type": "integer",
          "description": "Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed."
        },
        "bounce_drops": {
          "type": "integer",
          "description": "The number of emails that were dropped because of a bounce."
        },
        "spam_reports": {
          "type": "integer",
          "description": "The number of recipients who marked your email as spam."
        },
        "unsubscribes": {
          "type": "integer",
          "description": "The number of recipients who unsubscribed from your emails."
        },
        "invalid_emails": {
          "type": "integer",
          "description": "The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid."
        },
        "spam_report_drops": {
          "type": "integer",
          "description": "The number of emails that were dropped due to a recipient previously marking your emails as spam."
        },
        "unsubscribe_drops": {
          "type": "integer",
          "description": "The number of emails dropped due to a recipient unsubscribing from your emails."
        }
      }
    }
  ],
  "title": "Stats: Advanced Global Stats"
}
array stats-advanced-stats-base-schema
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "date": {
        "type": "string",
        "description": "The date the stats were gathered."
      },
      "stats": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "metrics": {
              "type": "object"
            }
          }
        },
        "description": "The individual email activity stats."
      }
    }
  },
  "title": "Stats: Advanced Stats Base Schema"
}
object subscription_tracking_settings
{
  "type": "object",
  "title": "Settings: Subscription Tracking",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The URL where you would like your users sent to unsubscribe."
    },
    "enabled": {
      "type": "boolean",
      "description": "Indicates if subscription tracking is enabled."
    },
    "landing": {
      "type": "string",
      "description": "The HTML that will be displayed on the page that your customers will see after clicking unsubscribe, hosted on SendGrid’s server."
    },
    "replace": {
      "type": "string",
      "description": "Your custom defined replacement tag for your templates. Use this tag to place your unsubscribe content anywhere in your emailtemplate."
    },
    "html_content": {
      "type": "string",
      "description": "The information and HTML for your unsubscribe link. "
    },
    "plain_content": {
      "type": "string",
      "description": "The information in plain text for your unsubscribe link. You should have the “<% %>” tag in your content, otherwise the user will have no URL for unsubscribing."
    }
  }
}
object subuser
{
  "type": "object",
  "title": "List all Subusers for a parent response",
  "example": {
    "id": 1234,
    "email": "example@example.com",
    "disabled": false,
    "username": "example_subuser"
  },
  "required": [
    "disabled",
    "id",
    "username",
    "email"
  ],
  "properties": {
    "id": {
      "type": "number",
      "description": "The ID of this subuser."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "The email address to contact this subuser."
    },
    "disabled": {
      "type": "boolean",
      "description": "Whether or not the user is enabled or disabled."
    },
    "username": {
      "type": "string",
      "description": "The name by which this subuser will be referred."
    }
  }
}
object subuser_post
{
  "type": "object",
  "title": "Subuser::POST",
  "example": {
    "email": "example@example.com",
    "user_id": 1234,
    "username": "example_subuser",
    "credit_allocation": {
      "type": "unlimited"
    },
    "authorization_token": "",
    "signup_session_token": ""
  },
  "required": [
    "username",
    "user_id",
    "email"
  ],
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "description": "The email address for this subuser."
    },
    "user_id": {
      "type": "number",
      "description": "The user ID for this subuser."
    },
    "username": {
      "type": "string",
      "description": "The username of the subuser."
    },
    "credit_allocation": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        }
      }
    },
    "authorization_token": {
      "type": "string"
    },
    "signup_session_token": {
      "type": "string"
    }
  }
}
object subuser_stats
{
  "type": "object",
  "title": "subuser_stats",
  "example": {
    "date": "2016-02-01T00:00:00.000Z",
    "stats": [
      {
        "name": "user1",
        "type": "subuser",
        "metrics": {
          "opens": 10,
          "blocks": 0,
          "clicks": 5,
          "bounces": 0,
          "deferred": 0,
          "requests": 10,
          "delivered": 0,
          "processed": 10,
          "bounce_drops": 0,
          "spam_reports": 0,
          "unique_opens": 0,
          "unsubscribes": 0,
          "unique_clicks": 0,
          "invalid_emails": 0,
          "spam_report_drops": 0,
          "unsubscribe_drops": 0
        },
        "last_name": "Doe",
        "first_name": "John"
      }
    ]
  },
  "properties": {
    "date": {
      "type": "string",
      "description": "The date the statistics were gathered."
    },
    "stats": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The username of the subuser."
          },
          "type": {
            "type": "string",
            "description": "The type of account."
          },
          "metrics": {
            "type": "object",
            "properties": {
              "opens": {
                "type": "integer",
                "description": "The total number of times your emails were opened by recipients."
              },
              "blocks": {
                "type": "integer",
                "description": "The number of emails that were not allowed to be delivered by ISPs."
              },
              "clicks": {
                "type": "integer",
                "description": "The number of links that were clicked in your emails."
              },
              "bounces": {
                "type": "integer",
                "description": "The number of emails that bounced instead of being delivered."
              },
              "deferred": {
                "type": "integer",
                "description": "The number of emails that temporarily could not be delivered."
              },
              "requests": {
                "type": "integer",
                "description": "The number of emails that were requested to be delivered."
              },
              "delivered": {
                "type": "integer",
                "description": "The number of emails SendGrid was able to confirm were actually delivered to a recipient."
              },
              "processed": {
                "type": "integer",
                "description": "Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed."
              },
              "bounce_drops": {
                "type": "integer",
                "description": "The number of emails that were dropped because of a bounce."
              },
              "spam_reports": {
                "type": "integer",
                "description": "The number of recipients who marked your email as spam."
              },
              "unique_opens": {
                "type": "integer",
                "description": "The number of unique recipients who opened your emails."
              },
              "unsubscribes": {
                "type": "integer",
                "description": "The number of recipients who unsubscribed from your emails."
              },
              "unique_clicks": {
                "type": "integer",
                "description": "The number of unique recipients who clicked links in your emails."
              },
              "invalid_emails": {
                "type": "integer",
                "description": "The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid."
              },
              "spam_report_drops": {
                "type": "integer",
                "description": "The number of emails that were dropped due to a recipient previously marking your emails as spam."
              },
              "unsubscribe_drops": {
                "type": "integer",
                "description": "The number of emails dropped due to a recipient unsubscribing from your emails."
              }
            }
          },
          "last_name": {
            "type": "string",
            "description": "The last name of the subuser."
          },
          "first_name": {
            "type": "string",
            "description": "The first name of the subuser."
          }
        }
      },
      "description": "The list of statistics."
    }
  }
}
object suppression-group-request-base
{
  "type": "object",
  "title": "Suppression Group Request Base",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 30,
      "description": "The name of your suppression group. Required when creating a group."
    },
    "is_default": {
      "type": "boolean",
      "description": "Indicates if you would like this to be your default suppression group."
    },
    "description": {
      "type": "string",
      "maxLength": 100,
      "description": "A brief description of your suppression group. Required when creating a group."
    }
  }
}
object suppression_group
{
  "type": "object",
  "title": "Suppressions: Suppression Group",
  "required": [
    "id",
    "name",
    "description"
  ],
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the suppression group."
    },
    "name": {
      "type": "string",
      "maxLength": 30,
      "description": "The name of the suppression group. Each group created by a user must have a unique name."
    },
    "is_default": {
      "type": "boolean",
      "default": false,
      "description": "Indicates if this is the default suppression group."
    },
    "description": {
      "type": "string",
      "maxLength": 100,
      "description": "A description of the suppression group."
    },
    "unsubscribes": {
      "type": "integer",
      "description": "The unsubscribes associated with this group."
    },
    "last_email_sent_at": {
      "nullable": true
    }
  }
}
object suppressions-request
{
  "type": "object",
  "title": "Suppressions Request Body",
  "example": {
    "recipient_emails": [
      "test1@example.com",
      "test2@example.com"
    ]
  },
  "required": [
    "recipient_emails"
  ],
  "properties": {
    "recipient_emails": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      },
      "description": "The array of email addresses to add or find."
    }
  }
}
array to_email_array
{
  "type": "array",
  "items": {
    "type": "object",
    "required": [
      "email"
    ],
    "properties": {
      "name": {
        "type": "string",
        "description": "The intended recipient's name."
      },
      "email": {
        "type": "string",
        "format": "email",
        "description": "The intended recipient's email address."
      }
    }
  },
  "title": "To Email Array",
  "example": [
    {
      "name": "John Doe",
      "email": "john_doe@example.com"
    }
  ]
}
object transactional-template-warning
{
  "type": "object",
  "title": "Warning",
  "example": {
    "message": "A sample warning message."
  },
  "properties": {
    "message": {
      "type": "string",
      "description": "Warning message for the user"
    }
  }
}
object transactional-templates-template-lean
{
  "type": "object",
  "title": "Transactional Templates: Template Lean",
  "example": {
    "id": "0c314114-a2b7-4523-8cbc-a293d7d19007",
    "name": "example_name",
    "versions": [],
    "generation": "legacy",
    "updated_at ": "2021-04-28T13:12:46.000Z"
  },
  "required": [
    "id",
    "name",
    "generation",
    "updated_at "
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "maxLength": 36,
      "minLength": 36,
      "description": "The ID of the transactional template."
    },
    "name": {
      "type": "string",
      "maxLength": 100,
      "description": "The name for the transactional template."
    },
    "versions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/transactional-templates-version-output-lean"
      },
      "description": "The different versions of this transactional template."
    },
    "generation": {
      "enum": [
        "legacy",
        "dynamic"
      ],
      "type": "string",
      "description": "Defines the generation of the template."
    },
    "updated_at ": {
      "type": "string",
      "pattern": "^(\\d{4}-\\d{2}-\\d{2}) ((\\d{2}):(\\d{2}):(\\d{2}))$",
      "description": "The date and time that this transactional template version was updated."
    }
  }
}
object transactional-templates-version-output-lean
{
  "type": "object",
  "title": "Transactional Templates: Version Output Lean",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "ID of the transactional template version."
    },
    "name": {
      "type": "string",
      "maxLength": 100,
      "description": "Name of the transactional template version."
    },
    "active": {
      "enum": [
        0,
        1
      ],
      "type": "integer",
      "description": "Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active."
    },
    "editor": {
      "enum": [
        "code",
        "design"
      ],
      "type": "string",
      "description": "The editor used in the UI."
    },
    "subject": {
      "type": "string",
      "maxLength": 255,
      "description": "Subject of the new transactional template version."
    },
    "updated_at": {
      "type": "string",
      "description": "The date and time that this transactional template version was updated."
    },
    "template_id": {
      "type": "string",
      "description": "ID of the transactional template."
    },
    "thumbnail_url": {
      "type": "string",
      "description": "A Thumbnail preview of the template's html content."
    },
    "generate_plain_content": {
      "type": "boolean",
      "default": true,
      "description": "If true, plain_content is always generated from html_content. If false, plain_content is not altered."
    }
  }
}
object transactional_template
{
  "allOf": [
    {
      "$ref": "#/components/schemas/transactional-templates-template-lean"
    },
    {
      "type": "object",
      "properties": {
        "warning": {
          "$ref": "#/components/schemas/transactional-template-warning"
        }
      }
    }
  ],
  "title": "Transactional Templates: Template",
  "example": {
    "id": "33feeff2-5069-43fe-8853-428651e5be79",
    "name": "example_name",
    "warning": {
      "message": "Sample warning message"
    },
    "generation": "legacy",
    "updated_at ": "2021-04-28T13:12:46.000Z"
  }
}
object transactional_template_version_create
{
  "type": "object",
  "title": "Transactional Templates: Version Create",
  "example": {
    "name": "pariatur non incididunt commodo",
    "active": 1,
    "editor": "design",
    "subject": "aliquip nulla Ut",
    "template_id": "Excepteur Ut qui",
    "html_content": "dolor",
    "plain_content": "labore dolore",
    "generate_plain_content": false
  },
  "required": [
    "name",
    "subject"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 100,
      "description": "Name of the transactional template version."
    },
    "active": {
      "enum": [
        0,
        1
      ],
      "type": "integer",
      "description": "Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active."
    },
    "editor": {
      "enum": [
        "code",
        "design"
      ],
      "type": "string",
      "description": "The editor used in the UI."
    },
    "subject": {
      "type": "string",
      "maxLength": 255,
      "description": "Subject of the new transactional template version."
    },
    "test_data": {
      "type": "string",
      "description": "For dynamic templates only, the mock json data that will be used for template preview and test sends."
    },
    "html_content": {
      "type": "string",
      "maxLength": 1048576,
      "description": "The HTML content of the version. Maximum of 1048576 bytes allowed."
    },
    "plain_content": {
      "type": "string",
      "default": "<generated from html_content if left empty>",
      "maxLength": 1048576,
      "description": "Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed."
    },
    "generate_plain_content": {
      "type": "boolean",
      "default": true,
      "description": "If true, plain_content is always generated from html_content. If false, plain_content is not altered."
    }
  }
}
object transactional_template_version_output
{
  "allOf": [
    {
      "type": "object",
      "properties": {
        "warnings": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/transactional-template-warning"
          }
        }
      }
    },
    {
      "$ref": "#/components/schemas/transactional_template_version_create"
    },
    {
      "$ref": "#/components/schemas/transactional-templates-version-output-lean"
    }
  ],
  "title": "Transactional Templates: Version Output"
}
object user_profile
{
  "type": "object",
  "title": "User: Profile",
  "example": {
    "zip": "80202",
    "city": "Denver, CO",
    "phone": "7208788003",
    "state": "CO",
    "address": "1451 Larimer Street, 3rd floor",
    "company": "SendGrid",
    "country": "US",
    "website": "http://sendgrid.com",
    "address2": "",
    "last_name": "Bernier",
    "first_name": "Matthew"
  },
  "properties": {
    "zip": {
      "type": "string",
      "description": "The zip code for this user."
    },
    "city": {
      "type": "string",
      "description": "The city for the user profile."
    },
    "phone": {
      "type": "string",
      "description": "The phone number for the user."
    },
    "state": {
      "type": "string",
      "description": "The state for this user."
    },
    "address": {
      "type": "string",
      "description": "The street address for this user profile."
    },
    "company": {
      "type": "string",
      "description": "That company that this user profile is associated with."
    },
    "country": {
      "type": "string",
      "description": "Th country of this user profile."
    },
    "website": {
      "type": "string",
      "description": "The website associated with this user."
    },
    "address2": {
      "type": "string",
      "description": "An optional second line for the street address of this user profile."
    },
    "last_name": {
      "type": "string",
      "description": "The last name of the user."
    },
    "first_name": {
      "type": "string",
      "description": "The first name of the user."
    }
  }
}
object user_scheduled_send_status
{
  "allOf": [
    {
      "$ref": "#/components/schemas/mail_batch_id"
    },
    {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "enum": [
            "cancel",
            "pause"
          ],
          "type": "string",
          "description": "The status of the scheduled send."
        }
      },
      "description": "The status of the scheduled send."
    }
  ],
  "title": "User Scheduled Send status",
  "example": {
    "status": "pause",
    "batch_id": "HkJ5yLYULb7Rj8GKSx7u025ouWVlMgAi"
  }
}
object verified-sender-request-schema
{
  "type": "object",
  "title": "Verified Sender Request Schema",
  "example": {
    "zip": "94105",
    "city": "San Francisco",
    "state": "CA",
    "address": "1234 Fake St",
    "country": "USA",
    "address2": "PO Box 1234",
    "nickname": "Orders",
    "reply_to": "orders@example.com",
    "from_name": "Example Orders",
    "from_email": "orders@example.com",
    "reply_to_name": "Example Orders"
  },
  "required": [
    "nickname",
    "from_email",
    "reply_to"
  ],
  "properties": {
    "zip": {
      "type": "string",
      "maxLength": 10
    },
    "city": {
      "type": "string",
      "maxLength": 150
    },
    "state": {
      "type": "string",
      "maxLength": 2
    },
    "address": {
      "type": "string",
      "maxLength": 100
    },
    "country": {
      "type": "string",
      "maxLength": 100
    },
    "address2": {
      "type": "string",
      "maxLength": 100
    },
    "nickname": {
      "type": "string",
      "maxLength": 100
    },
    "reply_to": {
      "type": "string",
      "format": "email",
      "maxLength": 256
    },
    "from_name": {
      "type": "string",
      "maxLength": 256
    },
    "from_email": {
      "type": "string",
      "format": "email",
      "maxLength": 256
    },
    "reply_to_name": {
      "type": "string",
      "maxLength": 256
    }
  }
}
object verified-sender-response-schema
{
  "type": "object",
  "title": "Verified Sender Response Schema",
  "example": {
    "id": 1234,
    "zip": "94105",
    "city": "San Francisco",
    "state": "CA",
    "locked": false,
    "address": "1234 Fake St.",
    "country": "USA",
    "address2": "PO Box 1234",
    "nickname": "Example Orders",
    "reply_to": "orders@example.com",
    "verified": true,
    "from_name": "Example Orders",
    "from_email": "orders@example.com",
    "reply_to_name": "Example Orders"
  },
  "properties": {
    "id": {
      "type": "integer"
    },
    "zip": {
      "type": "string"
    },
    "city": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "locked": {
      "type": "boolean"
    },
    "address": {
      "type": "string"
    },
    "country": {
      "type": "string"
    },
    "address2": {
      "type": "string"
    },
    "nickname": {
      "type": "string"
    },
    "reply_to": {
      "type": "string"
    },
    "verified": {
      "type": "boolean"
    },
    "from_name": {
      "type": "string"
    },
    "from_email": {
      "type": "string"
    },
    "reply_to_name": {
      "type": "string"
    }
  }
}
object webhook
{
  "type": "object",
  "title": "webhook",
  "required": [
    "url",
    "nonce"
  ],
  "properties": {
    "url": {
      "type": "string",
      "description": "The URL to invoke in the webhook"
    },
    "nonce": {
      "type": "string",
      "maxLength": 32,
      "minLength": 8,
      "description": "The one time nonce to use when \"signature\" is \"hmac-sha1\""
    }
  }
}
object webhooks-event-webhook-request
{
  "type": "object",
  "title": "Webhooks: Event Webhook Request",
  "required": [
    "enabled",
    "url",
    "group_resubscribe",
    "delivered",
    "group_unsubscribe",
    "spam_report",
    "bounce",
    "deferred",
    "unsubscribe",
    "processed",
    "open",
    "click",
    "dropped"
  ],
  "properties": {
    "url": {
      "type": "string",
      "description": "The URL that you want the event webhook to POST to."
    },
    "open": {
      "type": "boolean",
      "description": "Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event."
    },
    "click": {
      "type": "boolean",
      "description": "Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event."
    },
    "bounce": {
      "type": "boolean",
      "description": "Receiving server could not or would not accept message."
    },
    "dropped": {
      "type": "boolean",
      "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"
    },
    "enabled": {
      "type": "boolean",
      "description": "Indicates if the event webhook is enabled."
    },
    "deferred": {
      "type": "boolean",
      "description": "Recipient's email server temporarily rejected message."
    },
    "delivered": {
      "type": "boolean",
      "description": "Message has been successfully delivered to the receiving server."
    },
    "processed": {
      "type": "boolean",
      "description": "Message has been received and is ready to be delivered."
    },
    "spam_report": {
      "type": "boolean",
      "description": "Recipient marked a message as spam."
    },
    "unsubscribe": {
      "type": "boolean",
      "description": "Recipient clicked on message's subscription management link. You need to enable Subscription Tracking for getting this type of event."
    },
    "oauth_client_id": {
      "type": "string",
      "description": "The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token. When passing data in this field, you must also include the oauth_token_url field."
    },
    "oauth_token_url": {
      "type": "string",
      "description": "The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the oauth_client_id field."
    },
    "group_resubscribe": {
      "type": "boolean",
      "description": "Recipient resubscribes to specific group by updating preferences. You need to enable Subscription Tracking for getting this type of event."
    },
    "group_unsubscribe": {
      "type": "boolean",
      "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."
    }
  }
}