{"openapi":"3.1.0","info":{"title":"API for Crime Hearing Results Document Subscription","description":"Hearing Results Document Subscription specification","version":"2.0.12","license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"contact":{"name":"HMCTS API Marketplace","email":"no-reply@hmcts.com"}},"servers":[{"url":"https://virtserver.swaggerhub.com/HMCTS-DTS/api-cp-crime-hearing-results-document-subscription/2.0.12"}],"security":[{"bearerAuth":[],"subscriptionKey":[]}],"tags":[{"name":"Subscription"},{"name":"Notification"},{"name":"Internal"}],"paths":{"/event-types":{"get":{"summary":"Get list of valid event types for subscription service","description":"Returns list of valid event types for subscription service","operationId":"GetEventTypes","tags":["Subscription"],"responses":{"200":{"description":"Event types","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventTypeResponse"},"examples":{"Event-Types Example":{"$ref":"#/components/examples/EventTypesResponse"}}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden - valid subscription key required but not subscribed to this API","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}}}},"/client-subscriptions":{"post":{"summary":"Create a new client subscription","description":"Creates a new client subscription with the specified callback URL. Events will be sent to the provided callback URL via callback.","operationId":"createClientSubscription","tags":["Subscription"],"parameters":[{"$ref":"#/components/parameters/XCorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientSubscriptionRequest"},"examples":{"createSubscription":{"$ref":"#/components/examples/createSubscriptionRequest"}}}}},"responses":{"201":{"description":"Subscription created successfully","content":{"application/json":{"examples":{"createSubscription":{"$ref":"#/components/examples/createSubscriptionResponse"}},"schema":{"$ref":"#/components/schemas/ClientSubscription"}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"400":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"createSubscriptionError":{"$ref":"#/components/examples/createSubscriptionError"}}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden - valid subscription key required but not subscribed to this API","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}},"callbacks":{"onEvent":{"{$request.body#/notificationEndpoint/callbackUrl}":{"post":{"description":"Event notification sent to the subscribed callback URL","parameters":[{"$ref":"#/components/parameters/XCorrelationId"},{"name":"X-Key-Id","in":"header","required":true,"description":"Identifier of the key used to sign this callback. Matches the keyId issued when the subscription was created.","schema":{"type":"string","example":"kid-v1-b41a48b7-a2a1-45f1-b562-1358f141ddb2"}},{"name":"X-Signature","in":"header","required":true,"description":"HMAC-SHA256 signature of the callback request using the subscription's shared secret. The secret is returned once at subscription creation.","schema":{"type":"string","example":"base64-encoded-signature"}}],"requestBody":{"description":"Event payload containing defendant and case information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventNotificationPayload"}}}},"responses":{"202":{"description":"Your server implementation should return this HTTP status code\nif the event was received successfully\n","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"400":{"description":"Bad request - the event payload was invalid"}}}}}}}},"/client-subscriptions/{clientSubscriptionId}":{"get":{"summary":"Retrieve a client subscription by ID","description":"Returns the subscription matching the given clientSubscriptionId.","operationId":"getClientSubscription","tags":["Subscription"],"parameters":[{"name":"clientSubscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"aa12f3dd-4cc1-4da7-b9ea-552fa3b9bc44"},{"$ref":"#/components/parameters/XCorrelationId"}],"responses":{"200":{"description":"Subscription object","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}},"content":{"application/json":{"examples":{"getSubscriptionResponse":{"$ref":"#/components/examples/getSubscriptionResponse"}},"schema":{"$ref":"#/components/schemas/ClientSubscription"}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"getSubscriptionError":{"$ref":"#/components/examples/getSubscriptionError"}}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden - valid subscription key required but not subscribed to this API","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}}},"put":{"summary":"Strict update of a client subscription","description":"Caller must supply *all* updatable fields.","operationId":"updateClientSubscription","tags":["Subscription"],"parameters":[{"name":"clientSubscriptionId","in":"path","required":true,"example":"aa12f3dd-4cc1-4da7-b9ea-552fa3b9bc44","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/XCorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"updateSubscription":{"$ref":"#/components/examples/updateSubscription"}},"schema":{"$ref":"#/components/schemas/ClientSubscriptionRequest"}}}},"responses":{"200":{"description":"Subscription updated","content":{"application/json":{"examples":{"updatedSubscriptionResponse":{"$ref":"#/components/examples/updatedSubscriptionResponse"}},"schema":{"$ref":"#/components/schemas/ClientSubscription"}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"400":{"description":"Invalid request","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"404":{"description":"Subscription not found","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden - valid subscription key required but not subscribed to this API","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}}},"delete":{"summary":"Delete a subscription by ID","description":"Deletes the subscription identified by clientSubscriptionId.","operationId":"deleteClientSubscription","tags":["Subscription"],"parameters":[{"name":"clientSubscriptionId","in":"path","required":true,"example":"aa12f3dd-4cc1-4da7-b9ea-552fa3b9bc44","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/XCorrelationId"}],"responses":{"204":{"description":"Deleted successfully","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"404":{"description":"Subscription not found","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden - valid subscription key required but not subscribed to this API","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}}}},"/notifications":{"post":{"summary":"Create a client notification.","description":"Creates a client notification for given material id and event type","operationId":"createNotification","tags":["Internal"],"parameters":[{"$ref":"#/components/parameters/XCorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPayload"},"examples":{"PCR":{"$ref":"#/components/examples/PCR"},"NowsCustodialSentence":{"$ref":"#/components/examples/NowsCustodialSentence"}}}}},"responses":{"202":{"description":"accepted","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden - valid subscription key required but not subscribed to this API","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}}}},"/client-subscriptions/{clientSubscriptionId}/secret/rotate":{"post":{"summary":"Rotate the HMAC signing secret for a subscription","description":"Issues a new HMAC secret for the specified subscription. The new secret is returned once and cannot be retrieved again.","operationId":"rotateClientSubscriptionSecret","tags":["Subscription"],"parameters":[{"name":"clientSubscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"example":"aa12f3dd-4cc1-4da7-b9ea-552fa3b9bc44"},{"$ref":"#/components/parameters/XCorrelationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateSecretRequest"},"examples":{"rotateSecret":{"$ref":"#/components/examples/rotateSecretRequest"}}}}},"responses":{"200":{"description":"Secret rotated successfully. The new secret is returned once and cannot be retrieved again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HmacCredentials"},"examples":{"rotateSecretResponse":{"$ref":"#/components/examples/rotateSecretResponse"}}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"400":{"description":"Invalid request — missing or malformed keyId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden — the subscription does not belong to the calling client","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"404":{"description":"Not found — the keyId does not match any known key for this subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}}}},"/client-subscriptions/{clientSubscriptionId}/documents/{documentId}":{"get":{"summary":"Retrieve PDF for the specified document id","description":"Returns the PDF previously published for the given documentId.","operationId":"getDocument","tags":["Notification"],"parameters":[{"name":"clientSubscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Subscriber's client subscription identifier"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Public document identifier assigned to the subscriber"},{"$ref":"#/components/parameters/XCorrelationId"}],"responses":{"200":{"description":"PDF document (binary)","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"404":{"description":"Document not found or the client subscription is missing/inactive","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden - valid subscription key required but not subscribed to this API","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}}}},"/client-subscriptions/{clientSubscriptionId}/hearing-events/{hearingEventId}":{"get":{"summary":"Retrieve structured PCR/Nows payload for a notification","description":"Returns the full structured document payload for the given per-subscriber hearingEventId. Access is implicitly scoped — a subscriber can only retrieve their own notifications.","operationId":"getHearingEvent","tags":["Notification"],"parameters":[{"name":"clientSubscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Subscriber's client subscription identifier"},{"name":"hearingEventId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Per-subscriber hearing event identifier received in the callback"},{"$ref":"#/components/parameters/XCorrelationId"}],"responses":{"200":{"description":"Structured document payload for the requested hearing event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HearingEventResponse"},"examples":{"getHearingEventResponse":{"$ref":"#/components/examples/getHearingEventResponse"}}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"404":{"description":"Not found — hearingEventId does not exist, does not belong to this subscriber, or the feature is disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"401":{"description":"Unauthorized - missing or invalid authentication credentials","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}},"403":{"description":"Forbidden - valid subscription key required but not subscribed to this API","headers":{"X-Correlation-Id":{"$ref":"#/components/headers/XCorrelationId"}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"subscriptionKey":{"type":"apiKey","in":"header","name":"Ocp-Apim-Subscription-Key","description":"Subscription key for API access"}},"headers":{"XCorrelationId":{"description":"Correlation identifier for this request/response, used for end-to-end tracing.","schema":{"type":"string","format":"uuid","example":"bf931a90-3e3f-4e8e-a8e4-a4ca9ac07830"}}},"parameters":{"XCorrelationId":{"name":"X-Correlation-Id","in":"header","required":false,"description":"Optional correlation identifier for end-to-end tracing.","schema":{"type":"string","format":"uuid","example":"d679fd61-061f-4440-9623-36280f0807b7"}}},"schemas":{"EventType":{"type":"string","description":"Possible values:\n  - PRISON_COURT_REGISTER_GENERATED\n  - WEE_Layout5\n  - NEE_DetentionOnRecommendationForDeportation\n  - OEE_MedicalRemandAdditionalDetails\n  - WEE_RemandAfterBailAppealByProsecutor\n  - WEE_CustodialSentence\n  - WEE_CustodialSentenceWitness\n  - WEE_CommittalToCrownCourtForConsiderationOfTheQuestionOfBailOnAChargeOfMurder\n  - WEE_CommittalToCrownCourtForSentence\n  - WEE_SendingToCrownCourtForTrial\n  - OEE_BailAppealEndOfCustody\n  - WEE_CommitmentPendingTransferToServiceCustody\n  - WEE_NonPaymentOfMoneyOwedCivilDebt\n  - WEE_CustodyWarrantOnDischargeOfExtraditionPendingAppeal\n  - WEE_CustodyWarrantOnDischargeOfExtraditionPendingAppealPart2\n  - WEE_CustodyWarrantOnExtradition\n  - WEE_CustodyWarrantOnExtraditionCategory2Territory\n  - WEE_CustodyWarrantOnExtraditionWithConsent\n  - WEE_CustodyWarrantOnExtraditionWithBailDirection\n  - WEE_CustodyWarrantOnExtraditionWithBailDirectionWithConsent\n  - WEE_CustodyWarrantOnExtraditionWithBailDirectionCategory2Territory\n  - WEE_CustodyWarrantSendingToSecretaryOfStateCategory2Territory\n  - WEE_CustodyWarrantSendingToSecretaryOfStateOnConsentCategory2Territory\n  - WEE_CustodyWarrantWithBailDirectionOnDischargeOfExtraditionPendingAppeal\n  - WEE_CustodyWarrantWithBailDirectionOnDischargeOfExtraditionPendingAppealPart2\n  - WEE_CustodyWarrantWithBailDirectionSendingToSecretaryOfStateCategory2Territory\n  - WEE_CustodyWarrantWithBailDirectionSendingToSecretaryOfStateOnConsentCategory2Territory\n  - WEE_ExtraditionRemandAfterBailAppealByProsecutor\n  - WEE_ExtraditionSupplementToCustodyWarrant\n  - OBE_TerminationOfFootballBanning\n  - OBE_ChangeOfFootballBanning\n  - NEE_FootballBanning\n  - WEE_Remand\n  - WXE_RemandWarrantYouthDetentionAccommodation\n  - OXE_DetentionAndTraining\n  - WEE_InjunctionDetention\n  - OPE_SupervisionOnBreachOfDetentionAndTraining\n  - WEE_CommittalToCrownCourtAuthorityToHoldInYouthDetentionAccommodation\n  - WEE_Detention\n  - WEE_DetentionInYouthDetentionAccommodationBreach\n  - WEE_SendingToCrownCourtAuthorityToHoldInYouthDetentionAccommodation\n"},"NotificationEndpoint":{"type":"object","required":["callbackUrl"],"properties":{"callbackUrl":{"type":"string","pattern":"^https://.*$","description":"The location where event data will be sent. Event notifications will be POSTed to this URL with EventNotificationPayload in the request body."}}},"EventTypeResponse":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventTypePayload"}}}},"EventTypePayload":{"type":"object","properties":{"eventName":{"type":"string"},"displayName":{"type":"string"},"category":{"type":"string"}}},"ClientSubscriptionRequest":{"type":"object","required":["notificationEndpoint","eventTypes"],"properties":{"notificationEndpoint":{"$ref":"#/components/schemas/NotificationEndpoint"},"eventTypes":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/EventType"}}}},"ClientSubscription":{"type":"object","required":["clientSubscriptionId","notificationEndpoint","eventTypes","createdAt"],"properties":{"clientSubscriptionId":{"type":"string","format":"uuid"},"notificationEndpoint":{"$ref":"#/components/schemas/NotificationEndpoint"},"eventTypes":{"type":"array","items":{"$ref":"#/components/schemas/EventType"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":["string"],"format":"date-time"},"hmac":{"$ref":"#/components/schemas/HmacCredentials"}}},"HmacCredentials":{"type":"object","description":"HMAC credentials issued at subscription creation for signing outbound callbacks.","properties":{"keyId":{"type":"string","description":"Identifier for the shared secret used to sign outbound callbacks for this subscription","example":"kid-v1-b41a48b7-a2a1-45f1-b562-1358f141ddb2"},"secret":{"type":"string","writeOnly":true,"description":"Base64-encoded shared secret used to sign outbound callbacks for this subscription. Returned in the create subscription response. Not returned by subsequent GET operations.","example":"example-base64-encoded-secret"}}},"RotateSecretRequest":{"type":"object","required":["keyId"],"properties":{"keyId":{"type":"string","description":"Identifier of the current key to rotate","example":"kid-v1-b41a48b7-a2a1-45f1-b562-1358f141ddb2"}}},"ErrorResponse":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}},"HearingEventResponse":{"type":"object","required":["hearingEventId","eventType","createdAt","payload"],"properties":{"hearingEventId":{"type":"string","format":"uuid","description":"Per-subscriber identifier for this notification, received in the callback","example":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"},"eventType":{"$ref":"#/components/schemas/EventType"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when this notification was created","example":"2026-05-13T10:00:00Z"},"payload":{"type":"string","description":"Full structured document payload. Shape varies by eventType."}}},"EventPayload":{"type":"object","description":"Payload representing a stored PCR/Nows document event with defendant and case details.","required":["eventId","materialId","hearingId","eventType","timestamp","defendant"],"properties":{"eventType":{"type":"string","description":"Type of the event, e.g., PRISON_COURT_REGISTER_GENERATED","$ref":"#/components/schemas/EventType"},"eventId":{"type":"string","format":"uuid","description":"Unique identifier of the stored PCR/Nows document event"},"hearingId":{"type":"string","format":"uuid","description":"Unique identifier of the hearing associated with this event","example":"7f3b0726-ab6e-8579-2bb4-dd0870bcbf5a"},"materialId":{"type":"string","format":"uuid","description":"Unique identifier of the stored PCR/Nows document"},"timestamp":{"type":"string","format":"date-time","description":"Timestamp when the event occurred"},"defendant":{"type":"object","required":["masterDefendantId","name"],"properties":{"masterDefendantId":{"type":"string","format":"uuid","description":"Unique identifier for the master defendant"},"name":{"type":"string","description":"Full name of the defendant"},"dateOfBirth":{"type":"string","format":"date","description":"Date of birth of the defendant"},"custodyEstablishmentDetails":{"type":"object","description":"Details of the custody establishment","properties":{"emailAddress":{"type":"string","format":"email","description":"Email address of the prison"}}},"cases":{"type":"array","description":"List of cases associated with the defendant","items":{"type":"object","required":["urn"],"properties":{"urn":{"type":"string","description":"Case URN associated with the defendant"}}}}}},"payload":{"type":"string","description":"Full structured document payload. When provided, stored and later served to subscribers via the hearing-events endpoint."}}},"EventNotificationPayload":{"type":"object","description":"Callback payload delivered to the subscriber. Contains the hearingEventId to retrieve the full structured payload via the hearing-events endpoint.","required":["eventType","hearingId","cases","masterDefendantId","documentId","documentGeneratedTimestamp","prisonEmailAddress"],"properties":{"hearingEventId":{"type":"string","format":"uuid","description":"Per-subscriber identifier for retrieving the full structured payload via GET /client-subscriptions/{clientSubscriptionId}/hearing-events/{hearingEventId}.","example":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"},"eventType":{"description":"Type of the event that triggered this notification","example":"PRISON_COURT_REGISTER_GENERATED","$ref":"#/components/schemas/EventType"},"hearingId":{"type":"string","format":"uuid","description":"Unique identifier of the hearing that produced the result document","example":"7f3b1c2d-4e5a-6789-abcd-ef0123456789"},"masterDefendantId":{"type":"string","format":"uuid","description":"Unique identifier for the master defendant","example":"550e8400-e29b-41d4-a716-446655440000"},"documentId":{"type":"string","format":"uuid","description":"Unique identifier of the document used by consumers while fetching it","example":"123e4567-e89b-12d3-a456-426614174000"},"documentGeneratedTimestamp":{"type":"string","format":"date-time","description":"Document generation timestamp","example":"2024-01-15T10:30:00Z"},"cases":{"type":"array","minItems":1,"description":"List of cases associated with the defendant","items":{"type":"object","required":["urn"],"properties":{"urn":{"type":"string","description":"Case URN associated with the defendant","example":"CT981234123"}}}},"prisonEmailAddress":{"type":"string","format":"email","description":"Email address of the prison","example":"prison@example.com"}}}},"examples":{"EventTypesResponse":{"summary":"Example Event-Types response","value":{"events":[{"eventName":"PRISON_COURT_REGISTER_GENERATED","displayName":"Prison court register","category":"REGISTER"},{"eventName":"WEE_Layout5","displayName":"Warrant Supplement","category":"WARRANT"},{"eventName":"NEE_DetentionOnRecommendationForDeportation","displayName":"Detention on Recommendation for Deportation","category":"NOTICE"},{"eventName":"OEE_MedicalRemandAdditionalDetails","displayName":"Medical Remand - Additional Details","category":"ORDER"},{"eventName":"WEE_RemandAfterBailAppealByProsecutor","displayName":"Remand Warrant After Bail Appeal by Prosecutor","category":"WARRANT"},{"eventName":"WEE_CustodialSentence","displayName":"Warrant for Custodial Sentence","category":"WARRANT"},{"eventName":"WEE_CustodialSentenceWitness","displayName":"Warrant for Custodial Sentence (Witness)","category":"WARRANT"},{"eventName":"WEE_CommittalToCrownCourtForConsiderationOfTheQuestionOfBailOnAChargeOfMurder","displayName":"Warrant of Committal to Crown Court for Consideration of the Question of Bail on a Charge of Murder","category":"WARRANT"},{"eventName":"WEE_CommittalToCrownCourtForSentence","displayName":"Warrant of Committal to Crown Court for Sentence","category":"WARRANT"},{"eventName":"WEE_SendingToCrownCourtForTrial","displayName":"Warrant of Sending to Crown Court for Trial","category":"WARRANT"},{"eventName":"OEE_BailAppealEndOfCustody","displayName":"Bail Appeal - End of Custody","category":"ORDER"},{"eventName":"WEE_CommitmentPendingTransferToServiceCustody","displayName":"Warrant of Commitment Pending Transfer to Service Custody","category":"WARRANT"},{"eventName":"WEE_NonPaymentOfMoneyOwedCivilDebt","displayName":"Warrant of Committal for Non-Payment of Money Owed Civil Debt","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantOnDischargeOfExtraditionPendingAppeal","displayName":"Custody Warrant on Discharge of Extradition Pending Appeal","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantOnDischargeOfExtraditionPendingAppealPart2","displayName":"Custody Warrant on Discharge of Extradition Pending Appeal (Part 2)","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantOnExtradition","displayName":"Custody Warrant on Extradition","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantOnExtraditionCategory2Territory","displayName":"Custody Warrant on Extradition - Category 2 Territory","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantOnExtraditionWithConsent","displayName":"Custody Warrant on Extradition (Part 1)","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantOnExtraditionWithBailDirection","displayName":"Custody Warrant on Extradition (with Bail Direction)","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantOnExtraditionWithBailDirectionWithConsent","displayName":"Custody Warrant on Extradition with Bail Direction","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantOnExtraditionWithBailDirectionCategory2Territory","displayName":"Custody Warrant on Extradition (with Bail Direction) - Category 2 Territory","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantSendingToSecretaryOfStateCategory2Territory","displayName":"Custody Warrant Sending to Secretary of State - Category 2 Territory","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantSendingToSecretaryOfStateOnConsentCategory2Territory","displayName":"Custody Warrant Sending to Secretary of State on Consent - Category 2 Territory","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantWithBailDirectionOnDischargeOfExtraditionPendingAppeal","displayName":"Custody Warrant with Bail Direction on Discharge of Extradition Pending Appeal","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantWithBailDirectionOnDischargeOfExtraditionPendingAppealPart2","displayName":"Custody Warrant with Bail Direction on Discharge of Extradition Pending Appeal (Part 2)","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantWithBailDirectionSendingToSecretaryOfStateCategory2Territory","displayName":"Custody Warrant with Bail Direction Sending to Secretary of State - Category 2 Territory","category":"WARRANT"},{"eventName":"WEE_CustodyWarrantWithBailDirectionSendingToSecretaryOfStateOnConsentCategory2Territory","displayName":"Custody Warrant with Bail Direction Sending to Secretary of State on Consent - Category 2 Territory","category":"WARRANT"},{"eventName":"WEE_ExtraditionRemandAfterBailAppealByProsecutor","displayName":"Remand Warrant After Bail Appeal by Prosecutor - Extradition","category":"WARRANT"},{"eventName":"WEE_ExtraditionSupplementToCustodyWarrant","displayName":"Supplement to Custody Warrant on Extradition","category":"WARRANT"},{"eventName":"OBE_TerminationOfFootballBanning","displayName":"Application for Termination of Football Banning Order","category":"ORDER"},{"eventName":"OBE_ChangeOfFootballBanning","displayName":"Change of Football Banning Order","category":"ORDER"},{"eventName":"NEE_FootballBanning","displayName":"Notice of Football Banning Order","category":"NOTICE"},{"eventName":"WEE_Remand","displayName":"Remand Warrant","category":"WARRANT"},{"eventName":"WXE_RemandWarrantYouthDetentionAccommodation","displayName":"Remand Warrant - Youth Detention Accommodation","category":"WARRANT"},{"eventName":"OXE_DetentionAndTraining","displayName":"Detention and Training Order","category":"ORDER"},{"eventName":"WEE_InjunctionDetention","displayName":"Injunction Warrant of Detention","category":"WARRANT"},{"eventName":"OPE_SupervisionOnBreachOfDetentionAndTraining","displayName":"Supervision on Breach of Detention and Training Order","category":"ORDER"},{"eventName":"WEE_CommittalToCrownCourtAuthorityToHoldInYouthDetentionAccommodation","displayName":"Warrant of Committal to Crown Court - Authority to Hold in Youth Detention Accommodation","category":"WARRANT"},{"eventName":"WEE_Detention","displayName":"Warrant of Detention","category":"WARRANT"},{"eventName":"WEE_DetentionInYouthDetentionAccommodationBreach","displayName":"Warrant of Detention in Youth Detention Accommodation (Breach)","category":"WARRANT"},{"eventName":"WEE_SendingToCrownCourtAuthorityToHoldInYouthDetentionAccommodation","displayName":"Warrant of Sending to Crown Court - Authority to Hold in Youth Detention Accommodation","category":"WARRANT"}]}},"createSubscriptionRequest":{"summary":"Example subscription creation request","value":{"notificationEndpoint":{"callbackUrl":"https://client.example.com/events"},"eventTypes":["PRISON_COURT_REGISTER_GENERATED"]}},"createSubscriptionResponse":{"summary":"Example subscription creation response","value":{"clientSubscriptionId":"aa12f3dd-4cc1-4da7-b9ea-552fa3b9bc44","notificationEndpoint":{"callbackUrl":"https://client.example.com/events"},"eventTypes":["PRISON_COURT_REGISTER_GENERATED"],"hmac":{"keyId":"kid-v1-b41a48b7-a2a1-45f1-b562-1358f141ddb2","secret":"example-base64-encoded-secret"},"createdAt":"2025-01-01T10:00:00Z","updatedAt":null}},"createSubscriptionError":{"summary":"Example subscription creation error response","value":{"error":"invalid_request","message":"eventTypes must contain at least one value."}},"getSubscriptionResponse":{"summary":"Example GET subscription response","value":{"clientSubscriptionId":"aa12f3dd-4cc1-4da7-b9ea-552fa3b9bc44","notificationEndpoint":{"callbackUrl":"https://client.example.com/events"},"eventTypes":["PRISON_COURT_REGISTER_GENERATED"],"createdAt":"2025-01-01T10:00:00Z","updatedAt":"2025-01-05T17:30:00Z"}},"getSubscriptionError":{"summary":"Example GET subscription error response","value":{"error":"not_found","message":"No subscription exists for ID aa12f3dd-4cc1-4da7-b9ea-552fa3b9bc44."}},"updateSubscription":{"summary":"Example update request","value":{"notificationEndpoint":{"callbackUrl":"https://client.example.com/new-hook"},"eventTypes":["PRISON_COURT_REGISTER_GENERATED"]}},"updatedSubscriptionResponse":{"summary":"Example update subscription response","value":{"clientSubscriptionId":"aa12f3dd-4cc1-4da7-b9ea-552fa3b9bc44","notificationEndpoint":{"callbackUrl":"https://client.example.com/new-hook"},"eventTypes":["PRISON_COURT_REGISTER_GENERATED"],"createdAt":"2025-01-01T10:00:00Z","updatedAt":"2025-01-10T09:15:00Z"}},"PCR":{"summary":"Prison court register example","value":{"eventId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","materialId":"123e4567-e89b-12d3-a456-426614174000","hearingId":"7f3b0726-ab6e-8579-2bb4-dd0870bcbf5a","eventType":"PRISON_COURT_REGISTER_GENERATED","timestamp":"2024-01-15T10:30:00Z","defendant":{"masterDefendantId":"8b8f1c3a-9a41-4f0f-b8a0-1c23d9e8a111","name":"John Doe","dateOfBirth":"1990-01-01","custodyEstablishmentDetails":{"emailAddress":"prison@example.com"},"cases":[{"urn":"CT98KRYCAP"},{"urn":"AB75123123"}]},"payload":{"amendmentDate":"2020-04-15","applicants":[{"title":"Mr","firstName":"Crown","lastName":"Prosecution Service","name":"Crown Prosecution Service","landlineNumber":"01632 960000","address":{"line1":"Rose Court","line2":"2 Southwark Bridge","line3":"London","postCode":"SE1 9HS"}}],"caseApplicationReferences":["CPS/2020/001234"],"cases":[{"reference":"TFL15746USFY2","defendantCaseOffences":[{"title":"Use / install a television set without a licence","legislation":"Contrary to section 363(2) and (4) of the Communications Act 2003.","civilOffence":false,"convictionDate":"2020-03-09","startDate":"2020-01-01","results":[{"label":"Fine","welshLabel":"Dirwy","primary":true,"publishedForNows":true,"resultIdentifier":"1002","resultDefinitionGroup":"Financial","resultText":"Fine imposed","resultWording":"The defendant is fined £12.","sequence":1,"prompts":[{"label":"Amount of fine","value":"£12","promptIdentifier":"FINE_AMOUNT"}]}]}]}],"civilNow":false,"courtClerkName":"Erica Wilson","defendant":{"name":"John Doe","dateOfBirth":"1990-01-01","address":{"line1":"Flat 1, Armageddon House","line2":"13 Old Road","line3":"Giggleswick","postCode":"SW11 1AB"}},"financialOrderDetails":{"paymentTerms":"Instalments only with instalment amount 20, monthly, instalment start date 2020-07-11","enforcementPhoneNumber":"020 7556 8500","totalAmountImposed":"£12","totalBalance":"£12"},"orderDate":"2024-01-15","orderName":"Prison Court Register","orderingCourt":{"ljaCode":"2577","courtCentreName":"Lavender Hill Magistrates' Court","welshCourtCentre":false,"address":{"line1":"176A Lavender Hill","line2":"London","postCode":"SW11 1JU"}}}}},"NowsCustodialSentence":{"summary":"Nows example","value":{"eventId":"b37c7a93-4063-40e5-9b0a-0230a3cc2005","materialId":"297b5c16-0983-405c-9128-614554b1c4fe","hearingId":"a4c1e832-df72-4b3a-9cc5-ee1981dcaf17","eventType":"WEE_CustodialSentence","timestamp":"2025-02-15T10:40:00Z","defendant":{"masterDefendantId":"8b8f1c3a-9a41-4f0f-b8a0-1c23d9e8a111","name":"John Doe","dateOfBirth":"1990-01-01","custodyEstablishmentDetails":{"emailAddress":"prison@example.com"},"cases":[{"urn":"CT98KRYCAP"}]},"payload":{"amendmentDate":"2020-04-15","cases":[{"reference":"TFL15746USFY2","defendantCaseOffences":[{"title":"Custodial Sentence","legislation":"Contrary to section 152 of the Criminal Justice Act 2003.","civilOffence":false,"convictionDate":"2025-02-15","startDate":"2025-02-15","results":[{"label":"Custodial Sentence","welshLabel":"Dedfryd Garchardol","primary":true,"publishedForNows":true,"resultIdentifier":"1081","resultDefinitionGroup":"Custodial","resultText":"Custodial sentence imposed","resultWording":"The defendant is sentenced to 6 months imprisonment.","sequence":1,"prompts":[{"label":"Length of sentence","value":"6 months","promptIdentifier":"SENTENCE_LENGTH"}]}]}]}],"civilNow":false,"courtClerkName":"Erica Wilson","defendant":{"name":"John Doe","dateOfBirth":"1990-01-01","address":{"line1":"Flat 1, Armageddon House","line2":"13 Old Road","line3":"Giggleswick","postCode":"SW11 1AB"}},"orderDate":"2025-02-15","orderName":"Warrant for Custodial Sentence","orderingCourt":{"ljaCode":"2577","courtCentreName":"Lavender Hill Magistrates' Court","welshCourtCentre":false,"address":{"line1":"176A Lavender Hill","line2":"London","postCode":"SW11 1JU"}}}}},"rotateSecretRequest":{"summary":"Example secret rotation request","value":{"keyId":"kid-v1-b41a48b7-a2a1-45f1-b562-1358f141ddb2"}},"rotateSecretResponse":{"summary":"Example secret rotation response","value":{"keyId":"kid-v1-b41a48b7-a2a1-45f1-b562-1358f141ddb2","secret":"new-example-base64-encoded-secret"}},"getHearingEventResponse":{"summary":"Example GET hearing event response","value":{"hearingEventId":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","eventType":"PRISON_COURT_REGISTER_GENERATED","createdAt":"2026-05-13T10:00:00Z","payload":{"amendmentDate":"2020-04-15","applicants":[{"title":"Mr","firstName":"Crown","middleName":null,"lastName":"Prosecution Service","name":"Crown Prosecution Service","dateOfBirth":null,"landlineNumber":"01632 960000","mobileNumber":null,"address":{"line1":"Rose Court","line2":"2 Southwark Bridge","line3":"London","line4":null,"postCode":"SE1 9HS"}}],"caseApplicationReferences":["CPS/2020/001234"],"cases":[{"reference":"TFL15746USFY2","defendantCaseOffences":[{"title":"Use / install a television set without a licence","legislation":"Contrary to section 363(2) and (4) of the Communications Act 2003.","civilOffence":false,"convictionDate":"2020-03-09","displayText":"String2","wording":"On 02/07/2015 At threadneedle street EC2 Being a passenger on a Public service Vehicle...","startDate":"2020-01-01","results":[{"label":"Fine","welshLabel":"Dirwy","primary":true,"publishedForNows":true,"resultIdentifier":"1002","resultDefinitionGroup":"Financial","resultText":"Fine imposed","resultWording":"The defendant is fined £12.","welshResultWording":"Dirwywyd y diffynnydd £12.","sequence":1,"prompts":[{"label":"Amount of fine","welshLabel":"Swm y ddirwy","value":"£12","welshValue":"£12","promptIdentifier":"FINE_AMOUNT","promptReference":"P001"}],"nowRequirementText":[{"label":"contactDetails","value":"Telephone: 0300 303 0656  (Monday to Friday 9am to 5pm)"}]}]}],"defendantCaseResults":[{"label":"Surcharge","welshLabel":"Gordal","prompts":[{"label":"Amount of surcharge","value":"£12"}]}]}],"civilNow":false,"courtClerkName":"Erica Wilson","defendant":{"name":"Jane Doe","dateOfBirth":"1957-01-01","address":{"line1":"Flat 1, Armageddon House","line2":"13 Old Road","line3":"Giggleswick","line4":"Merton","postCode":"SW11 1AB"}},"financialOrderDetails":{"paymentTerms":"Instalments only with instalment amount 20, monthly, instalment start date 2020-07-11","enforcementPhoneNumber":"020 7556 8500","enforcementAddress":{"line1":"LCCC Enforcement Unit","line2":"P.O. Box 31089","line3":"London","postCode":"SW1P 3WT"},"enforcementEmail":"enforcement@example.com","accountingDivisionCode":77,"bacsBankName":"HMCTS LCCC","bacsSortCode":"56-00-33","bacsAccountNumber":"27049175","totalAmountImposed":"NaN","totalBalance":"NaN"},"nextHearingCourtDetails":{"hearingDate":"2020-03-09T10:00:00Z","courtName":"Lavender Hill Magistrates' Court","courtAddress":{"line1":"176A Lavender Hill","line2":"London","postCode":"SW11 1JU"}},"orderDate":"2020-04-12","orderName":"Notice of Financial Penalty","orderingCourt":{"ljaCode":"2577","courtCentreName":"Lavender Hill Magistrates' Court","welshCourtCentre":false,"address":{"line1":"176A Lavender Hill","line2":"London","postCode":"SW11 1JU"}},"welshOrderName":"Rhybudd o gosb ariannol"}}}}}}