# Search

## POST /events/search

> Search for events

```json
{"openapi":"3.1.0","info":{"title":"OpenCRVS API","version":"2.0.0"},"servers":[{"url":"http://localhost:3000/api/events"}],"security":[{"Authorization":[]}],"components":{"securitySchemes":{"Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"QueryType":{"type":"object","properties":{"type":{"anyOf":[{"type":"string","const":"and"},{"type":"string","const":"or"}],"default":"and"},"clauses":{"minItems":1,"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/QueryExpression"},{"$ref":"#/components/schemas/QueryType"}]},"default":[{"eventType":"tennis-club-membership","status":{"type":"anyOf","terms":["CREATED","NOTIFIED","DECLARED","REGISTERED","ARCHIVED"]},"updatedAt":{"type":"range","gte":"2025-05-22","lte":"2025-05-29"},"data":{}}]}},"required":["type","clauses"]},"QueryExpression":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"status":{"anyOf":[{"$ref":"#/components/schemas/AnyOfStatus"},{"$ref":"#/components/schemas/ExactStatus"}]},"createdAt":{"$ref":"#/components/schemas/DateCondition"},"updatedAt":{"$ref":"#/components/schemas/DateCondition"},"legalStatuses.DECLARED.createdAtLocation":{"anyOf":[{"$ref":"#/components/schemas/Within"},{"type":"null"}]},"legalStatuses.DECLARED.createdByRole":{"$ref":"#/components/schemas/AnyOf"},"legalStatuses.REGISTERED.acceptedAt":{"$ref":"#/components/schemas/DateCondition"},"legalStatuses.REGISTERED.createdAtLocation":{"anyOf":[{"$ref":"#/components/schemas/Within"},{"type":"null"}]},"legalStatuses.REGISTERED.createdByRole":{"$ref":"#/components/schemas/AnyOf"},"legalStatuses.REGISTERED.registrationNumber":{"$ref":"#/components/schemas/Exact"},"createdAtLocation":{"anyOf":[{"$ref":"#/components/schemas/Within"},{"$ref":"#/components/schemas/Exact"}]},"updatedAtLocation":{"anyOf":[{"$ref":"#/components/schemas/Within"},{"$ref":"#/components/schemas/Exact"}]},"assignedTo":{"$ref":"#/components/schemas/Exact"},"createdByUserType":{"$ref":"#/components/schemas/ExactUserType"},"updatedByUserRole":{"$ref":"#/components/schemas/Exact"},"createdBy":{"$ref":"#/components/schemas/Exact"},"updatedBy":{"$ref":"#/components/schemas/Exact"},"trackingId":{"$ref":"#/components/schemas/Exact"},"flags":{"$ref":"#/components/schemas/ContainsFlags"},"data":{"$ref":"#/components/schemas/QueryInput"}}},"AnyOfStatus":{"type":"object","properties":{"type":{"type":"string","const":"anyOf"},"terms":{"type":"array","items":{"type":"string","enum":["CREATED","NOTIFIED","DECLARED","REGISTERED","ARCHIVED"]}}},"required":["type","terms"]},"ExactStatus":{"type":"object","properties":{"type":{"type":"string","const":"exact"},"term":{"type":"string","enum":["CREATED","NOTIFIED","DECLARED","REGISTERED","ARCHIVED"]}},"required":["type","term"]},"DateCondition":{"anyOf":[{"$ref":"#/components/schemas/ExactDate"},{"$ref":"#/components/schemas/RangeDate"},{"$ref":"#/components/schemas/TimePeriod"}]},"ExactDate":{"type":"object","properties":{"type":{"type":"string","const":"exact"},"term":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}]}},"required":["type","term"]},"RangeDate":{"type":"object","properties":{"type":{"type":"string","const":"range"},"gte":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}]},"lte":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}]}},"required":["type","gte","lte"]},"TimePeriod":{"type":"object","properties":{"type":{"type":"string","const":"timePeriod"},"term":{"type":"string","enum":["last7Days","last30Days","last90Days","last365Days"]}},"required":["type","term"]},"Within":{"type":"object","properties":{"type":{"type":"string","const":"within"},"location":{"type":"string"}},"required":["type","location"]},"AnyOf":{"type":"object","properties":{"type":{"type":"string","const":"anyOf"},"terms":{"type":"array","items":{"type":"string"}}},"required":["type","terms"]},"Exact":{"type":"object","properties":{"type":{"type":"string","const":"exact"},"term":{"type":"string"}},"required":["type","term"]},"ExactUserType":{"type":"object","properties":{"type":{"type":"string","const":"exact"},"term":{"type":"string","enum":["user","system"]}},"required":["type","term"]},"ContainsFlags":{"type":"object","properties":{"anyOf":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"string","pattern":"^(delete|create|notify|declare|register|edit|duplicate_detected|reject|mark_as_duplicate|mark_as_not_duplicate|archive|print_certificate|request_correction|reject_correction|approve_correction|read|assign|unassign|custom):(requested|accepted|rejected)$"},{"type":"string","enum":["incomplete","rejected","correction-requested","potential-duplicate","edit-in-progress"]}]},{"type":"string","description":"Custom flag identifier defined by the country config."}]}},"noneOf":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"string","pattern":"^(delete|create|notify|declare|register|edit|duplicate_detected|reject|mark_as_duplicate|mark_as_not_duplicate|archive|print_certificate|request_correction|reject_correction|approve_correction|read|assign|unassign|custom):(requested|accepted|rejected)$"},{"type":"string","enum":["incomplete","rejected","correction-requested","potential-duplicate","edit-in-progress"]}]},{"type":"string","description":"Custom flag identifier defined by the country config."}]}}}},"QueryInput":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/Fuzzy"},{"$ref":"#/components/schemas/Exact"},{"$ref":"#/components/schemas/Range"},{"$ref":"#/components/schemas/Within"},{"$ref":"#/components/schemas/AnyOf"}],"type":"object","discriminator":{"propertyName":"type","mapping":{"fuzzy":"#/components/schemas/Fuzzy","exact":"#/components/schemas/Exact","range":"#/components/schemas/Range","within":"#/components/schemas/Within","anyOf":"#/components/schemas/AnyOf"}}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/QueryInput"}}]},"Fuzzy":{"type":"object","properties":{"type":{"type":"string","const":"fuzzy"},"term":{"type":"string"}},"required":["type","term"]},"Range":{"type":"object","properties":{"type":{"type":"string","const":"range"},"gte":{"type":"string"},"lte":{"type":"string"}},"required":["type","gte","lte"]},"EventIndex":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","description":"The type of event, such as birth, death, or marriage."},"status":{"type":"string","enum":["CREATED","NOTIFIED","DECLARED","REGISTERED","ARCHIVED"]},"legalStatuses":{"type":"object","properties":{"DECLARED":{"anyOf":[{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"The timestamp when the action request was created."},"createdBy":{"type":"string","description":"ID of the user who created the action request."},"createdAtLocation":{"description":"Location of the user who created the action request.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"createdByUserType":{"description":"Whether the user is a normal user or a system.","anyOf":[{"type":"string","enum":["user","system"]},{"type":"null"}]},"acceptedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Timestamp when the action request was accepted."},"createdByRole":{"description":"Role of the user at the time of action request creation.","type":"string"}},"required":["createdAt","createdBy","acceptedAt"],"additionalProperties":false},{"type":"null"}]},"REGISTERED":{"anyOf":[{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"The timestamp when the action request was created."},"createdBy":{"type":"string","description":"ID of the user who created the action request."},"createdAtLocation":{"description":"Location of the user who created the action request.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"createdByUserType":{"description":"Whether the user is a normal user or a system.","anyOf":[{"type":"string","enum":["user","system"]},{"type":"null"}]},"acceptedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Timestamp when the action request was accepted."},"createdByRole":{"description":"Role of the user at the time of action request creation.","type":"string"},"registrationNumber":{"type":"string","description":"Registration number of the event. Always present for accepted registrations."}},"required":["createdAt","createdBy","acceptedAt","registrationNumber"],"additionalProperties":false},{"type":"null"}]}},"additionalProperties":false,"description":"Metadata related to the legal registration of the event, such as who registered it and when."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"The timestamp when the event was first created and saved."},"dateOfEvent":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"placeOfEvent":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"createdBy":{"type":"string","description":"ID of the user who created the event."},"createdByUserType":{"description":"Whether the user is a normal user or a system.","anyOf":[{"type":"string","enum":["user","system"]},{"type":"null"}]},"updatedByUserRole":{"description":"Role of the user who last changed the status.","anyOf":[{"type":"string"},{"type":"null"}]},"createdAtLocation":{"description":"Location of the user who created the event.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"updatedAtLocation":{"description":"Location of the user who last changed the status.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."},"assignedTo":{"description":"ID of the user currently assigned to the event.","anyOf":[{"type":"string"},{"type":"null"}]},"updatedBy":{"description":"ID of the user who last changed the status.","anyOf":[{"type":"string"},{"type":"null"}]},"trackingId":{"type":"string","description":"System-generated tracking ID used by informants or registrars to look up the event."},"potentialDuplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"trackingId":{"type":"string"}},"required":["id","trackingId"],"additionalProperties":false},"description":"List of event IDs and their tracking IDs that this event could be a duplicate of."},"flags":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"string","pattern":"^(delete|create|notify|declare|register|edit|duplicate_detected|reject|mark_as_duplicate|mark_as_not_duplicate|archive|print_certificate|request_correction|reject_correction|approve_correction|read|assign|unassign|custom):(requested|accepted|rejected)$"},{"type":"string","enum":["incomplete","rejected","correction-requested","potential-duplicate","edit-in-progress"]}]},{"type":"string","description":"Custom flag identifier defined by the country config."}]}},"declaration":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{"oneOf":[{"type":"object","properties":{"country":{"type":"string"},"streetLevelDetails":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"addressType":{"type":"string","const":"DOMESTIC"},"administrativeArea":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["country","addressType","administrativeArea"],"additionalProperties":false},{"type":"object","properties":{"country":{"type":"string"},"streetLevelDetails":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"addressType":{"type":"string","const":"INTERNATIONAL"}},"required":["country","addressType"],"additionalProperties":false}],"type":"object"},{"type":"string"},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"},{"type":"object","properties":{"age":{"type":"number"},"asOfDateRef":{"type":"string"}},"required":["age","asOfDateRef"],"additionalProperties":false},{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},{"anyOf":[{"type":"object","properties":{"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"},"end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"}},"required":["start","end"],"additionalProperties":false},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"}],"description":"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."},{"type":"string","enum":["last7Days","last30Days","last90Days","last365Days"]},{"type":"boolean"},{"type":"number"},{"type":"object","properties":{"path":{"type":"string","description":"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."},"originalFilename":{"type":"string"},"type":{"type":"string"}},"required":["path","originalFilename","type"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."},"originalFilename":{"type":"string"},"type":{"type":"string"},"option":{"type":"string"}},"required":["path","originalFilename","type","option"],"additionalProperties":false}},{"type":"object","properties":{"firstname":{"type":"string"},"surname":{"type":"string"},"middlename":{"type":"string"}},"required":["firstname","surname"],"additionalProperties":false},{"anyOf":[{"anyOf":[{"type":"object","properties":{"firstname":{"anyOf":[{"type":"string"},{"type":"null"}]},"surname":{"anyOf":[{"type":"string"},{"type":"null"}]},"middlename":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},{"not":{}}]},{"type":"number"},{"type":"object","properties":{"loading":{"type":"boolean"},"error":{"anyOf":[{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"],"additionalProperties":false},{"type":"null"}]},"data":{}},"required":["loading","data"],"additionalProperties":false},{"type":"string","enum":["verified","authenticated","failed","pending"]},{"anyOf":[{"type":"object","properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["data","updatedAt"],"additionalProperties":false},{"type":"null"}]},{"type":"object","properties":{"data":{}},"required":["data"],"additionalProperties":false},{"type":"object","properties":{"data":{}},"required":["data"],"additionalProperties":false},{"type":"object","properties":{"numericValue":{"type":"number"},"unit":{"type":"string"}},"required":["numericValue","unit"],"additionalProperties":false},{"type":"object","properties":{"numericValue":{"type":"number"},"unit":{"type":"string"}},"additionalProperties":false},{},{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false},{"type":"null"}]}]},{"anyOf":[{"type":"object","properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"oneOf":[{"type":"object","properties":{"country":{"type":"string"},"streetLevelDetails":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"addressType":{"type":"string","const":"DOMESTIC"},"administrativeArea":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["country","addressType","administrativeArea"],"additionalProperties":false},{"type":"object","properties":{"country":{"type":"string"},"streetLevelDetails":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"addressType":{"type":"string","const":"INTERNATIONAL"}},"required":["country","addressType"],"additionalProperties":false}],"type":"object"},{"type":"string"},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"},{"type":"object","properties":{"age":{"type":"number"},"asOfDateRef":{"type":"string"}},"required":["age","asOfDateRef"],"additionalProperties":false},{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},{"anyOf":[{"type":"object","properties":{"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"},"end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"}},"required":["start","end"],"additionalProperties":false},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"}],"description":"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."},{"type":"string","enum":["last7Days","last30Days","last90Days","last365Days"]},{"type":"boolean"},{"type":"number"},{"type":"object","properties":{"path":{"type":"string","description":"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."},"originalFilename":{"type":"string"},"type":{"type":"string"}},"required":["path","originalFilename","type"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."},"originalFilename":{"type":"string"},"type":{"type":"string"},"option":{"type":"string"}},"required":["path","originalFilename","type","option"],"additionalProperties":false}},{"type":"object","properties":{"firstname":{"type":"string"},"surname":{"type":"string"},"middlename":{"type":"string"}},"required":["firstname","surname"],"additionalProperties":false},{"anyOf":[{"anyOf":[{"type":"object","properties":{"firstname":{"anyOf":[{"type":"string"},{"type":"null"}]},"surname":{"anyOf":[{"type":"string"},{"type":"null"}]},"middlename":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},{"not":{}}]},{"type":"number"},{"type":"object","properties":{"loading":{"type":"boolean"},"error":{"anyOf":[{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"],"additionalProperties":false},{"type":"null"}]},"data":{}},"required":["loading","data"],"additionalProperties":false},{"type":"string","enum":["verified","authenticated","failed","pending"]},{"anyOf":[{"type":"object","properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["data","updatedAt"],"additionalProperties":false},{"type":"null"}]},{"type":"object","properties":{"data":{}},"required":["data"],"additionalProperties":false},{"type":"object","properties":{"data":{}},"required":["data"],"additionalProperties":false},{"type":"object","properties":{"numericValue":{"type":"number"},"unit":{"type":"string"}},"required":["numericValue","unit"],"additionalProperties":false},{"type":"object","properties":{"numericValue":{"type":"number"},"unit":{"type":"string"}},"additionalProperties":false},{},{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false},{"type":"null"}]}]}}},"required":["data"],"additionalProperties":false},{"type":"null"}]},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"oneOf":[{"type":"object","properties":{"country":{"type":"string"},"streetLevelDetails":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"addressType":{"type":"string","const":"DOMESTIC"},"administrativeArea":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["country","addressType","administrativeArea"],"additionalProperties":false},{"type":"object","properties":{"country":{"type":"string"},"streetLevelDetails":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"addressType":{"type":"string","const":"INTERNATIONAL"}},"required":["country","addressType"],"additionalProperties":false}],"type":"object"},{"type":"string"},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"},{"type":"object","properties":{"age":{"type":"number"},"asOfDateRef":{"type":"string"}},"required":["age","asOfDateRef"],"additionalProperties":false},{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},{"anyOf":[{"type":"object","properties":{"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"},"end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"}},"required":["start","end"],"additionalProperties":false},{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Date in the format YYYY-MM-DD"}],"description":"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."},{"type":"string","enum":["last7Days","last30Days","last90Days","last365Days"]},{"type":"boolean"},{"type":"number"},{"type":"object","properties":{"path":{"type":"string","description":"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."},"originalFilename":{"type":"string"},"type":{"type":"string"}},"required":["path","originalFilename","type"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"A relative path within the S3 bucket, never starting with /. e.g. document-id.jpg or directory/document-id.jpg. The document service constructs the full /bucket/path internally."},"originalFilename":{"type":"string"},"type":{"type":"string"},"option":{"type":"string"}},"required":["path","originalFilename","type","option"],"additionalProperties":false}},{"type":"object","properties":{"firstname":{"type":"string"},"surname":{"type":"string"},"middlename":{"type":"string"}},"required":["firstname","surname"],"additionalProperties":false},{"anyOf":[{"anyOf":[{"type":"object","properties":{"firstname":{"anyOf":[{"type":"string"},{"type":"null"}]},"surname":{"anyOf":[{"type":"string"},{"type":"null"}]},"middlename":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},{"not":{}}]},{"type":"number"},{"type":"object","properties":{"loading":{"type":"boolean"},"error":{"anyOf":[{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"],"additionalProperties":false},{"type":"null"}]},"data":{}},"required":["loading","data"],"additionalProperties":false},{"type":"string","enum":["verified","authenticated","failed","pending"]},{"anyOf":[{"type":"object","properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["data","updatedAt"],"additionalProperties":false},{"type":"null"}]},{"type":"object","properties":{"data":{}},"required":["data"],"additionalProperties":false},{"type":"object","properties":{"data":{}},"required":["data"],"additionalProperties":false},{"type":"object","properties":{"numericValue":{"type":"number"},"unit":{"type":"string"}},"required":["numericValue","unit"],"additionalProperties":false},{"type":"object","properties":{"numericValue":{"type":"number"},"unit":{"type":"string"}},"additionalProperties":false},{},{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false},{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false},{"type":"null"}]}]}}]},"description":"Aggregate representation of event data after all actions have been applied, with all updates consolidated and null values removed."}},"required":["id","type","status","legalStatuses","createdAt","createdBy","updatedAt","trackingId","potentialDuplicates","flags","declaration"],"additionalProperties":false},"error.BAD_REQUEST":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Invalid input data error (400)","description":"The error information"},"error.UNAUTHORIZED":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Authorization not provided error (401)","description":"The error information"},"error.FORBIDDEN":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Insufficient access error (403)","description":"The error information"},"error.INTERNAL_SERVER_ERROR":{"type":"object","properties":{"message":{"type":"string","description":"The error message"},"code":{"type":"string","description":"The error code"},"issues":{"description":"An array of issues that were responsible for the error","type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Internal server error error (500)","description":"The error information"}}},"paths":{"/events/search":{"post":{"operationId":"event-search","summary":"Search for events","tags":["Search"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"$ref":"#/components/schemas/QueryType"},"limit":{"default":100,"type":"number"},"offset":{"default":0,"type":"number"},"sort":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"direction":{"default":"asc","type":"string","enum":["asc","desc"]}},"required":["field"]}}},"required":["query"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/EventIndex"}},"total":{"type":"number"}},"required":["results","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.opencrvs.org/v2.0/technical/apis/core-apis/search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
