{"componentChunkName":"component---src-templates-api-js","path":"/api/events-ingest/","result":{"data":{"allApiBlueprint":{"edges":[{"node":{"meta":{"title":"A/B Testing API","label":"New"},"fields":{"path":"/api/ab-testing/","file":"ab-testing.apib"}}},{"node":{"meta":{"title":"Data Privacy API","label":"New"},"fields":{"path":"/api/data-privacy/","file":"data-privacy.apib"}}},{"node":{"meta":{"title":"Events API","label":null},"fields":{"path":"/api/events/","file":"events.apib"}}},{"node":{"meta":{"title":"Ingest API","label":"Private Access"},"fields":{"path":"/api/events-ingest/","file":"events-ingest.apib"}}},{"node":{"meta":{"title":"Inbound Domains API","label":null},"fields":{"path":"/api/inbound-domains/","file":"inbound-domains.apib"}}},{"node":{"meta":{"title":"Account API","label":null},"fields":{"path":"/api/account/","file":"account.apib"}}},{"node":{"meta":{"title":"API Overview","label":null},"fields":{"path":"/api/","file":"index.apib"}}},{"node":{"meta":{"title":"Automatic Inline Seeding","label":"Deliverability"},"fields":{"path":"/api/inline-seeds/","file":"inline-seeds.apib"}}},{"node":{"meta":{"title":"Labs APIs","label":null},"fields":{"path":"/api/labs/","file":"labs.apib"}}},{"node":{"meta":{"title":"Message Events API","label":null},"fields":{"path":"/api/message-events/","file":"message-events.apib"}}},{"node":{"meta":{"title":"Recipient Validation API","label":"New"},"fields":{"path":"/api/recipient-validation/","file":"recipient-validation.apib"}}},{"node":{"meta":{"title":"IP Pools API","label":null},"fields":{"path":"/api/ip-pools/","file":"ip-pools.apib"}}},{"node":{"meta":{"title":"Seed List API","label":"Deliverability"},"fields":{"path":"/api/seed-list/","file":"seed-list.apib"}}},{"node":{"meta":{"title":"Bounce Domains API","label":null},"fields":{"path":"/api/bounce-domains/","file":"bounce-domains.apib"}}},{"node":{"meta":{"title":"Recipient Lists API","label":null},"fields":{"path":"/api/recipient-lists/","file":"recipient-lists.apib"}}},{"node":{"meta":{"title":"Sending IPs API","label":null},"fields":{"path":"/api/sending-ips/","file":"sending-ips.apib"}}},{"node":{"meta":{"title":"Relay Webhooks API","label":null},"fields":{"path":"/api/relay-webhooks/","file":"relay-webhooks.apib"}}},{"node":{"meta":{"title":"SMTP API","label":null},"fields":{"path":"/api/smtp/","file":"smtp.apib"}}},{"node":{"meta":{"title":"Snippets API","label":"New"},"fields":{"path":"/api/snippets/","file":"snippets.apib"}}},{"node":{"meta":{"title":"Subaccounts API","label":null},"fields":{"path":"/api/subaccounts/","file":"subaccounts.apib"}}},{"node":{"meta":{"title":"Sending Domains API","label":null},"fields":{"path":"/api/sending-domains/","file":"sending-domains.apib"}}},{"node":{"meta":{"title":"Suppression List API","label":null},"fields":{"path":"/api/suppression-list/","file":"suppression-list.apib"}}},{"node":{"meta":{"title":"Template Language","label":null},"fields":{"path":"/api/template-language/","file":"template-language.apib"}}},{"node":{"meta":{"title":"Tracking Domains API","label":null},"fields":{"path":"/api/tracking-domains/","file":"tracking-domains.apib"}}},{"node":{"meta":{"title":"Templates API","label":null},"fields":{"path":"/api/templates/","file":"templates.apib"}}},{"node":{"meta":{"title":"Transmissions API","label":null},"fields":{"path":"/api/transmissions/","file":"transmissions.apib"}}},{"node":{"meta":{"title":"Event Webhooks API","label":null},"fields":{"path":"/api/webhooks/","file":"webhooks.apib"}}},{"node":{"meta":{"title":"Usage API","label":null},"fields":{"path":"/api/usage/","file":"usage.apib"}}},{"node":{"meta":{"title":"Metrics API","label":null},"fields":{"path":"/api/metrics/","file":"metrics.apib"}}}]},"apiBlueprint":{"ast":{"element":"parseResult","content":[{"element":"category","meta":{"classes":{"element":"array","content":[{"element":"string","content":"api"}]},"title":{"element":"string","content":""}},"attributes":{"meta":{"element":"array","content":[{"element":"member","meta":{"classes":{"element":"array","content":[{"element":"string","content":"user"}]}},"content":{"key":{"element":"string","content":"FORMAT"},"value":{"element":"string","content":"1A"}}},{"element":"member","meta":{"classes":{"element":"array","content":[{"element":"string","content":"user"}]}},"content":{"key":{"element":"string","content":"title"},"value":{"element":"string","content":"Ingest API"}}},{"element":"member","meta":{"classes":{"element":"array","content":[{"element":"string","content":"user"}]}},"content":{"key":{"element":"string","content":"description"},"value":{"element":"string","content":"Send event data to SparkPost for processing"}}},{"element":"member","meta":{"classes":{"element":"array","content":[{"element":"string","content":"user"}]}},"content":{"key":{"element":"string","content":"label"},"value":{"element":"string","content":"Private Access"}}}]}},"content":[{"element":"category","meta":{"classes":{"element":"array","content":[{"element":"string","content":"resourceGroup"}]},"title":{"element":"string","content":"Ingest"}},"content":[{"element":"copy","content":"The Events Ingest API provides an interface for on-premise MTA users to quickly, easily, and safely\ntake advantage of SparkPost's cloud-specific services.\nThe Events Ingest API accepts email event data, normalizes it, and sends it through SparkPost's data pipeline until it is ultimately consumable by various analytical services.\n\n### Event Format\n\nEvents sent to the Ingest API must adhere to a specific format in order to be correctly processed by SparkPost.\nOnly certain aspects of incoming API requests are validated during the REST transaction. Requests that do not pass validation at this point are rejected and a HTTP error code will be returned.\nThe body of the request must contain gzip-encoded, [new-line-delimited](http://ndjson.org/) JSON along with the appropriate headers.\nThe size of the request is limited to 5 MB and the age of events must be less than 24 hours.\n\nAdditional validation occurs out of band of the request. This additional validation ensures that events specified as part of the request body\nare properly formatted and consumable by SparkPost analytical services. Events that are not proper JSON, lack the correct wrapper, or are missing required fields will be dropped. \nPlease see [Processing Out of Band Errors](#header-processing-out-of-band-errors) for additional information.\n\n### Processing Out of Band Errors\n\nEvery uploaded batch of events can be tracked via the `id` returned from the API after a successful POST. This batch ID can be used in conjunction with the Events API to\nview the outcome of SparkPost's pre-processing.\n\nNote: the ingested email events may still take a few moments before they are viewable\n\nFor more on viewing ingested status events, see the [events documentation](/api/events/#events-get-search-for-ingest-events)"},{"element":"resource","meta":{"title":{"element":"string","content":"Ingest"}},"attributes":{"href":{"element":"string","content":"/v1/ingest"}},"content":[{"element":"copy","content":"### Additional Ingest Notes:\n\nFor GETs, If using <a href=\"/api/#header-curl\">cURL</a>, make sure the flags -O & -J are used. The -O \nflag will allow the file to be saved to the current location. The -J indicates to cURL to grab the \nfile as a gzip."},{"element":"transition","meta":{"title":{"element":"string","content":"Send Ingest Events"}},"attributes":{"href":{"element":"string","content":"/v1/ingest/events"}},"content":[{"element":"copy","content":"Post a new-line delimited list of JSON events.\n\nRequired Headers\n\n| Header             | Value                  |\n| ------------------ | ---------------------- |\n| `Content-Encoding` | `gzip`                 |\n| `Content-Type`     | `application/x-ndjson` |\n\n<DataStructure id=\"3e1b4128d08d41a8207c096482e7433c\"   sample=\"%7B%22msys%22%3A%7B%22message_event%22%3A%7B%22msg_batchname%22%3A%221A/50-00001-B03B45C5%22%2C%22template_version%22%3A%220%22%2C%22msg_spoolname%22%3A%222A/50-00001-B03B45C5%22%2C%22msg_size%22%3A%22315%22%2C%22bounce_class%22%3A%2225%22%2C%22template_id%22%3A%22template_12994410358768097%22%2C%22rcpt_tags%22%3A%5B%20%5D%2C%22recv_method%22%3A%22rest%22%2C%22binding_group%22%3A%22default%22%2C%22routing_domain%22%3A%22example.com%22%2C%22binding%22%3A%22default%22%2C%22rcpt_to%22%3A%22recipient@example.com%22%2C%22open_tracking%22%3A%221%22%2C%22msg_from%22%3A%22sender@example.com%22%2C%22type%22%3A%22inband%22%2C%22raw_reason%22%3A%22551%205.7.0%20%5Binternal%5D%20recipient%20blackholed%22%2C%22conn_name%22%3A%2200/00-00000-00000000%22%2C%22rcpt_meta%22%3A%7B%20%7D%2C%22error_code%22%3A%22551%22%2C%22message_id%22%3A%2200000bb3545c0100a205%22%2C%22conn_stage%22%3A%2222%22%2C%22reason%22%3A%22551%205.7.0%20%5Binternal%5D%20recipient%20blackholed%22%2C%22node_name%22%3A%228c9f45e70999%22%2C%22queue_time%22%3A%222%22%2C%22click_tracking%22%3A%221%22%2C%22num_retries%22%3A%220%22%2C%22event_id%22%3A%2212994410358769058%22%2C%22subject%22%3A%22Summer%20deals%20are%20here%21%22%2C%22timestamp%22%3A%221549054731%22%2C%22snippet_count%22%3A%220%22%2C%22transmission_id%22%3A%2212994410358768097%22%7D%7D%7D%0A%7B%22msys%22%3A%7B%22message_event%22%3A%7B%22template_id%22%3A%22template_12994410358768098%22%2C%22open_tracking%22%3A%221%22%2C%22msg_spoolname%22%3A%225A/50-00001-B03B45C5%22%2C%22binding_group%22%3A%22default%22%2C%22message_id%22%3A%2200000bb3545c0100a505%22%2C%22msg_size%22%3A%22315%22%2C%22timestamp%22%3A%221549054731%22%2C%22template_version%22%3A%220%22%2C%22subject%22%3A%22Summer%20deals%20are%20here%21%22%2C%22pathway_group%22%3A%22default%22%2C%22rcpt_meta%22%3A%7B%20%7D%2C%22snippet_count%22%3A%220%22%2C%22pathway%22%3A%22default%22%2C%22msg_batchname%22%3A%224A/50-00001-B03B45C5%22%2C%22event_id%22%3A%2212994410358769060%22%2C%22click_tracking%22%3A%221%22%2C%22conn_stage%22%3A%2222%22%2C%22type%22%3A%22reception%22%2C%22conn_name%22%3A%2200/00-00000-00000000%22%2C%22node_name%22%3A%228c9f45e70999%22%2C%22transmission_id%22%3A%2212994410358768098%22%2C%22rcpt_tags%22%3A%5B%20%5D%2C%22recv_method%22%3A%22rest%22%2C%22rcpt_to%22%3A%22recipient@example.com%22%2C%22msg_from%22%3A%22sender@example.com%22%2C%22routing_domain%22%3A%22example.com%22%2C%22binding%22%3A%22default%22%7D%7D%7D\"></DataStructure>\n\n<br />\n<br />\n<br />"},{"element":"httpTransaction","content":[{"element":"httpRequest","attributes":{"method":{"element":"string","content":"POST"},"headers":{"element":"httpHeaders","content":[{"element":"member","content":{"key":{"element":"string","content":"Authorization"},"value":{"element":"string","content":"14ac5499cfdd2bb2859e4476d2e5b1d2bad079bf"}}},{"element":"member","content":{"key":{"element":"string","content":"Content-Encoding"},"value":{"element":"string","content":"gzip"}}},{"element":"member","content":{"key":{"element":"string","content":"Content-Type"},"value":{"element":"string","content":"application/x-ndjson"}}}]}}},{"element":"httpResponse","attributes":{"statusCode":{"element":"string","content":"200"}},"content":[{"element":"asset","meta":{"classes":{"element":"array","content":[{"element":"string","content":"messageBody"}]}},"content":"  {\n      \"results\": {\n          \"id\": \"b2013586-c13f-4da4-baf4-11b9d8e40c50\"\n      }\n  }\n"}]}]}]},{"element":"transition","meta":{"title":{"element":"string","content":"Get Ingest Batch"}},"attributes":{"href":{"element":"string","content":"/v1/ingest/events/{id}"},"hrefVariables":{"element":"hrefVariables","content":[{"element":"member","meta":{"description":{"element":"string","content":"Ingest batch ID."},"title":{"element":"string","content":"number"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","content":"id"},"value":{"element":"string","content":"e038e809-1308-461c-83b7-fa73c9f50500"}}}]}},"content":[{"element":"copy","content":"Downloads a gzip file of the ingest batch events. \nThe binary of the gzip will be displayed in the response body."},{"element":"httpTransaction","content":[{"element":"httpRequest","attributes":{"method":{"element":"string","content":"GET"}}},{"element":"httpResponse","attributes":{"statusCode":{"element":"string","content":"200"}},"content":[{"element":"asset","meta":{"classes":{"element":"array","content":[{"element":"string","content":"messageBody"}]}},"content":"  Saved to filename \"b2013586-c13f-4da4-baf4-11b9d8e40c50\".gz\n"}]}]}]},{"element":"transition","meta":{"title":{"element":"string","content":"Get Failure Ingest Batch"}},"attributes":{"href":{"element":"string","content":"/v1/ingest/events/failures/{id}"},"hrefVariables":{"element":"hrefVariables","content":[{"element":"member","meta":{"description":{"element":"string","content":"Ingest batch ID."},"title":{"element":"string","content":"number"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","content":"id"},"value":{"element":"string","content":"e038e809-1308-461c-83b7-fa73c9f50500"}}}]}},"content":[{"element":"copy","content":"Downloads a gzip file of the ingest batch with failures. \nThe binary of the gzip will be displayed in the response body."},{"element":"httpTransaction","content":[{"element":"httpRequest","attributes":{"method":{"element":"string","content":"GET"}}},{"element":"httpResponse","attributes":{"statusCode":{"element":"string","content":"200"}},"content":[{"element":"asset","meta":{"classes":{"element":"array","content":[{"element":"string","content":"messageBody"}]}},"content":"  Saved to filename \"b2013586-c13f-4da4-baf4-11b9d8e40c50\".gz\n\n"}]}]}]}]},{"element":"resource","meta":{"title":{"element":"string","content":"Documentation"}},"attributes":{"href":{"element":"string","content":"/v1/ingest/events/documentation"}},"content":[{"element":"copy","content":"These endpoints are used to generate the samples and descriptions for the [Send Events](#header-send-events) section.\n\n### Additional Event Notes:\n\n-   For Sending IP related reporting, processing will fallback to the `binding` field if the `sending_ip` field is not present."},{"element":"transition","meta":{"title":{"element":"string","content":"Ingest Events Documentation"}},"content":[{"element":"copy","content":"Returns a list of descriptions of the event fields that could be included in a POST to the ingest events API. \nFields will vary by event type. Event fields including `\"required\": true` must be present in the event and fields \nincluding `\"reporting\": true` are recommended as they are used to drive various reporting services."},{"element":"httpTransaction","content":[{"element":"httpRequest","attributes":{"method":{"element":"string","content":"GET"},"headers":{"element":"httpHeaders","content":[{"element":"member","content":{"key":{"element":"string","content":"Accept"},"value":{"element":"string","content":"application/json"}}}]}}},{"element":"httpResponse","attributes":{"statusCode":{"element":"string","content":"200"}},"content":[{"element":"asset","meta":{"classes":{"element":"array","content":[{"element":"string","content":"messageBody"}]}},"content":"{\n  \"results\": [\n    {\n      \"type\": {\n        \"description\": \"Type of event this record describes\",\n        \"sampleValue\": \"delivery\",\n        \"required\": true,\n        \"reporting\": true\n      },\n      ...\n    },\n    ...\n  ]\n}\n"}]}]}]},{"element":"transition","meta":{"title":{"element":"string","content":"Ingest Events Samples"}},"attributes":{"href":{"element":"string","content":"/v1/ingest/events/samples{?events}"},"hrefVariables":{"element":"hrefVariables","content":[{"element":"member","meta":{"description":{"element":"string","content":"Event types for which to get a sample payload. Defaults to all event types. See [Events Types](/api/events/#header-event-types) for the list of available event types."},"title":{"element":"string","content":"string"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"optional"}]}},"content":{"key":{"element":"string","content":"events"},"value":{"element":"string","content":"delivery"}}}]}},"content":[{"element":"copy","content":"Returns an example message event for each event type listed in the `events` parameter."},{"element":"httpTransaction","content":[{"element":"httpRequest","attributes":{"method":{"element":"string","content":"GET"},"headers":{"element":"httpHeaders","content":[{"element":"member","content":{"key":{"element":"string","content":"Accept"},"value":{"element":"string","content":"application/json"}}}]}}},{"element":"httpResponse","attributes":{"statusCode":{"element":"string","content":"200"}},"content":[{"element":"asset","meta":{"classes":{"element":"array","content":[{"element":"string","content":"messageBody"}]}},"content":"{\n  \"results\": [\n    {\n      \"type\": \"delivery\",\n      ...\n    }\n  ]\n}\n"}]}]}]}]}]},{"element":"category","meta":{"classes":{"element":"array","content":[{"element":"string","content":"dataStructures"}]}},"content":[{"element":"dataStructure","content":{"element":"object","meta":{"id":{"element":"string","content":"3e1b4128d08d41a8207c096482e7433c"}},"content":[{"element":"member","meta":{"description":{"element":"string","content":"The event wrapper"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","content":"msys"},"value":{"element":"object","content":[{"element":"member","meta":{"description":{"element":"string","content":"Designates the event grouping <br />One of: `message_event`, `track_event`, `gen_event`, `adaptive_event`, `unsubscribe_event`, `relay_event`, `ab_test_event`"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","attributes":{"variable":{"element":"boolean","content":true}},"content":"event grouping"},"value":{"element":"object","content":[{"element":"member","meta":{"description":{"element":"string","content":"The event identifier"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","content":"event_id"},"value":{"element":"string"}}},{"element":"member","meta":{"description":{"element":"string","content":"The message identifier"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","content":"message_id"},"value":{"element":"string"}}},{"element":"member","meta":{"description":{"element":"string","content":"The type of event"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","content":"type"},"value":{"element":"string"}}},{"element":"member","meta":{"description":{"element":"string","content":"Unix timestamp (in seconds) representing the time the event occurred"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","content":"timestamp"},"value":{"element":"string"}}},{"element":"member","meta":{"description":{"element":"string","content":"The method in which the message was either received or delivered <br />One of: `recv_method`, `delv_method`"}},"attributes":{"typeAttributes":{"element":"array","content":[{"element":"string","content":"required"}]}},"content":{"key":{"element":"string","attributes":{"variable":{"element":"boolean","content":true}},"content":"transport method"},"value":{"element":"string"}}}]}}}]}}}]}}]}]},{"element":"annotation","meta":{"classes":{"element":"array","content":[{"element":"string","content":"warning"}]}},"attributes":{"code":{"element":"number","content":6},"sourceMap":{"element":"array","content":[{"element":"sourceMap","content":[{"element":"array","content":[{"element":"number","content":5243},{"element":"number","content":11}]}]}]}},"content":"missing response HTTP status code, assuming 'Response 200'"},{"element":"annotation","meta":{"classes":{"element":"array","content":[{"element":"string","content":"warning"}]}},"attributes":{"code":{"element":"number","content":6},"sourceMap":{"element":"array","content":[{"element":"sourceMap","content":[{"element":"array","content":[{"element":"number","content":5657},{"element":"number","content":11}]}]}]}},"content":"missing response HTTP status code, assuming 'Response 200'"},{"element":"annotation","meta":{"classes":{"element":"array","content":[{"element":"string","content":"warning"}]}},"attributes":{"code":{"element":"number","content":6},"sourceMap":{"element":"array","content":[{"element":"sourceMap","content":[{"element":"array","content":[{"element":"number","content":6051},{"element":"number","content":11}]}]}]}},"content":"missing response HTTP status code, assuming 'Response 200'"},{"element":"annotation","meta":{"classes":{"element":"array","content":[{"element":"string","content":"warning"}]}},"attributes":{"code":{"element":"number","content":6},"sourceMap":{"element":"array","content":[{"element":"sourceMap","content":[{"element":"array","content":[{"element":"number","content":6939},{"element":"number","content":12}]}]}]}},"content":"missing response HTTP status code, assuming 'Response 200'"},{"element":"annotation","meta":{"classes":{"element":"array","content":[{"element":"string","content":"warning"}]}},"attributes":{"code":{"element":"number","content":6},"sourceMap":{"element":"array","content":[{"element":"sourceMap","content":[{"element":"array","content":[{"element":"number","content":7736},{"element":"number","content":12}]}]}]}},"content":"missing response HTTP status code, assuming 'Response 200'"}]},"TableOfContents":[{"anchor":"#ingest","title":"Ingest","children":[{"anchor":"#header-event-format","title":"Event Format"},{"anchor":"#header-processing-out-of-band-errors","title":"Processing Out of Band Errors"},{"anchor":"#ingest-ingest","title":"Ingest","children":[{"anchor":"#header-additional-ingest-notes-","title":"Additional Ingest Notes:"},{"anchor":"#ingest-post-send-ingest-events","title":"Send Ingest Events"},{"anchor":"#ingest-get-get-ingest-batch","title":"Get Ingest Batch"},{"anchor":"#ingest-get-get-failure-ingest-batch","title":"Get Failure Ingest Batch"}]},{"anchor":"#ingest-documentation","title":"Documentation","children":[{"anchor":"#header-additional-event-notes-","title":"Additional Event Notes:"},{"anchor":"#ingest-get-ingest-events-documentation","title":"Ingest Events Documentation"},{"anchor":"#ingest-get-ingest-events-samples","title":"Ingest Events Samples"}]}]}],"meta":{"title":"Ingest API","description":"Send event data to SparkPost for processing","full":false},"fields":{"path":"/api/events-ingest/"}}},"pageContext":{"file":"events-ingest.apib"}},"staticQueryHashes":["1319884646","1428769721","3859448388"]}