{"openapi":"3.0.0","info":{"title":"Multicast Notification Service (MNS) - REST API","version":"v1.0.445-alpha","description":"## Overview\nBefore learning about the MNS API, we would recommend reviewing MNS as a service on the [MNS Service Page](https://digital.nhs.uk/services/multicast-notification-service).\n\n![MNS High-level Diagram](data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3C%21DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20width%3D%221100px%22%20height%3D%22390px%22%20viewBox%3D%22-0.5%20-0.5%201100%20390%22%3E%3Cdefs%2F%3E%3Cg%3E%3Cg%20data-cell-id%3D%220%22%3E%3Cg%20data-cell-id%3D%221%22%3E%3Cg%20data-cell-id%3D%22VUsv3juNwKQNRmecrnAf-1%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20640%20195%20L%20719.63%20195%22%20fill%3D%22none%22%20stroke%3D%22rgb%280%2C%200%2C%200%29%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22stroke%22%2F%3E%3Cpath%20d%3D%22M%20724.88%20195%20L%20717.88%20198.5%20L%20719.63%20195%20L%20717.88%20191.5%20Z%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20stroke%3D%22rgb%280%2C%200%2C%200%29%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22rVuW8alE09S49QwoGZst-1%22%3E%3Cg%3E%3Crect%20x%3D%22258%22%20y%3D%2280%22%20width%3D%22382%22%20height%3D%22230%22%20fill%3D%22%23f0f6fa%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%224%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20flex-start%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%20380px%3B%20height%3A%201px%3B%20padding-top%3A%2087px%3B%20margin-left%3A%20259px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2016px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20normal%3B%20overflow-wrap%3A%20normal%3B%22%3E%3Cb%3EMulticast%20Notification%20Service%3Cbr%20%2F%3E%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22449%22%20y%3D%22103%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2216px%22%20text-anchor%3D%22middle%22%3EMulticast%20Notification%20Service%26%23xa%3B%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%220-W5IMzBPXmCwb02NFud-12%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20450%20195%20L%20714.4%20195%22%20fill%3D%22none%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22stroke%22%2F%3E%3Cpath%20d%3D%22M%20722.65%20195%20L%20711.65%20200.5%20L%20714.4%20195%20L%20711.65%20189.5%20Z%22%20fill%3D%22%230072ce%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%201px%3B%20height%3A%201px%3B%20padding-top%3A%20190px%3B%20margin-left%3A%20670px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20background-color%3A%20rgb%28255%2C%20255%2C%20255%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2012px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20background-color%3A%20rgb%28255%2C%20255%2C%20255%29%3B%20white-space%3A%20nowrap%3B%22%3E%3Cb%3EAWS%20SQS%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22670%22%20y%3D%22194%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2212px%22%20text-anchor%3D%22middle%22%3EAWS%20SQS%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%220-W5IMzBPXmCwb02NFud-14%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20450%20194%20L%20510%20194%20Q%20520%20194%20520%20204%20L%20520%20260%20Q%20520%20270%20530%20270%20L%20714.4%20270%22%20fill%3D%22none%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22stroke%22%2F%3E%3Cpath%20d%3D%22M%20722.65%20270%20L%20711.65%20275.5%20L%20714.4%20270%20L%20711.65%20264.5%20Z%22%20fill%3D%22%230072ce%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%201px%3B%20height%3A%201px%3B%20padding-top%3A%20260px%3B%20margin-left%3A%20620px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20background-color%3A%20rgb%28255%2C%20255%2C%20255%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2012px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20background-color%3A%20rgb%28255%2C%20255%2C%20255%29%3B%20white-space%3A%20nowrap%3B%22%3E%3Cb%3EFuture%20delivery%20mechanisms%3Cbr%20%2F%3E%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22620%22%20y%3D%22264%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2212px%22%20text-anchor%3D%22middle%22%3EFuture%20delivery%20mechanisms%26%23xa%3B%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%220-W5IMzBPXmCwb02NFud-17%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20450%20194%20L%20510%20194%20Q%20520%20194%20520%20184%20L%20520%20133.9%20Q%20520%20123.9%20530%20123.9%20L%20713.01%20123.93%22%20fill%3D%22none%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22stroke%22%2F%3E%3Cpath%20d%3D%22M%20721.26%20123.94%20L%20710.25%20129.43%20L%20713.01%20123.93%20L%20710.26%20118.43%20Z%22%20fill%3D%22%230072ce%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%201px%3B%20height%3A%201px%3B%20padding-top%3A%20120px%3B%20margin-left%3A%20670px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20background-color%3A%20rgb%28255%2C%20255%2C%20255%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2012px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20background-color%3A%20rgb%28255%2C%20255%2C%20255%29%3B%20white-space%3A%20nowrap%3B%22%3E%3Cb%3EMESH%3Cbr%20%2F%3E%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22670%22%20y%3D%22124%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2212px%22%20text-anchor%3D%22middle%22%3EMESH%26%23xa%3B%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%220-W5IMzBPXmCwb02NFud-22%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20239%20194%20L%20319.4%20194%22%20fill%3D%22none%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22stroke%22%2F%3E%3Cpath%20d%3D%22M%20327.65%20194%20L%20316.65%20199.5%20L%20319.4%20194%20L%20316.65%20188.5%20Z%22%20fill%3D%22%230072ce%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%220-W5IMzBPXmCwb02NFud-29%22%3E%3Cg%3E%3Crect%20x%3D%220%22%20y%3D%2291%22%20width%3D%22260%22%20height%3D%2250%22%20fill%3D%22none%22%20stroke%3D%22none%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%201px%3B%20height%3A%201px%3B%20padding-top%3A%20116px%3B%20margin-left%3A%20130px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2016px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20nowrap%3B%22%3E%3Cb%3E1.%20Event%20producers%20post%20events%3Cbr%20%2F%3Evia%20the%20%2Fevents%20endpoint%3Cbr%20%2F%3E%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22130%22%20y%3D%22121%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2216px%22%20text-anchor%3D%22middle%22%3E1.%20Event%20producers%20post%20events...%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%220-W5IMzBPXmCwb02NFud-31%22%3E%3Cg%3E%3Crect%20x%3D%22700%22%20y%3D%220%22%20width%3D%22400%22%20height%3D%2270%22%20fill%3D%22rgb%28255%2C%20255%2C%20255%29%22%20stroke%3D%22none%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20flex-start%3B%20width%3A%201px%3B%20height%3A%201px%3B%20padding-top%3A%2035px%3B%20margin-left%3A%20702px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2016px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20nowrap%3B%22%3E%3Cb%3E3.%20Subscribers%20receive%20notifications%20of%20events%20that%3Cbr%20%2F%3Ematch%20their%20subscription%20criteria%20via%20their%20chosen%C2%A0%3C%2Fb%3E%3Cdiv%3E%3Cb%3Edelivery%20mechanism%3Cbr%20%2F%3E%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22702%22%20y%3D%2240%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2216px%22%3E3.%20Subscribers%20receive%20notifications%20of%20events%20tha...%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%220-W5IMzBPXmCwb02NFud-32%22%3E%3Cg%3E%3Crect%20x%3D%22350%22%20y%3D%22340%22%20width%3D%22380%22%20height%3D%2250%22%20fill%3D%22rgb%28255%2C%20255%2C%20255%29%22%20stroke%3D%22none%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20flex-start%3B%20width%3A%201px%3B%20height%3A%201px%3B%20padding-top%3A%20365px%3B%20margin-left%3A%20352px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2016px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20nowrap%3B%22%3E%3Cb%3E4.%20Consumers%20can%20optionally%20synchronise%20with%20%3C%2Fb%3E%3Cbr%20%2F%3E%3Cb%3Eevent%20producers%20to%20obtain%20further%20information%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22352%22%20y%3D%22370%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2216px%22%3E4.%20Consumers%20can%20optionally%20synchronise%20with...%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22Zw_A1qURk4UVENOAcfYG-6%22%3E%3Cg%2F%3E%3Cg%20data-cell-id%3D%22Zw_A1qURk4UVENOAcfYG-5%22%3E%3Cg%3E%3Crect%20x%3D%2289%22%20y%3D%22160%22%20width%3D%22150%22%20height%3D%2280%22%20fill%3D%22%23e5f1fa%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22Zw_A1qURk4UVENOAcfYG-4%22%3E%3Cg%3E%3Crect%20x%3D%2279%22%20y%3D%22150%22%20width%3D%22150%22%20height%3D%2280%22%20fill%3D%22%23e5f1fa%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22Zw_A1qURk4UVENOAcfYG-3%22%3E%3Cg%3E%3Crect%20x%3D%2269%22%20y%3D%22140%22%20width%3D%22150%22%20height%3D%2280%22%20fill%3D%22%23e5f1fa%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%20148px%3B%20height%3A%201px%3B%20padding-top%3A%20180px%3B%20margin-left%3A%2070px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2014px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20normal%3B%20overflow-wrap%3A%20normal%3B%22%3E%3Cb%3EEvent%20Producers%3Cbr%20%2F%3E%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22144%22%20y%3D%22184%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2214px%22%20text-anchor%3D%22middle%22%3EEvent%20Producers%26%23xa%3B%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22YajB4pAiuQ-TrR8HfFuC-4%22%3E%3Cg%3E%3Crect%20x%3D%22330%22%20y%3D%22157%22%20width%3D%22120%22%20height%3D%2276%22%20fill%3D%22%23e5f1fa%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%20118px%3B%20height%3A%201px%3B%20padding-top%3A%20195px%3B%20margin-left%3A%20331px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2014px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20normal%3B%20overflow-wrap%3A%20normal%3B%22%3E%3Cb%3EAPI%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22390%22%20y%3D%22199%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2214px%22%20text-anchor%3D%22middle%22%3EAPI%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22z5eWa8XUYbNPNDbLkYAw-2%22%3E%3Cg%3E%3Crect%20x%3D%22726%22%20y%3D%2292%22%20width%3D%22107%22%20height%3D%2264%22%20fill%3D%22%23e5f1fa%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%20105px%3B%20height%3A%201px%3B%20padding-top%3A%20124px%3B%20margin-left%3A%20727px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2014px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20normal%3B%20overflow-wrap%3A%20normal%3B%22%3E%3Cdiv%3E%3Cb%3EEvent%20Subscriber%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22780%22%20y%3D%22128%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2214px%22%20text-anchor%3D%22middle%22%3EEvent%20Subscriber%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22z5eWa8XUYbNPNDbLkYAw-4%22%3E%3Cg%3E%3Crect%20x%3D%22726%22%20y%3D%22163%22%20width%3D%22107%22%20height%3D%2264%22%20fill%3D%22%23e5f1fa%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%20105px%3B%20height%3A%201px%3B%20padding-top%3A%20195px%3B%20margin-left%3A%20727px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2014px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20normal%3B%20overflow-wrap%3A%20normal%3B%22%3E%3Cb%20style%3D%22border-color%3A%20var%28--border-color%29%3B%22%3EEvent%20Subscriber%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22780%22%20y%3D%22199%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2214px%22%20text-anchor%3D%22middle%22%3EEvent%20Subscriber%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22z5eWa8XUYbNPNDbLkYAw-5%22%3E%3Cg%3E%3Crect%20x%3D%22726%22%20y%3D%22236%22%20width%3D%22107%22%20height%3D%2264%22%20fill%3D%22%23e5f1fa%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3Cg%3E%3Cg%20transform%3D%22translate%28-0.5%20-0.5%29%22%3E%3Cswitch%3E%3CforeignObject%20pointer-events%3D%22none%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20requiredFeatures%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2FSVG11%2Ffeature%23Extensibility%22%20style%3D%22overflow%3A%20visible%3B%20text-align%3A%20left%3B%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22display%3A%20flex%3B%20align-items%3A%20unsafe%20center%3B%20justify-content%3A%20unsafe%20center%3B%20width%3A%20105px%3B%20height%3A%201px%3B%20padding-top%3A%20268px%3B%20margin-left%3A%20727px%3B%22%3E%3Cdiv%20data-drawio-colors%3D%22color%3A%20rgb%280%2C%200%2C%200%29%3B%20%22%20style%3D%22box-sizing%3A%20border-box%3B%20font-size%3A%200px%3B%20text-align%3A%20center%3B%22%3E%3Cdiv%20style%3D%22display%3A%20inline-block%3B%20font-size%3A%2014px%3B%20font-family%3A%20Helvetica%3B%20color%3A%20rgb%280%2C%200%2C%200%29%3B%20line-height%3A%201.2%3B%20pointer-events%3A%20all%3B%20white-space%3A%20normal%3B%20overflow-wrap%3A%20normal%3B%22%3E%3Cb%20style%3D%22border-color%3A%20var%28--border-color%29%3B%22%3EEvent%20Subscriber%3C%2Fb%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3Ctext%20x%3D%22780%22%20y%3D%22272%22%20fill%3D%22rgb%280%2C%200%2C%200%29%22%20font-family%3D%22%26quot%3BHelvetica%26quot%3B%22%20font-size%3D%2214px%22%20text-anchor%3D%22middle%22%3EEvent%20Subscriber%3C%2Ftext%3E%3C%2Fswitch%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22UxZGBx1PjwKo31L9cuJ8-2%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20880%20310%20L%20880%20330%20Q%20880%20340%20870%20340%20L%20174%20340%20Q%20164%20340%20164%20330%20L%20164%20250.1%22%20fill%3D%22none%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20stroke-dasharray%3D%223%203%22%20pointer-events%3D%22stroke%22%2F%3E%3Cpath%20d%3D%22M%20164%20243.35%20L%20168.5%20252.35%20L%20164%20250.1%20L%20159.5%20252.35%20Z%22%20fill%3D%22%230072ce%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20pointer-events%3D%22all%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22UxZGBx1PjwKo31L9cuJ8-3%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20880%20310%20L%20880%20278%20Q%20880%20268%20870%20268%20L%20833%20268%22%20fill%3D%22none%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20stroke-dasharray%3D%223%203%22%20pointer-events%3D%22stroke%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22UxZGBx1PjwKo31L9cuJ8-4%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20880%20280%20L%20880%20206%20Q%20880%20196%20870%20195.79%20L%20833%20195%22%20fill%3D%22none%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20stroke-dasharray%3D%223%203%22%20pointer-events%3D%22stroke%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cg%20data-cell-id%3D%22UxZGBx1PjwKo31L9cuJ8-5%22%3E%3Cg%3E%3Cpath%20d%3D%22M%20880%20210%20L%20880%20134%20Q%20880%20124%20870%20124%20L%20833%20124%22%20fill%3D%22none%22%20stroke%3D%22%230072ce%22%20stroke-width%3D%223%22%20stroke-miterlimit%3D%2210%22%20stroke-dasharray%3D%223%203%22%20pointer-events%3D%22stroke%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E)\n\nThis page is about how to implement the API for the Multicast Notificaton Service, to find out more about this service itself and its uses visit our [Multicast Notification Service](https://digital.nhs.uk/services/multicast-notification-service) service page.\n\nUse this API to publish or and subscribe to healthcare-related events. This API is currently only live with patient-related event. However, it is intended as a robust service that could support many types of future event e.g. changes related to healthcare organisations or staff.\n\nThe events do not contain clinical information; they simply describe what type of event occurred to whom/what and where. A pointer is provided for retrieval of the data that the event refers to.\n\nThis API is for systems that need to share healthcare information with other systems that need to stay up to date with changes to that information.\n\nYou can:\n  - Publish events.\n  - Subscribe to events based on event type and optional corresponding criteria filter.\n\nAvailable and in development events can be viewed by visiting the [Multicast Notification Service Events Catalogue](https://digital.nhs.uk/developer/api-catalogue/multicast-notification-service/multicast-notification-service-events-catalogue).\n\nData flow:\n  1. An event occurs on an event publishers system. They publish the event to MNS, including a pointer to be used for retrieval of the event details.\n  2. MNS matches the event to the subscription criteria of subscribing organisations and delivers it to their specified destinations, for example an AWS SQS queue.\n  3. Subscribers retrieve details of the event from the pointer provided in the event.\n\n## Who can use this API\nThis API can be used by developers of services supporting the delivery of health and social care.\n\nMake sure you have a valid use case before you go too far with your development.\n\nYou must do this before you can go live (see [Onboarding](#overview--onboarding) below).\n\n## Related APIs\nThe following API also provides access to healthcare-related events:\n  - [National Events Management Service - FHIR API](https://digital.nhs.uk/developer/api-catalogue/national-events-management-service-fhir \"National\n  Events Management Service - FHIR API\") - the predecessor to MNS, the difference is that the payloads MNS delivers are lightweight events that do not contain any clinical information, they signal that a state has changed and allow subscribers to retrieve up to date information from the authoritative source.\n  - [Messaging Exchange for Social care and Health (MESH)](https://digital.nhs.uk/services/message-exchange-for-social-care-and-health-mesh) - available delivery system for receiving events from MNS.\n\n## API status and roadmap\nThis API is [in production (beta)](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#statuses).\n\n## Service level\nThis API is a bronze service, meaning it is operational and supported only during business hours (8am to 6pm), Monday to Friday excluding bank holidays.\n\nFor more details, see [service levels](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#service-levels).\n## Technology\nThis API is a [REST-based](https://digital.nhs.uk/developer/guides-and-documentation/our-api-technologies#basic-rest) [publish-subscribe](https://digital.nhs.uk/developer/guides-and-documentation/introduction-to-healthcare-technology/integration-and-apis#publish-subscribe-events) API.\n\nThe publish event structure is based on the recommendations of the [Cloud Events specification.](https://cloudevents.io/)\n\nEvents received conform to the FHIR global standard for health care data exchange, specifically to FHIR R4 (v4.0.1).\n\n## Network access\nThis API is available on the internet.\n\nFor more details see [Network access for APIs](https://digital.nhs.uk/developer/guides-and-documentation/network-access-for-apis).\n\n## Security and authorisation\n\nThis API has one access mode:\n- application-restricted access\n\n### Application-restricted access\nUse this access mode if you need to publish an event from your system.\n\nThis access mode is [application-restricted](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation#application-restricted-apis), meaning we authenticate the calling application but not the end user.\n\nThe end user could be:\n* a healthcare worker - for example they record an event in an application and that application then publishes to MNS\n* a patient - for example they make a change to their record in a patient-facing application and that application then publishes to MNS\n* not present at all - for example as part of a back end process where events from an NHS England product or system are generated\n\nIn the above cases you must ensure the users are authenticated and suitably authorised locally\n\nTo use this access mode, use the following security pattern:\n* [Application-restricted RESTful API - signed JWT authentication](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication)\n\n## Environments and testing\n\n| Environment       | Base URL                                                               |\n| ----------------- | ---------------------------------------------------------------------- |\n| Sandbox           | `https://sandbox.api.service.nhs.uk/multicast-notification-service`    |\n| Integration test  | `https://int.api.service.nhs.uk/multicast-notification-service`        |\n| Production        | `https://api.service.nhs.uk/multicast-notification-service`            |\n\n### Sandbox testing\nOur [sandbox environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#sandbox-testing):\n* is for early developer testing\n* only covers a limited set of scenarios\n* is stateless, so does not actually persist any updates\n* is open access, so does not allow you to test authorisation\n\nFor details of sandbox test scenarios, or to try out the sandbox using our 'Try this API' feature, see the documentation for each endpoint.\n\nAlternatively, you can try out the sandbox using our Postman collection (simply download the file from the link and import it into Postman):\n\n\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/54527860-f64d9e7d-6095-46c3-bc58-92672de294f6)\n## Onboarding\nDuring the planned private beta this service will only be available to NHS England product teams. The onboarding process is in development and we will be\nimproving it iteratively as we gather feedback from the first set of users.\n\n## Events\nEach event has its own documentation, which can be viewed by visiting the [Multicast Notification Service Events Catalogue](https://digital.nhs.uk/developer/api-catalogue/multicast-notification-service/multicast-notification-service-events-catalogue).\n\n## Errors\nWe use standard HTTP status codes to show whether an API request succeeded or not. They are usually in the range:\n\n* 200 to 299 if it succeeded, including code 202 if it was accepted by an API that needs to wait for further action\n* 400 to 499 if it failed because of a client error by your application\n* 500 to 599 if it failed because of an error on our server\n\nErrors specific to each API are shown in the Endpoints section, under Response. See our [reference guide](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#http-status-codes) for more on errors.\n\n## Open source\nYou might find the following [open source](https://digital.nhs.uk/developer/guides-and-documentation/reference-guide#open-source) resources useful:\n\n| Resource                  | Description                                                          | Links                                                                       |\n|---------------------------|----------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| MNS API                   | Source code for the API proxy, sandbox and specification.            | [GitHub repo](https://github.com/NHSDigital/multicast-notification-service) |\n| FHIR libraries and SDKs   | Various open source libraries for integrating with FHIR APIs.        | [FHIR libraries and SDKs](https://digital.nhs.uk/developer/guides-and-documentation/api-technologies-at-nhs-digital#fhir-libraries-and-sdks) |\n\nWe currently don't have any open source client libraries or sample code and the source code for the MNS backend is not currently in the open. If you think this would be useful, [contact us](https://digital.nhs.uk/developer/help-and-support).\n\n## Contact us\nFor help connecting to any NHS APIs see [Help and support building healthcare software](https://digital.nhs.uk/developer/help-and-support)\n\nFor support with connecting to the MNS API [join our developer community](https://developer.community.nhs.uk/c/multicast-notification-service/57).\n","contact":{"name":"multicast-notification-service API Support","url":"https://digital.nhs.uk/developer/help-and-support","email":"api.management@nhs.net"}},"servers":[{"url":"https://sandbox.api.service.nhs.uk/multicast-notification-service","description":"Sandbox environment."},{"url":"https://int.api.service.nhs.uk/multicast-notification-service","description":"Integration test environment."},{"url":"https://api.service.nhs.uk/multicast-notification-service","description":"Production environment."}],"security":[],"tags":[{"name":"events","description":"Event publishing"},{"name":"subscriptions","description":"Subscription management"}],"paths":{"/events":{"post":{"summary":"Publish an event","tags":["events"],"description":"### Overview\nUse this endpoint to publish a healthcare-related event.\n\nThe event contains only a minimum dataset based on the recommendations of the [CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md).\n\n### Content-Type\nThe Content-Type header for this endpoint is used to determine validation on the event body and should be set to `application/cloudevents+json` unless the event is a legacy event where it should be `application/json`.\n\n### Data and Metadata:\n  - Metadata: In the context of an event, metadata refers to the additional information that describes the event and provides context about it. For example, for [PDS](https://digital.nhs.uk/services/personal-demographics-service) events it includes elements such as the family name and date of birth which are primarily for verification. Users must be cautious not to use such metadata to modify a patient's demographic details. Instead, if updates are necessary, users should conduct a full PDS retrieval to ensure accuracy and completeness in their workflows.\n  - Data: The inclusion of the data field might vary. Its presence is subject to agreements between the MNS team and the originating system. While the structure of the data might differ across various systems and scenarios, it's a general preference to have a pointer included. This pointer aids subscribers in accessing the entire record when necessary for their workflow.\n\n### Sandbox testing\nYou can test the following scenarios in our sandbox environment:\n\n| Scenario                           | Request                                                                    | Response                                                       |\n| ---------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------- |\n| Publish an event                   | Content-Type: `application/cloudevents+json` Event Type: `example-event-1` | HTTP Status 200 and response containing id and success status. |\n| Publish an event with invalid data | E.g. an event with an invalid value for `time`                             | HTTP Status 400 and response containing a validation error.    |\n\nYou can try out the sandbox using the 'Try this API' feature on this page.\n","operationId":"publish-event","parameters":[{"name":"Authorization","in":"header","required":true,"description":"An [OAuth 2.0 bearer token](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication).\nRequired in all environments except sandbox.","schema":{"type":"string","format":"^Bearer [[:ascii:]]+$","example":"Bearer g1112R_ccQ1Ebbb4gtHBP1aaaNM"}},{"name":"X-Correlation-ID","in":"header","required":true,"description":"An ID which is used to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters.\nMirrored back in a response header.","schema":{"type":"string","example":"11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA"}}],"requestBody":{"description":"The cloudevent+json formatted body representing the event.","required":true,"content":{"application/cloudevents+json":{"schema":{"description":"Multicast Notification Service CloudEvents-compatible format Specification JSON Schema","type":"object","properties":{"id":{"description":"Identifies the event.","type":"string","minLength":1,"example":"236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b"},"source":{"description":"Identifies the producer of the event.","type":"string","minLength":1,"format":"uri-reference","example":"uk.nhs.personal-demographics-service"},"specversion":{"description":"The version of the CloudEvents specification which the event uses.","type":"string","minLength":1,"example":"1.0"},"type":{"description":"Describes the occurrence; the name of the event.","type":"string","minLength":1,"example":"pds-change-of-gp-1"},"subject":{"description":"Describes the subject of the event in the context of the event producer/event type.","type":"string","minLength":1,"example":"9912003888"},"time":{"description":"Timestamp of when the occurrence happened. Must adhere to RFC 3339.","type":"string","format":"date-time","minLength":1,"example":"2018-04-05T17:31:00Z"},"dataref":{"description":"A link to an API on the publishing service to retrieve full information about the event or the subject record.","type":"string","format":"uri","minLength":1,"example":"https://api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888"},"versionid":{"description":"Version identifier for the resource that the event relates to.","type":"string","minLength":1,"example":"12"},"filtering":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"integer"}]}}]},"example":{"filter_option_1":"filter_value_1","filter_option_2":42,"filter_option_3":["one","two","three"],"filter_option_4":[1,2,3]}}},"required":["id","source","specversion","type","time"],"example":{"specversion":"1.0","id":"236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b","source":"uk.nhs.example-service","type":"example-event-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/example-service/9912003888","filtering":{"filter_option_1":"filter_value_1","filter_option_2":42},"subject":"9912003888"}},"examples":{"imms-vaccination-record-change-1":{"description":"Create an immunisation vaccination record change event","value":{"specversion":"1.0","id":"e0b3d12f-c64d-4b29-b23b-4a670941f572","source":"uk.nhs.vaccinations-data-flow-management","type":"imms-vaccination-record-change-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/immunisation-fhir-api/FHIR/R4/Immunization/29dc4e84-7e72-11ee-b962-0242ac120002","subject":"9912003888","filtering":{"generalpractitioner":"FY4563","sourceorganisation":"FT6786","sourceapplication":"RAVS","subjectage":17,"immunisationtype":"HPV","action":"CREATE"}}},"nhshco-hc-complete-1":{"description":"Create a health check complete event","value":{"specversion":"1.0","id":"501c6aea-aff2-4431-b98e-1bf59192b045","source":"uk.nhs.nhs-health-check-online","type":"nhshco-hc-complete-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/patient-data-manager/FHIR/R4/Composition/b0b97bff-e3d7-4744-a09a-e55781886dd0/$document","subject":"9730676240","filtering":{"gppractice":"XY11"}}},"vrs-proxy-role-deleted-1":{"description":"Create a proxy role deleted event","value":{"specversion":"1.0","id":"898cc706-9156-4d67-941a-b37ca9a85861","source":"uk.nhs.validated-relationships-service","type":"vrs-proxy-role-deleted-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/ecc32c41","subject":"9730676240","filtering":{"patient_ods_code":"M7Z0J","proxy_ods_code":"M7Z0J"}}},"vrs-proxy-role-changed-1":{"description":"Create a proxy role changed event","value":{"specversion":"1.0","id":"501c6aea-aff2-4431-b98e-1bf59192b045","source":"uk.nhs.validated-relationships-service","type":"vrs-proxy-role-changed-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/ecc32c41","subject":"9730676240","filtering":{"patient_ods_code":"M7Z0J","proxy_ods_code":"M7Z0J"}}},"vrs-proxy-role-created-1":{"description":"Create a proxy role created event","value":{"specversion":"1.0","id":"501c6aea-aff2-4431-b98e-1bf59192b045","source":"uk.nhs.validated-relationships-service","type":"vrs-proxy-role-created-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/ecc32c41","subject":"9730676240","filtering":{"patient_ods_code":"M7Z0J","proxy_ods_code":"M7Z0J"}}},"pds-record-change-2":{"description":"Create a PDS record change event","value":{"specversion":"1.0","id":"963b28e0-067a-4a3f-bee8-f613c23541b2","source":"https://fhir.nhs.uk/Id/nhsSpineASID/477121000324","type":"pds-record-change-2","time":"2020-06-01T13:00:00Z","subject":"9912003888","versionid":"W/\"16\"","filtering":{"changed_name":true,"registeredgpodscode":"XY11","nhsnumber":"9912003888"}}},"pds-death-notification-2":{"description":"Create a patient death status event","value":{"specversion":"1.0","id":"963b28e0-067a-4a3f-bee8-f613c23541b2","source":"https://fhir.nhs.uk/Id/nhsSpineASID/477121000324","type":"pds-death-notification-2","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","subject":"9912003888"}},"pds-change-of-gp-2":{"description":"Create a change of gp event","value":{"specversion":"1.0","id":"56e9d7db-d70a-48bf-95f8-e779a741382a","source":"https://fhir.nhs.uk/Id/nhsSpineASID/477121000324","type":"pds-change-of-gp-2","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","subject":"9912003888"}},"nhs-number-change-2":{"description":"Create a nhs number change event","value":{"specversion":"1.0","id":"685aec28-70bb-4763-853b-2bdc07a44415","source":"https://fhir.nhs.uk/Id/nhsSpineASID/477121000324","type":"nhs-number-change-2","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","subject":"9912003888"}},"gpreg-change-gp-req-1":{"description":"Create a GP Registration Change event","value":{"specversion":"1.0","id":"236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b","source":"uk.nhs.register-with-a-gp-surgery-service","type":"gpreg-change-gp-req-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/register-with-a-gp-surgery/applications/236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b","subject":"9912003888","filtering":{"registrationencountercode":"3","generalpractitioner":"XY11"}}},"patientflags-change-1":{"description":"Create a Patient Flags Change event","value":{"specversion":"1.0","id":"16dbfb42-b5c0-4831-8258-f1a4d2491748","source":"uk.nhs.patient-flags-service","type":"patientflags-change-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/patient-flags-api/PatientFlag?patient=9912003888&code=NRAF","subject":"9912003888","filtering":{"flagtype":"NRAF","generalpractitioner":"XY11","origin":"pfapi-internal-mns-int"}}},"pathology-laboratory-reporting-test-result-stored-1":{"description":"Create a pathology test result stored event","value":{"specversion":"1.0","id":"236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b","source":"uk.nhs.pathology-laboratory-reporting","type":"pathology-laboratory-reporting-test-result-stored-1","time":"2020-06-01T13:00:00Z","dataref":"https://api.service.nhs.uk/patient-data-manager/FHIR/R4/Bundle/b0b97bff-e3d7-4744-a09a-e55781886dd0","subject":"9912003888","filtering":{"requestingOrganisationODS":"A12345"}}}}},"application/json":{"schema":{"type":"object","required":["id","type","subject","source","time"],"properties":{"id":{"type":"string","description":"Publishers must ensure that the id is unique within their system to ensure that when the MNS team trace messages, they can be certain that source + id will be unique. UUIDv4 format is expected.","example":"236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b"},"type":{"type":"string","description":"A unique string representing the event type.","example":"pds-change-of-gp-1"},"subject":{"type":"object","description":"The healthcare entity to which the event occurred. For example, this could be an NHS organisation or a person such as an NHS patient or member of staff.\nWe currently only have a schema for a patient as a subject but will work with you to agree a new schema if you have a different use case.\n","required":["nhsNumber","familyName","dob"],"example":{"nhsNumber":"9912003888","familyName":"DAWKINS","dob":"2017-10-02"},"properties":{"nhsNumber":{"type":"string","description":"NHS Number validated in line with https://www.datadictionary.nhs.uk/attributes/nhs_number.html."},"familyName":{"type":"string","description":"Last name, capitalised"},"dob":{"type":"string","format":"date","description":"ISO-8601 is the required format. However, due to data quality inconsistencies in demographic records, both 'YYYY' and 'YYYY-MM' formats are also acceptable. Refer to the [PDS FHIR API documentation](https://digital.nhs.uk/developer/api-catalogue/personal-demographics-service-fhir#get-/Patient) for further clarification on the accepted formats."}}},"source":{"type":"object","required":["name","identifier"],"description":"Organisation responsible for publishing the event.","properties":{"name":{"type":"string","description":"Organisation name"},"identifier":{"type":"object","required":["system","value"],"description":"Must follow this identifier system: https://fhir.nhs.uk/Id/nhsSpineASID and provide the ASID Code as the value.","properties":{"system":{"type":"string"},"value":{"type":"string"}}}},"example":{"name":"NHS Digital","identifier":{"system":"https://fhir.nhs.uk/Id/nhsSpineASID","value":"477121000324"}}},"time":{"type":"string","format":"date-time","description":"The time at which the event is published. This must be a compliant RFC3339 datetime in line with the FHIR standard for [system instants](https://hl7.org/fhir/R4/datatypes.html#instant). This means it can have seconds or milliseconds precision.","example":"2022-04-05T17:31:00.000Z"},"data":{"type":"object","description":"This field is optional, dependent on the agreements between the publishing system and the MNS team. While the data schema might vary based on the system and use-case, it is preferred to include a pointer for subscribers to access the full record when necessary for their workflow.","oneOf":[{"type":"object","description":"","required":["fullUrl","provenance","registrationEncounterCode","versionId"],"properties":{"versionId":{"type":"string","example":"W/\"2\"","description":"The versionId/ETAG identifies the version of the resource. The format should be a version identifier enclosed in quotes and preceded by 'W/'."},"fullUrl":{"type":"string","example":"https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","description":"The URL where the subscriber can retrieve the source of truth record for the patient or the full event payload."},"registrationEncounterCode":{"type":"string","example":"3","description":"Numeric code that represents the type of GP registration that occurred. This field is only provided for the pds-change-of-gp-1 event type.\nThe permitted codes are as follows:\n| Code | Type               | Description                                                                                                      |\n| ---- | ------------------ | ---------------------------------------------------------------------------------------------------------------- |\n| 1    |  Birth             | At the time of registration, if the patient has been born in the last year then it is counted as such.           |\n| 2    |  First Acceptance  | Very rare scenario - patient is a UK National and has never previously been registered with an NHS GP Practice.  |\n| 3    |  Transfer In       | Accounts for the vast majority of registrations - a patient registers with a new GP Practice.                    |\n| 4    |  Immigrant         | A patient has moved to the UK and registers with a GP Practice .                                                 |\n| 6    |  Internal Transfer | A deprecated type. In [NHAIS](https://digital.nhs.uk/services/nhais) a transfer between two GP practices in the same NHAIS region is counted as this type within [PCRM](https://digital.nhs.uk/services/primary-care-registration-management) registrations are centralised and will be counted as Type 3. |\n| -    |  Blank             | Before a GP Registration is approved by Primary Care Support using NHAIS or PCRM, there is an initial GP-Links transaction sent by the GP Practice. This initial transaction will result in a event where the registration encounter code is set as an empty string. A subsequent event is created when the registration is processed, which this time includes a registration encounter code e.g. Type 3.  In the case of a GP Practice merge or split, the registration encounter code will also be an empty string. |\n"},"provenance":{"type":"object","description":"The provenance describes which organisation was responsible for the creation of the event.","required":["name","identifier"],"properties":{"name":{"type":"string","example":"The GP Practice","description":"The name of the organisation responsible for the creating the event. This may be an empty string due to publisher data issues."},"identifier":{"type":"object","required":["system","value"],"description":"Must follow this identifier system: https://fhir.nhs.uk/Id/nhsSpineASID and provide the ASID value and name of the system.","properties":{"system":{"type":"string","example":"https://fhir.nhs.uk/Id/nhsSpineASID"},"value":{"type":"string","example":"477121000323"}}}}}}},{"type":"object","description":"","required":["deathNotificationStatus","fullUrl","provenance","versionId"],"properties":{"deathNotificationStatus":{"type":"string","example":"2","description":"A set of coded values that represent the status of the death notification. This field is only provided for the pds-death-notification-1 event type.\nThe permitted codes are as follows:\n| Code | Type                  | Description                                                                                                      |\n| ---- | --------------------- | ---------------------------------------------------------------------------------------------------------------- |\n| 1    |  Informal             | This status is added when there is an understanding that a person passed away but it lacks official documentation. e.g. a death notice is received via an update from a local NHS Organisation such as a GP Practice or NHS Trust. |\n| 2    |  Formal               | This formal status is established through the completion and filing of a death certificate, which contains details about the deceased individual, including their name, date and place of death, cause of death (if known), and other relevant information. Formal confirmation is received from the Registrar of Deaths. |\n| U    |  Death Status Removed | A revocation of a patient death event as the death was entered in error, the patient is NOT DEAD.                    |\n"},"versionId":{"type":"string","example":"W/\"16\"","description":"The versionId/ETAG identifies the version of the resource. The format should be a version identifier enclosed in quotes and preceded by 'W/'."},"fullUrl":{"type":"string","example":"https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","description":"The URL where the subscriber can retrieve the source of truth record for the patient or the full event payload."},"provenance":{"type":"object","description":"The provenance describes which organisation was responsible for the creation of the event.","required":["name","identifier"],"properties":{"name":{"type":"string","example":"The GP Practice","description":"The name of the organisation responsible for the creating the event. This may be an empty string due to publisher data issues."},"identifier":{"type":"object","required":["system","value"],"description":"Must follow this identifier system: https://fhir.nhs.uk/Id/nhsSpineASID and provide the ASID value and name of the system.","properties":{"system":{"type":"string","example":"https://fhir.nhs.uk/Id/nhsSpineASID"},"value":{"type":"string","example":"477121000323"}}}}}}},{"type":"object","description":"","required":["nhsNumberStatus","fullUrl","provenance","versionId"],"properties":{"nhsNumberStatus":{"type":"string","description":"A set of coded values that represent the status of the NHS Number which is the subject of the change. This field is only provided for the nhs-number-change-1 event type.\nThe permitted codes are as follows:\n| Code | Type                  | Description                                                                                                      |\n| ---- | --------------------- | ---------------------------------------------------------------------------------------------------------------- |\n| I    |  Invalidated          | Part of the NHS Patient 'sensitivity' information and indicates that a specific NHS Number has been invalidated. |\n| R    |  Replaced             | An NHS Number has been superseded by or replaced by another NHS number for instance in the case of a merge.      |\n"},"versionId":{"type":"string","example":"W/\"16\"","description":"The versionId/ETAG identifies the version of the resource. The format should be a version identifier enclosed in quotes and preceded by 'W/'."},"fullUrl":{"type":"string","example":"https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","description":"The URL where the subscriber can retrieve the source of truth record for the patient or the full event payload."},"provenance":{"type":"object","description":"The provenance describes which organisation was responsible for the creation of the event.","required":["name","identifier"],"properties":{"name":{"type":"string","example":"The GP Practice","description":"The name of the organisation responsible for the creating the event. This may be an empty string due to publisher data issues."},"identifier":{"type":"object","required":["system","value"],"description":"Must follow this identifier system: https://fhir.nhs.uk/Id/nhsSpineASID and provide the ASID value and name of the system.","properties":{"system":{"type":"string","example":"https://fhir.nhs.uk/Id/nhsSpineASID"},"value":{"type":"string","example":"477121000323"}}}}}}}],"example":{"versionId":"W/\"2\"","fullUrl":"https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","registrationEncounterCode":"3","provenance":{"name":"The GP Practice","identifier":{"system":"https://fhir.nhs.uk/Id/nhsSpineASID","value":"477121000323"}}}}}},"examples":{"pdsChangeOfGpEvent":{"description":"(Version 1 Deprecated) Create a change of gp event","value":{"id":"56e9d7db-d70a-48bf-95f8-e779a741382a","type":"pds-change-of-gp-1","subject":{"nhsNumber":"9912003888","familyName":"DAWKINS","dob":"2017-10-02"},"source":{"name":"NHS Digital","identifier":{"system":"https://fhir.nhs.uk/Id/nhsSpineASID","value":"477121000324"}},"time":"2022-04-05T17:31:00.000Z","data":{"versionId":"W/\"2\"","fullUrl":"https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","registrationEncounterCode":"3","provenance":{"name":"The GP Practice","identifier":{"system":"https://fhir.nhs.uk/Id/nhsSpineASID","value":"477121000323"}}}}},"pdsDeathEvent":{"description":"(Version 1 Deprecated) Create a patient death status event","value":{"id":"963b28e0-067a-4a3f-bee8-f613c23541b2","type":"pds-death-notification-1","subject":{"dob":"2017-10-02","familyName":"DAWKINS","nhsNumber":"9912003888"},"source":{"name":"NHS DIGITAL","identifier":{"system":"https://fhir.nhs.uk/Id/nhsSpineASID","value":"477121000324"}},"time":"2022-04-05T17:31:00.000Z","data":{"versionId":"W/\"16\"","fullUrl":"https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","deathNotificationStatus":"2","provenance":{"name":"The GP Practice","identifier":{"system":"https://fhir.nhs.uk/Id/nhsSpineASID","value":"477121000323"}}}}},"nhsNumberChangeEvent":{"description":"(Version 1 Deprecated) Create a nhs number change event","value":{"id":"685aec28-70bb-4763-853b-2bdc07a44415","type":"nhs-number-change-1","subject":{"dob":"2017-10-02","familyName":"DAWKINS","nhsNumber":"9912003888"},"source":{"name":"NHS DIGITAL","identifier":{"system":"https://fhir.nhs.uk/Id/nhsSpineASID","value":"477121000324"}},"time":"2022-04-05T17:31:00.000Z","data":{"versionId":"W/\"16\"","fullUrl":"https://int.api.service.nhs.uk/personal-demographics/FHIR/R4/Patient/9912003888","nhsNumberStatus":"I","provenance":{"name":"The GP Practice","identifier":{"system":"https://fhir.nhs.uk/Id/nhsSpineASID","value":"477121000323"}}}}}}}}},"responses":{"200":{"description":"Success - the event is accepted and will be multicast to subscribers","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The id provided in the user's payload","example":"236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b"}}}}}},"400":{"description":"Invalid user input","content":{"application/json":{"schema":{"type":"object","properties":{"validationErrors":{"type":"object","description":"Object containing the different errors on a per key basis","properties":{"type":{"type":"string","example":"Please provide a valid event type"}}}}}}}},"401":{"description":"Unauthenticated error","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string","example":"Invalid access token"},"detail":{"type":"object","properties":{"errorcode":{"type":"string","example":"oauth.v2.InvalidAccessToken"}},"example":{"detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"example":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}}}},"examples":{"invalidToken":{"value":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"tokenMissing":{"value":{"fault":{"faultstring":"Missing access token","detail":{"errorcode":"oauth.v2.MissingAccessToken"}}}},"tokenExpired":{"value":{"fault":{"faultstring":"Access Token expired","detail":{"errorcode":"keymanagement.service.access_token_expired"}}}}}}}},"403":{"description":"Unauthorized error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"User is not authorized to handle the requested event type"}}}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string describing the problem that occurred","example":"Internal server error"}},"example":{"errors":"Internal server error"}}}}}}}},"/subscriptions":{"post":{"summary":"Subscribe to events","tags":["subscriptions"],"description":"### Overview\nUse this endpoint to subscribe to healthcare-related events. You can view details of the available events on the [Multicast Notification Service Events Catalogue](https://digital.nhs.uk/developer/api-catalogue/multicast-notification-service/multicast-notification-service-events-catalogue).\n\n### Subscription filtering\nYou can filter the events you want to receive using the `criteria` field in the payload. As a minimum, you must specify the event type. For example, if you provide `eventType=gpreg-change-gp-req-1`\nthis will mean that you receive all Validated GP Registration Request events. Depending on the event, additional filters are available, for example you can filter by `generalpractitioner`,`registrationencountercode` or `generalpractitioner_manufacturer_org` for `gpreg-change-gp-req-1` event.\nWe are working with publishers and subscribers during private beta to identify any other useful filters for existing and future event types.\n\nFor further information refer to the payload schema below.\n\n### Subscription delivery\nYou can specify the endpoint you want events delivered to using the `channel.endpoint` field in the payload. MNS currently only supports delivery to [AWS SQS](https://aws.amazon.com/sqs/) endpoints and\n[MESH](https://digital.nhs.uk/services/message-exchange-for-social-care-and-health-mesh) mailboxes. We are working with users during private beta to identify other potential delivery endpoints.\nThere may be further delivery endpoints available in future.\n\nYou can make suggestions using [feature upvote](https://nhs-digital-api-management.featureupvote.com).\n\n#### SQS Delivery\nBefore events can be delivered to your SQS queue, you will need to complete some configuration steps during onboarding e.g. policy and encryption setup. When you make a create subscription request, you must provide your\nfull SQS ARN.\n\n#### MESH Delivery\nIf you have already completed [MESH onboarding](https://digital.nhs.uk/developer/api-catalogue/message-exchange-for-social-care-and-health-api#overview--end-to-end-process-to-integrate-with-mesh-api)\nthen no further steps will be required aside from calling the subscriptions API. Use a MESH mailbox from their 'Path to Live integration' environment for all non-production MNS environments and a production mailbox for production MNS.\n\nThe mailbox ID and workflow ID you require are supplied to the `channel.endpoint` field in a `mesh://` URL scheme.\n\ne.g. `mesh://MYMAILBOXOT101?workflow_id=myWorkflow101` specifies the mailbox ID `MYMAILBOXOT101` and the workflow ID `myWorkflow101`.\n\n### Sandbox testing\nYou can test the following scenarios in our sandbox environment:\n\n| Scenario                                 | Request                                                                  | Response                                                                    |\n| ---------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------- |\n| Subscribe to an event                    | Content-Type: `application/fhir+json`                                    | HTTP Status 201 and response containing the id of the subscription created. |\n| Publish a subscription with invalid data | E.g. modify the subscription to have an invalid value for `resourceType` | HTTP Status 400 and response containing a validation error.                 |\n\nYou can try out the sandbox using the 'Try this API' feature on this page.\n","operationId":"create-subscription","parameters":[{"name":"Authorization","in":"header","required":true,"description":"An [OAuth 2.0 bearer token](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication).\nRequired in all environments except sandbox.","schema":{"type":"string","format":"^Bearer [[:ascii:]]+$","example":"Bearer g1112R_ccQ1Ebbb4gtHBP1aaaNM"}},{"name":"X-Correlation-ID","in":"header","required":true,"description":"An ID which is used to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters.\nMirrored back in a response header.","schema":{"type":"string","example":"11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA"}}],"requestBody":{"required":true,"description":"The subscription payload","content":{"application/fhir+json":{"schema":{"type":"object","required":["resourceType","status","reason","criteria","channel"],"properties":{"resourceType":{"type":"string","description":"The subscription FHIR Resource: https://hl7.org/fhir/R4/subscription.html","enum":["Subscription"],"example":"Subscription"},"status":{"type":"string","description":"The status of the subscription. The value must be `requested`.","enum":["requested"],"example":"requested"},"end":{"type":"string","format":"date-time","description":"Optional expiry date/time for the subscription. As per the [FHIR R4 instant data type](https://hl7.org/fhir/R4/datatypes.html#instant) time shall be specified to at least the second and include a time zone.\nFor example: YYYY-MM-DDThh:mm:ss.sss+zz:zz (e.g. 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z) **Note** that under the current implementation this field is not used.\n","example":"2022-04-05T17:31:00.000Z"},"reason":{"type":"string","description":"A description of why this subscription is required. You may provide an empty string.","example":"Business process A"},"criteria":{"type":"string","pattern":"^eventType=.*$","description":"Criteria for the subscription. A valid criteria must contain a permitted value for `eventType`.\nAdditional criteria depends on the event and is documented on our\n[Event Catalogue page](https://digital.nhs.uk/developer/api-catalogue/multicast-notification-service/multicast-notification-service-events-catalogue).\nExamples: `eventType='gpreg-change-gp-req-1'` or `eventType='gpreg-change-gp-req-1' AND generalpractitioner='XY11'`\n","example":"eventType='gpreg-change-gp-req-1' AND generalpractitioner='XY11'"},"channel":{"type":"object","required":["type","endpoint","payload"],"description":"The channel on which to report matches to the criteria. SQS Endpoints must be unique per event type; attempts to add a subscription with an endpoint which is already in-use will fail with a HTTP 409 (Conflict)","properties":{"type":{"type":"string","description":"The type of channel to send notifications on. Of the options within [FHIR](https://hl7.org/fhir/R4/valueset-subscription-channel-type.html), MNS currently only supports `message`.","enum":["message"],"example":"message"},"endpoint":{"type":"string","pattern":"^(mesh://[\\w]*\\?workflow_id=[\\w_.-]+|arn:aws:sqs:eu-west-2:\\d{0,12}:[\\w_.-]*)$","description":"The endpoint which events will be delivered to. MNS currently only supports delivery to [MESH](https://digital.nhs.uk/services/message-exchange-for-social-care-and-health-mesh) mailboxes and [AWS SQS](https://aws.amazon.com/sqs/) endpoints. Note: for MESH delivery you must provide the full mailbox ID and for SQS delivery you must provide the full SQS ARN of your desired queue."},"payload":{"type":"string","description":"The mime type to send the payload in. MNS supports `application/json` and `application/fhir+json` (FHIR R4 Bundle)."}},"example":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue123","payload":"application/fhir+json"}},"hydration":{"type":"object","required":["enabled"],"description":"Optional block to configure hydration properties - hydration is disabled by default.","properties":{"enabled":{"type":"boolean","description":"A flag to enable (true) or disable (false) event hydration.","example":true},"headers":{"type":"object","description":"An optional dictionary of HTTP headers that will be sent in the request to the API endpoint specified in the event.","additionalProperties":{"type":"string","description":"HTTP header that will be sent in the request to the API endpoint specified in the event."},"example":{"custom_header_1":"custom_value_1","custom_header_2":"custom_value_2"}}}}}},"examples":{"immsVaccinationRecordChangeSubscription":{"description":"Immunisation vaccination record change subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=imms-vaccination-record-change-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/fhir+json"}}},"healthCheckCompleteSubscription":{"description":"Health check complete subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=nhshco-hc-complete-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"vrsProxyRoleChangeDeletedSubscription":{"description":"VRS proxy role deleted","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=vrs-proxy-role-deleted-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"vrsProxyRoleChangedSubscription":{"description":"VRS proxy role changed","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=vrs-proxy-role-changed-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"vrsProxyRoleCreatedSubscription":{"description":"VRS proxy role created","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=vrs-proxy-role-created-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"pdsRecordChangeSubscription":{"description":"PDS record change subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=pds-record-change-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"pdsChangeofGPSubscription":{"description":"PDS change of GP subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=pds-change-of-gp-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"pdsChangeofGPSubscriptionMeshDelivery":{"description":"PDS change of GP subscription with MESH delivery","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=pds-change-of-gp-2","channel":{"type":"message","endpoint":"mesh://MYMAILBOXOT101?workflow_id=MY_WORKFLOW_1.1-A","payload":"application/json"}}},"nhsNumberChangeSubscription":{"description":"NHS number change subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=nhs-number-change-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/json"}}},"pdsDeathNotificationSubscription":{"description":"PDS death notification subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=pds-death-notification-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/fhir+json"}}},"validatedGPRegistrationRequestSubscription":{"description":"GP registration request event subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType='gpreg-change-gp-req-1' AND generalpractitioner_manufacturer_org='Y12345' AND registrationencountercode='3'","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/fhir+json"}}},"patientflagsChangeSubscription":{"description":"Patient Flags Change subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType='patientflags-change-1' AND flagtype='NRAF' AND generalpractitioner='XY11'","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/fhir+json"}}},"pathologyLaboratoryReportingTestResultStoredSubscription":{"description":"Pathology Laboratory Reporting Test Result Stored subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType='pathology-laboratory-reporting-test-result-stored-1' AND requestingOrganisationODS_manufacturer_org='A12345'","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/json"}}}}}}},"responses":{"201":{"description":"Created - the subscription has been successfully created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The subscription UUID created by the system","example":"236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b"}}}}}},"400":{"description":"Invalid user input","content":{"application/json":{"schema":{"type":"object","properties":{"validationErrors":{"type":"object","description":"Object containing the different errors on a per key basis","properties":{"resourceType":{"type":"string","example":"Please provide the correct resource type for this endpoint"}}}}}}}},"401":{"description":"Unauthenticated error","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string","example":"Invalid access token"},"detail":{"type":"object","properties":{"errorcode":{"type":"string","example":"oauth.v2.InvalidAccessToken"}},"example":{"detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"example":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}}}},"examples":{"invalidToken":{"value":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"tokenMissing":{"value":{"fault":{"faultstring":"Missing access token","detail":{"errorcode":"oauth.v2.MissingAccessToken"}}}},"tokenExpired":{"value":{"fault":{"faultstring":"Access Token expired","detail":{"errorcode":"keymanagement.service.access_token_expired"}}}}}}}},"403":{"description":"Unauthorised error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Unauthorised"}}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"A matching SQS subscription already exists with id: ab40a960-fc6a-426c-965f-2bff8a0bd74f"}}},"example":{"errors":"A matching SQS subscription already exists with id: ab40a960-fc6a-426c-965f-2bff8a0bd74f"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string describing the problem that occurred","example":"Internal server error"}},"example":{"errors":"Internal server error"}}}}}}},"get":{"summary":"Get all subscriptions","tags":["subscriptions"],"description":"### Overview\nUse this endpoint to retrieve a list of all subscriptions belonging to you.\nIf your application does not own any subscriptions, then this endpoint will return an empty list.\nThe list of subscriptions is presented in a FHIR resource bundle, allowing pagination.\n\n### Sandbox testing\nYou can test the following scenarios in our sandbox environment:\n\n| Scenario                         | Request       | Response                                                    |\n| -------------------------------- | ------------- | ----------------------------------------------------------- |\n| User has a list of subscriptions | `GET` request | HTTP Status 200 containing a list of subscription resources |\n\nYou can try out the sandbox using the 'Try this API' feature on this page.\n","operationId":"get-all-subscriptions","parameters":[{"name":"Authorization","in":"header","required":true,"description":"An [OAuth 2.0 bearer token](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication).\nRequired in all environments except sandbox.","schema":{"type":"string","format":"^Bearer [[:ascii:]]+$","example":"Bearer g1112R_ccQ1Ebbb4gtHBP1aaaNM"}},{"name":"X-Correlation-ID","in":"header","required":true,"description":"An ID which is used to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters.\nMirrored back in a response header.","schema":{"type":"string","example":"11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA"}},{"name":"continue_from","in":"query","required":false,"description":"An optional query string parameter used for pagination, specifying the point from which to continue the list.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved list of subscriptions","content":{"application/fhir+json":{"schema":{"type":"object","properties":{"resourceType":{"type":"string","enum":["Bundle"],"example":"Bundle"},"type":{"type":"string","enum":["searchset"],"example":"searchset"},"link":{"type":"array","items":{"type":"object","properties":{"relation":{"type":"string","description":"Relation type, e.g., 'self', 'next'. The 'next' relation is present only if there's additional content to paginate through."},"url":{"type":"string","description":"The URL for the relation. For 'next', this URL points to the next page of results."}}},"example":[{"relation":"next","url":"/subscriptions?continue_from=ZmRqa2xmZGprc2xmamtsZHNqZmxkc2Zkcw=="}]},"entry":{"type":"array","items":{"type":"object","description":"The schema for a [FHIR R4 Subscription resource](https://hl7.org/fhir/R4/subscription.html)","required":["id","resourceType","status","reason","criteria","channel"],"properties":{"id":{"type":"string","example":"e9050741-ae87-4720-beb1-2abd9248e227","description":"A unique identifier representing for the given Subscription resource"},"resourceType":{"type":"string","example":"Subscription","description":"A [FHIR R4 Subscription resource](https://hl7.org/fhir/R4/subscription.html)"},"status":{"type":"string","example":"active","description":"The status of the subscription. Value can be requested | active | error | off"},"end":{"type":"string","format":"date-time","example":"2024-04-05T17:00:00.000Z","description":"Optional expiry date/time for the subscription. As per the [FHIR R4 instant data type](https://hl7.org/fhir/R4/datatypes.html#instant) time shall be specified to at least the second and include a time zone.\nFor example: YYYY-MM-DDThh:mm:ss.sss+zz:zz (e.g. 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z) **Note** that under the current implementation this field is not used.\n"},"reason":{"type":"string","example":"","description":"A description of why this subscription was required. The value may be an empty string."},"criteria":{"type":"string","example":"eventType=pds-change-of-gp-2","description":"The criteria of the subscription."},"channel":{"type":"object","description":"The channel on which to report matches to the criteria.","required":["type","endpoint","payload"],"properties":{"type":{"type":"string","example":"message","description":"The type of channel to send notifications on. Of the options within [FHIR](https://hl7.org/fhir/R4/valueset-subscription-channel-type.html), MNS currently only supports `message`."},"endpoint":{"type":"string","example":"arn:aws:sqs:eu-west-2:12345:example-queue-123","description":"The end-point to send messages to. MNS currently only supports SQS Queue endpoints but there are future plans to look at further options such as HTTPS endpoints."},"payload":{"type":"string","example":"application/json","description":"The mime type to send the payload in. MNS supports `application/json` and `application/fhir+json` (FHIR R4 Bundle)."}}}}},"example":[{"channel":{"endpoint":"arn:aws:sqs:eu-west-2:123456789012:test-queue","payload":"application/json","type":"message"},"criteria":"eventType=mns-test-signal-1","end":"2024-01-25T00:00:00.000Z","id":"0e381025-985f-4696-a460-6c375b76e4d0","reason":"","resourceType":"Subscription","status":"active"}]}}},"example":{"resourceType":"Bundle","type":"searchset","link":[{"relation":"self","url":"/subscriptions"}],"entry":[{"channel":{"endpoint":"arn:aws:sqs:eu-west-2:123456789012:test-queue","payload":"application/json","type":"message"},"criteria":"eventType=mns-test-signal-1","end":"2024-01-25T00:00:00.000Z","id":"0e381025-985f-4696-a460-6c375b76e4d0","reason":"","resourceType":"Subscription","status":"active"}]}}}},"400":{"description":"Invalid user input","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"The continue_from field was not valid"}}}}}},"401":{"description":"Unauthenticated error","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string","example":"Invalid access token"},"detail":{"type":"object","properties":{"errorcode":{"type":"string","example":"oauth.v2.InvalidAccessToken"}},"example":{"detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"example":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}}}},"examples":{"invalidToken":{"value":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"tokenMissing":{"value":{"fault":{"faultstring":"Missing access token","detail":{"errorcode":"oauth.v2.MissingAccessToken"}}}},"tokenExpired":{"value":{"fault":{"faultstring":"Access Token expired","detail":{"errorcode":"keymanagement.service.access_token_expired"}}}}}}}},"403":{"description":"Unauthorised error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Unauthorised"}}}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string describing the problem that occurred","example":"Internal server error"}},"example":{"errors":"Internal server error"}}}}}}}},"/subscriptions/{id}":{"get":{"summary":"Get subscription details","tags":["subscriptions"],"description":"### Overview\nUse this endpoint to retrieve details of a subscription belonging to you.\n\n### Sandbox testing\nYou can test the following scenarios in our sandbox environment:\n\n| Scenario                                  | Request                                                                  | Response                                                                    |\n| ----------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------- |\n| Subscription exists and can be retrieved  | `id=e9050741-ae87-4720-beb1-2abd9248e227`                                | HTTP Status 200 containing subscription details                             |\n| Subscription does not exist               | `id=236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b` (or any other valid UUID)      | HTTP Status 404 containing problem description                              |\n\nYou can try out the sandbox using the 'Try this API' feature on this page.\n","operationId":"get-subscription-by-id","parameters":[{"name":"Authorization","in":"header","required":true,"description":"An [OAuth 2.0 bearer token](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication).\nRequired in all environments except sandbox.","schema":{"type":"string","format":"^Bearer [[:ascii:]]+$","example":"Bearer g1112R_ccQ1Ebbb4gtHBP1aaaNM"}},{"name":"X-Correlation-ID","in":"header","required":true,"description":"An ID which is used to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters.\nMirrored back in a response header.","schema":{"type":"string","example":"11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA"}},{"name":"id","in":"path","required":true,"description":"The ID of the subscription you want to retrieve. The ID will be a valid UUID (v4).","schema":{"type":"string","example":"e9050741-ae87-4720-beb1-2abd9248e227"}}],"responses":{"200":{"description":"Successfully got subscription details","content":{"application/fhir+json":{"schema":{"type":"object","description":"The schema for a [FHIR R4 Subscription resource](https://hl7.org/fhir/R4/subscription.html)","required":["id","resourceType","status","reason","criteria","channel"],"properties":{"id":{"type":"string","example":"e9050741-ae87-4720-beb1-2abd9248e227","description":"A unique identifier representing for the given Subscription resource"},"resourceType":{"type":"string","example":"Subscription","description":"A [FHIR R4 Subscription resource](https://hl7.org/fhir/R4/subscription.html)"},"status":{"type":"string","example":"active","description":"The status of the subscription. Value can be requested | active | error | off"},"end":{"type":"string","format":"date-time","example":"2024-04-05T17:00:00.000Z","description":"Optional expiry date/time for the subscription. As per the [FHIR R4 instant data type](https://hl7.org/fhir/R4/datatypes.html#instant) time shall be specified to at least the second and include a time zone.\nFor example: YYYY-MM-DDThh:mm:ss.sss+zz:zz (e.g. 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z) **Note** that under the current implementation this field is not used.\n"},"reason":{"type":"string","example":"","description":"A description of why this subscription was required. The value may be an empty string."},"criteria":{"type":"string","example":"eventType=pds-change-of-gp-2","description":"The criteria of the subscription."},"channel":{"type":"object","description":"The channel on which to report matches to the criteria.","required":["type","endpoint","payload"],"properties":{"type":{"type":"string","example":"message","description":"The type of channel to send notifications on. Of the options within [FHIR](https://hl7.org/fhir/R4/valueset-subscription-channel-type.html), MNS currently only supports `message`."},"endpoint":{"type":"string","example":"arn:aws:sqs:eu-west-2:12345:example-queue-123","description":"The end-point to send messages to. MNS currently only supports SQS Queue endpoints but there are future plans to look at further options such as HTTPS endpoints."},"payload":{"type":"string","example":"application/json","description":"The mime type to send the payload in. MNS supports `application/json` and `application/fhir+json` (FHIR R4 Bundle)."}}}}},"example":{"id":"e9050741-ae87-4720-beb1-2abd9248e227","resourceType":"Subscription","status":"active","end":"2022-04-05T17:31:00.000Z","reason":"Business case A","criteria":"eventType=pds-change-of-gp-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}}}},"400":{"description":"Invalid user input","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Please provide a valid subscription ID in UUID4 format"}}}}}},"401":{"description":"Unauthenticated error","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string","example":"Invalid access token"},"detail":{"type":"object","properties":{"errorcode":{"type":"string","example":"oauth.v2.InvalidAccessToken"}},"example":{"detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"example":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}}}},"examples":{"invalidToken":{"value":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"tokenMissing":{"value":{"fault":{"faultstring":"Missing access token","detail":{"errorcode":"oauth.v2.MissingAccessToken"}}}},"tokenExpired":{"value":{"fault":{"faultstring":"Access Token expired","detail":{"errorcode":"keymanagement.service.access_token_expired"}}}}}}}},"403":{"description":"Unauthorised error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Unauthorised"}}}}}},"404":{"description":"Not found error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Not found"}}}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string describing the problem that occurred","example":"Internal server error"}},"example":{"errors":"Internal server error"}}}}}}},"delete":{"summary":"Delete a subscription","tags":["subscriptions"],"description":"### Overview\nUse this endpoint to delete a subscription that you need to remove.\n\n### Sandbox testing\nYou can test the following scenarios in our sandbox environment:\n\n| Scenario                                  | Request                                                                  | Response                                                                    |\n| ----------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------- |\n| Subscription exists and can be deleted    | `id=e9050741-ae87-4720-beb1-2abd9248e227`                                | HTTP Status 204 resource deleted response                                    |\n| Subscription does not exist               | `id=236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b` (or any other valid UUID)      | HTTP Status 404 containing problem description                              |\n\nYou can try out the sandbox using the 'Try this API' feature on this page.\n","operationId":"delete-subscription","parameters":[{"name":"Authorization","in":"header","required":true,"description":"An [OAuth 2.0 bearer token](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication).\nRequired in all environments except sandbox.","schema":{"type":"string","format":"^Bearer [[:ascii:]]+$","example":"Bearer g1112R_ccQ1Ebbb4gtHBP1aaaNM"}},{"name":"X-Correlation-ID","in":"header","required":true,"description":"An ID which is used to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters.\nMirrored back in a response header.","schema":{"type":"string","example":"11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA"}},{"name":"id","in":"path","required":true,"description":"The ID of the subscription you want to retrieve. The ID will be a valid UUID (v4).","schema":{"type":"string","example":"e9050741-ae87-4720-beb1-2abd9248e227"}}],"responses":{"204":{"description":"The subscription was deleted"},"400":{"description":"Invalid user input","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Please provide a valid subscription ID in UUID4 format"}}}}}},"401":{"description":"Unauthenticated error","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string","example":"Invalid access token"},"detail":{"type":"object","properties":{"errorcode":{"type":"string","example":"oauth.v2.InvalidAccessToken"}},"example":{"detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"example":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}}}},"examples":{"invalidToken":{"value":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"tokenMissing":{"value":{"fault":{"faultstring":"Missing access token","detail":{"errorcode":"oauth.v2.MissingAccessToken"}}}},"tokenExpired":{"value":{"fault":{"faultstring":"Access Token expired","detail":{"errorcode":"keymanagement.service.access_token_expired"}}}}}}}},"403":{"description":"Unauthorised error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Unauthorised"}}}}}},"404":{"description":"Not found error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Not found"}}}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string describing the problem that occurred","example":"Internal server error"}},"example":{"errors":"Internal server error"}}}}}}},"put":{"summary":"Edit a subscription","tags":["subscriptions"],"description":"### Overview\nUse this endpoint to edit (update) an existing subscription.\nThe update will apply immediately, overwriting the existing subscription with the given id.\n\n### Sandbox testing\nYou can test the following scenarios in our sandbox environment:\n\n| Scenario                                  | Request                                                                  | Response                                                                    |\n| ----------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------- |\n| Subscription exists and can be updated    | `id=e9050741-ae87-4720-beb1-2abd9248e227`                                | HTTP Status 204 resource updated response                                   |\n| Subscription does not exist               | `id=236a1d4a-5d69-4fa9-9c7f-e72bf505aa5b` (or any other valid UUID)      | HTTP Status 404 containing problem description                              |\n| Matching subscription already exists      | `id=f8f44c83-a697-4607-8604-a1a45acedd8c`                                | HTTP Status 409 containing problem description                              |\n| Publish a subscription with invalid data  | Modify the subscription to have an invalid value for `resourceType`      | HTTP Status 400 and response containing a validation error.                 |\n\nYou can try out the sandbox using the 'Try this API' feature on this page.\n","operationId":"update-subscription","parameters":[{"name":"Authorization","in":"header","required":true,"description":"An [OAuth 2.0 bearer token](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/application-restricted-restful-apis-signed-jwt-authentication).\nRequired in all environments except sandbox.","schema":{"type":"string","format":"^Bearer [[:ascii:]]+$","example":"Bearer g1112R_ccQ1Ebbb4gtHBP1aaaNM"}},{"name":"X-Correlation-ID","in":"header","required":true,"description":"An ID which is used to track transactions across multiple systems. It can take any value, but we recommend avoiding `.` characters.\nMirrored back in a response header.","schema":{"type":"string","example":"11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA"}},{"name":"id","in":"path","required":true,"description":"The ID of the subscription you want to retrieve. The ID will be a valid UUID (v4).","schema":{"type":"string","example":"e9050741-ae87-4720-beb1-2abd9248e227"}}],"requestBody":{"required":true,"description":"The subscription payload","content":{"application/fhir+json":{"schema":{"type":"object","required":["resourceType","status","reason","criteria","channel"],"properties":{"resourceType":{"type":"string","description":"The subscription FHIR Resource: https://hl7.org/fhir/R4/subscription.html","enum":["Subscription"],"example":"Subscription"},"status":{"type":"string","description":"The status of the subscription. The value must be `requested`.","enum":["requested"],"example":"requested"},"end":{"type":"string","format":"date-time","description":"Optional expiry date/time for the subscription. As per the [FHIR R4 instant data type](https://hl7.org/fhir/R4/datatypes.html#instant) time shall be specified to at least the second and include a time zone.\nFor example: YYYY-MM-DDThh:mm:ss.sss+zz:zz (e.g. 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z) **Note** that under the current implementation this field is not used.\n","example":"2022-04-05T17:31:00.000Z"},"reason":{"type":"string","description":"A description of why this subscription is required. You may provide an empty string.","example":"Business process A"},"criteria":{"type":"string","pattern":"^eventType=.*$","description":"Criteria for the subscription. A valid criteria must contain a permitted value for `eventType`.\nAdditional criteria depends on the event and is documented on our\n[Event Catalogue page](https://digital.nhs.uk/developer/api-catalogue/multicast-notification-service/multicast-notification-service-events-catalogue).\nExamples: `eventType='gpreg-change-gp-req-1'` or `eventType='gpreg-change-gp-req-1' AND generalpractitioner='XY11'`\n","example":"eventType='gpreg-change-gp-req-1' AND generalpractitioner='XY11'"},"channel":{"type":"object","required":["type","endpoint","payload"],"description":"The channel on which to report matches to the criteria. SQS Endpoints must be unique per event type; attempts to add a subscription with an endpoint which is already in-use will fail with a HTTP 409 (Conflict)","properties":{"type":{"type":"string","description":"The type of channel to send notifications on. Of the options within [FHIR](https://hl7.org/fhir/R4/valueset-subscription-channel-type.html), MNS currently only supports `message`.","enum":["message"],"example":"message"},"endpoint":{"type":"string","pattern":"^(mesh://[\\w]*\\?workflow_id=[\\w_.-]+|arn:aws:sqs:eu-west-2:\\d{0,12}:[\\w_.-]*)$","description":"The endpoint which events will be delivered to. MNS currently only supports delivery to [MESH](https://digital.nhs.uk/services/message-exchange-for-social-care-and-health-mesh) mailboxes and [AWS SQS](https://aws.amazon.com/sqs/) endpoints. Note: for MESH delivery you must provide the full mailbox ID and for SQS delivery you must provide the full SQS ARN of your desired queue."},"payload":{"type":"string","description":"The mime type to send the payload in. MNS supports `application/json` and `application/fhir+json` (FHIR R4 Bundle)."}},"example":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue123","payload":"application/fhir+json"}},"hydration":{"type":"object","required":["enabled"],"description":"Optional block to configure hydration properties - hydration is disabled by default.","properties":{"enabled":{"type":"boolean","description":"A flag to enable (true) or disable (false) event hydration.","example":true},"headers":{"type":"object","description":"An optional dictionary of HTTP headers that will be sent in the request to the API endpoint specified in the event.","additionalProperties":{"type":"string","description":"HTTP header that will be sent in the request to the API endpoint specified in the event."},"example":{"custom_header_1":"custom_value_1","custom_header_2":"custom_value_2"}}}}}},"examples":{"immsVaccinationRecordChangeSubscription":{"description":"Immunisation vaccination record change subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=imms-vaccination-record-change-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/fhir+json"}}},"healthCheckCompleteSubscription":{"description":"Health check complete subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=nhshco-hc-complete-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"vrsProxyRoleChangeDeletedSubscription":{"description":"VRS proxy role deleted","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=vrs-proxy-role-deleted-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"vrsProxyRoleChangedSubscription":{"description":"VRS proxy role changed","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=vrs-proxy-role-changed-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"vrsProxyRoleCreatedSubscription":{"description":"VRS proxy role created","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=vrs-proxy-role-created-1","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"pdsRecordChangeSubscription":{"description":"PDS record change subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=pds-record-change-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"pdsChangeofGPSubscription":{"description":"PDS change of GP subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=pds-change-of-gp-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue1","payload":"application/json"}}},"pdsChangeofGPSubscriptionMeshDelivery":{"description":"PDS change of GP subscription with MESH delivery","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=pds-change-of-gp-2","channel":{"type":"message","endpoint":"mesh://MYMAILBOXOT101?workflow_id=MY_WORKFLOW_1.1-A","payload":"application/json"}}},"nhsNumberChangeSubscription":{"description":"NHS number change subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=nhs-number-change-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/json"}}},"pdsDeathNotificationSubscription":{"description":"PDS death notification subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType=pds-death-notification-2","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/fhir+json"}}},"validatedGPRegistrationRequestSubscription":{"description":"GP registration request event subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType='gpreg-change-gp-req-1' AND generalpractitioner_manufacturer_org='Y12345' AND registrationencountercode='3'","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/fhir+json"}}},"patientflagsChangeSubscription":{"description":"Patient Flags Change subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType='patientflags-change-1' AND flagtype='NRAF' AND generalpractitioner='XY11'","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/fhir+json"}}},"pathologyLaboratoryReportingTestResultStoredSubscription":{"description":"Pathology Laboratory Reporting Test Result Stored subscription","value":{"resourceType":"Subscription","status":"requested","end":"2022-04-05T17:31:00.000Z","reason":"Business process A","criteria":"eventType='pathology-laboratory-reporting-test-result-stored-1' AND requestingOrganisationODS_manufacturer_org='A12345'","channel":{"type":"message","endpoint":"arn:aws:sqs:eu-west-2:123456789012:queue2","payload":"application/json"}}}}}}},"responses":{"204":{"description":"The subscription was updated"},"400":{"description":"Invalid user input","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Please provide a valid subscription ID in UUID4 format"}}}}}},"401":{"description":"Unauthenticated error","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string","example":"Invalid access token"},"detail":{"type":"object","properties":{"errorcode":{"type":"string","example":"oauth.v2.InvalidAccessToken"}},"example":{"detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"example":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}}}},"examples":{"invalidToken":{"value":{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}},"tokenMissing":{"value":{"fault":{"faultstring":"Missing access token","detail":{"errorcode":"oauth.v2.MissingAccessToken"}}}},"tokenExpired":{"value":{"fault":{"faultstring":"Access Token expired","detail":{"errorcode":"keymanagement.service.access_token_expired"}}}}}}}},"403":{"description":"Unauthorised error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"Unauthorised"}}}}}},"409":{"description":"Resource conflict","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string that explains the problem","example":"A matching SQS subscription already exists with id: ab40a960-fc6a-426c-965f-2bff8a0bd74f"}}},"example":{"errors":"A matching SQS subscription already exists with id: ab40a960-fc6a-426c-965f-2bff8a0bd74f"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"string","description":"Error string describing the problem that occurred","example":"Internal server error"}},"example":{"errors":"Internal server error"}}}}}}}}}}