{"openapi":"3.0.0","components":{"schemas":{"AdminPurgePostRequest":{"type":"object","properties":{"force":{"type":"boolean","description":"True to force purge in production environment."},"suppress":{"type":"boolean","description":"If true, suppresses purge while still running pre & post callbacks."}},"additionalProperties":false},"AdminPurgePostResponse":{"type":"object","properties":{"bucketItems":{"type":"integer","description":"Total s3 bucket items purged."},"dbItems":{"type":"integer","description":"Total database items purged."},"serviceToken":{"type":"string","description":"Service token."}}},"MessagesPostResponse":{"type":"object","properties":{"stateFunctionExecution":{"type":"object","description":"Step Functions execution details returned by startExecution.","properties":{"executionArn":{"type":"string","description":"ARN of the Step Functions execution."},"started":{"type":"number","description":"Execution start timestamp (unix milliseconds)."}}}}},"EmptyResponse":{"type":"object","additionalProperties":false},"MessageArchivePatchRequest":{"type":"object","properties":{"messageId":{"type":"string","description":"Unique Message identifier."},"archive":{"type":"boolean","description":"True to archive, false to unarchive."}},"required":["archive","messageId"],"additionalProperties":false},"MessageGetResponse":{"type":"array","items":{"type":"object","properties":{"bodyHtml":{"type":"string","description":"HTML message body."},"bodyText":{"type":"string","description":"Text message body."},"hidden":{"type":"boolean","description":"If `true`, message is not visible to end users."},"summary":{"type":"string","description":"Text message summary."},"messageId":{"type":"string","description":"Unique Message identifier."},"distId":{"type":"string","description":"Related distribution identifier if applicable."},"distToken":{"type":"string","description":"Message distribution.","enum":["applicationManager","beneficiaryManager","groupManager","groupMember","merchantManager"]},"userId":{"type":"string","description":"Related User identifier."},"subject":{"type":"string","description":"Text message subject."},"archived":{"type":"integer","description":"Archived timestamp in millis."},"created":{"type":"integer","description":"Created timestamp in millis."},"updated":{"type":"integer","description":"Updated timestamp in millis."},"updater":{"type":"string","description":"userId or stack name of last updater."},"read":{"type":"number","description":"Read timestamp in millis."},"targets":{"type":"object","description":"A JSON object identifying SNS distribution channels resolved from user preferences.","properties":{"email":{"type":"string","description":"Email address for SNS distribution."},"sms":{"type":"string","description":"Phone number for SMS distribution."}},"additionalProperties":false},"templateId":{"type":"string","description":"Related Template identifier."}},"required":["created","messageId","updated","updater","userId"],"additionalProperties":false}},"MessageListResponse":{"type":"object","properties":{"count":{"type":"number","description":"Total number of records matching the search criteria."},"items":{"type":"array","items":{"type":"object","properties":{"messageId":{"type":"string","description":"Unique Message identifier."},"subject":{"type":"string","description":"Text message subject."},"distId":{"type":"string","description":"Related distribution identifier if applicable."},"distToken":{"type":"string","description":"Message distribution.","enum":["applicationManager","beneficiaryManager","groupManager","groupMember","merchantManager"]},"userId":{"type":"string","description":"Related User identifier."},"archived":{"type":"integer","description":"Archived timestamp in millis."},"created":{"type":"integer","description":"Created timestamp in millis."},"updated":{"type":"integer","description":"Updated timestamp in millis."},"updater":{"type":"string","description":"userId or stack name of last updater."},"read":{"type":"number","description":"Read timestamp in millis."},"templateId":{"type":"string","description":"Related Template identifier."}},"required":["created","messageId","updated","updater","userId"],"additionalProperties":false}},"pageKeys":{"type":"string","description":"Compressed map of shardKeys to pageKeys. Empty string indicates no more pages."}},"required":["count","items","pageKeys"],"additionalProperties":false},"MessagePatchRequest":{"type":"object","properties":{"messageId":{"type":"string","description":"Unique Message identifier."},"bodyHtml":{"type":"string","description":"HTML message body."},"bodyText":{"type":"string","description":"Text message body."},"hidden":{"type":"boolean","description":"If `true`, message is not visible to end users."},"summary":{"type":"string","description":"Text message summary."}},"required":["messageId"],"additionalProperties":false},"MessagePostRequest":{"type":"object","properties":{"bodyHtml":{"type":"string","description":"HTML message body."},"bodyText":{"type":"string","description":"Text message body."},"hidden":{"type":"boolean","description":"If `true`, message is not visible to end users."},"summary":{"type":"string","description":"Text message summary."},"distId":{"type":"string","description":"Related distribution identifier if applicable."},"distToken":{"type":"string","description":"Message distribution.","enum":["applicationManager","beneficiaryManager","groupManager","groupMember","merchantManager"]},"userId":{"type":"string","description":"Related User identifier."},"subject":{"type":"string","description":"Text message subject."},"targets":{"type":"object","description":"A JSON object identifying SNS distribution channels resolved from user preferences.","properties":{"email":{"type":"string","description":"Email address for SNS distribution."},"sms":{"type":"string","description":"Phone number for SMS distribution."}},"additionalProperties":false},"templateId":{"type":"string","description":"Related Template identifier."}},"required":["bodyHtml","bodyText","subject","summary","userId"],"additionalProperties":false},"MessagesPostRequest":{"type":"object","properties":{"data":{"type":"object","description":"Message source data."},"templateId":{"type":"string","description":"Related Template identifier."},"contexts":{"type":"array","items":{"type":"object","properties":{"contextToken":{"type":"string","description":"Context entity type.","enum":["application","beneficiary","group","merchant","method","offer","template","user","validator"]},"contextId":{"type":"string","description":"Context record identifier."}},"required":["contextToken"],"additionalProperties":false}},"userIds":{"type":"array","description":"Array of userIds. Augments template distribution.","items":{"type":"string"}},"service":{"type":"string","description":"Message originating service."}},"required":["data"],"additionalProperties":false},"MessageReadPatchRequest":{"type":"object","properties":{"messageId":{"type":"string","description":"Unique Message identifier."},"read":{"type":"boolean","description":"True to mark read, false to mark unread."}},"required":["messageId","read"],"additionalProperties":false},"MessageRecordResponse":{"type":"object","properties":{"bodyHtml":{"type":"string","description":"HTML message body."},"bodyText":{"type":"string","description":"Text message body."},"hidden":{"type":"boolean","description":"If `true`, message is not visible to end users."},"summary":{"type":"string","description":"Text message summary."},"messageId":{"type":"string","description":"Unique Message identifier."},"distId":{"type":"string","description":"Related distribution identifier if applicable."},"distToken":{"type":"string","description":"Message distribution.","enum":["applicationManager","beneficiaryManager","groupManager","groupMember","merchantManager"]},"userId":{"type":"string","description":"Related User identifier."},"subject":{"type":"string","description":"Text message subject."},"archived":{"type":"integer","description":"Archived timestamp in millis."},"created":{"type":"integer","description":"Created timestamp in millis."},"updated":{"type":"integer","description":"Updated timestamp in millis."},"updater":{"type":"string","description":"userId or stack name of last updater."},"read":{"type":"number","description":"Read timestamp in millis."},"targets":{"type":"object","description":"A JSON object identifying SNS distribution channels resolved from user preferences.","properties":{"email":{"type":"string","description":"Email address for SNS distribution."},"sms":{"type":"string","description":"Phone number for SMS distribution."}},"additionalProperties":false},"templateId":{"type":"string","description":"Related Template identifier."}},"required":["created","messageId","updated","updater","userId"],"additionalProperties":false},"excludeEndpoints":{"type":"string"},"excludeTags":{"type":"string"},"includeEndpoints":{"type":"string"},"includeTags":{"type":"string"},"09659cc7-960b-4bb0-ab77-ca346e7f7836":{"type":"object"},"Access-Control-Allow-Origin":{"type":"string","default":"*","example":"https://developer.mozilla.org"},"Access-Control-Allow-Credentials":{"type":"boolean","default":true},"424ecae9-32c9-4831-954a-9add0ac96517":{"type":"object"},"messageId":{"type":"string"},"templateId":{"type":"string"},"createdFrom":{"type":"integer"},"createdTo":{"type":"integer"},"distId":{"type":"string"},"distToken":{"type":"string","enum":["applicationManager","beneficiaryManager","groupManager","groupMember","merchantManager"]},"isArchived":{"type":"boolean"},"isHidden":{"type":"boolean"},"isRead":{"type":"boolean"},"limit":{"anyOf":[{"type":"integer"},{"type":"string","enum":["all"]}]},"pageKeys":{"type":"string"},"pageSize":{"type":"integer"},"sortOrder":{"type":"string","enum":["asc","desc"]},"userId":{"type":"string"}},"securitySchemes":{"private":{"type":"apiKey","name":"X-API-Key","in":"header"},"cognito":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://user-v0.veterancrowd.com/oauth2/authorize","scopes":{"openid":"OpenId authentication"}}}},"x-api-key":{"type":"apiKey","name":"x-api-key","in":"header"}}},"info":{"title":"api-message","description":"Message API","version":"v0"},"paths":{"/doc/openapi":{"get":{"summary":"Get OpenAPI docs","description":"Get JSON-formatted OpenAPI documentation.","operationId":"publicGetDocOpenapi","parameters":[{"name":"excludeEndpoints","in":"query","description":"A tilde (~) delimited list of endpoint tags. Endpoints with these tags will be excluded from the result. This parameter is mutually exclusive with `includeEndpoints`.","required":false,"schema":{"$ref":"#/components/schemas/excludeEndpoints"}},{"name":"excludeTags","in":"query","description":"A tilde (~) delimited list of endpoint tags. These tags will be stripped from the result. This parameter is mutually exclusive with `includeTags`.","required":false,"schema":{"$ref":"#/components/schemas/excludeTags"}},{"name":"includeEndpoints","in":"query","description":"A tilde (~) delimited list of endpoint tags. Only endpoints with these tags will be included in the result. This parameter is mutually exclusive with `excludeEndpoints`.","required":false,"schema":{"$ref":"#/components/schemas/includeEndpoints"}},{"name":"includeTags","in":"query","description":"A tilde (~) delimited list of endpoint tags. All other tags will be stripped from the result. This parameter is mutually exclusive with `excludeTags`.","required":false,"schema":{"$ref":"#/components/schemas/includeTags"}}],"tags":["Public","Doc"],"responses":{"200":{"description":"JSON-formatted OpenAPI documentation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/09659cc7-960b-4bb0-ab77-ca346e7f7836"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/doc/postman":{"get":{"summary":"Get Postman docs","description":"Get JSON-formatted Postman documentation.","operationId":"publicGetDocPostman","parameters":[],"tags":["Public","Doc"],"responses":{"200":{"description":"JSON-formatted Postman documentation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/424ecae9-32c9-4831-954a-9add0ac96517"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/my/admin/purge":{"post":{"summary":"Purge database.","description":"Purge the service database.\n\nValid request requires:\n\n* Authenticated User is ApplicationManager.\n\n* `force === true` in production environments.","operationId":"myPurgeMessage","parameters":[],"tags":["Cognito","Message"],"security":[{"cognito":["openid"]}],"requestBody":{"description":"Purge config.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPurgePostRequest"}}}},"responses":{"200":{"description":"Purge results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPurgePostResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/my/message":{"get":{"summary":"Get Message","description":"Retrieve a Message record by `messageId`.\n\nValid request requires:\n\n* `messageId` Message record exists.\n\n* One of:\n\n  * Authenticated User is ApplicationManager.\n\n  * Authenticated User is User corresponding to Message `userId`.","operationId":"myGetMessage","parameters":[{"name":"messageId","in":"query","description":"The messageId of the Message record to retrieve.","required":true,"schema":{"$ref":"#/components/schemas/messageId"}}],"tags":["Cognito","Message"],"security":[{"cognito":["openid"]}],"responses":{"200":{"description":"Message record array.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageGetResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}},"patch":{"summary":"Update Message","description":"Update a Message record.\n\nValid request requires:\n\n* `body.messageId` Message record exists.\n\n* One of:\n\n  * Authenticated User is ApplicationManager.\n\n  * Authenticated User is User corresponding to Message `userId`.","operationId":"myUpdateMessage","parameters":[],"tags":["Cognito","Message"],"security":[{"cognito":["openid"]}],"requestBody":{"description":"Editable Message properties.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePatchRequest"}}}},"responses":{"200":{"description":"Message record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRecordResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}},"post":{"summary":"Create Message","description":"Create a Message record.\n\nValid request requires:\n\n* Authenticated User is ApplicationManager.","operationId":"myCreateMessage","parameters":[],"tags":["Cognito","Message"],"security":[{"cognito":["openid"]}],"requestBody":{"description":"Message post request.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePostRequest"}}}},"responses":{"200":{"description":"Message record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRecordResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/my/message/archive":{"patch":{"summary":"Archive/Unarchive Message","description":"Archive/unarchive a Message record.\n\nValid request requires:\n\n* `body.messageId` Message record exists.\n\n* `body.archive` not equal to current archive state.\n\n* One of:\n\n  * Authenticated User is ApplicationManager.\n\n  * Authenticated User is User corresponding to Message `userId`.","operationId":"myArchiveMessage","parameters":[],"tags":["Cognito","Message"],"security":[{"cognito":["openid"]}],"requestBody":{"description":"Message archive state.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageArchivePatchRequest"}}}},"responses":{"200":{"description":"Message record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRecordResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/my/message/read":{"patch":{"summary":"Read/Unread Message","description":"Read/unread a Message record.\n\nValid request requires:\n\n* `body.messageId` Message record exists.\n\n* `body.read` not equal to current read state.\n\n* One of:\n\n  * Authenticated User is ApplicationManager.\n\n  * Authenticated User is User corresponding to Message `userId`.","operationId":"myReadMessage","parameters":[],"tags":["Cognito","Message"],"security":[{"cognito":["openid"]}],"requestBody":{"description":"Message read state.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageReadPatchRequest"}}}},"responses":{"200":{"description":"Message record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRecordResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/my/messages":{"get":{"summary":"Search Messages","description":"Retrieve an array of Message records.\n\nDefault sort order is `asc` for `user` sort, `desc` otherwise.\n\nValid request requires:\n\n* One of:\n\n  * Authenticated User is ApplicationManager.\n\n  * Authenticated User is User corresponding to Message `userId`.\n\nSearch is transparently conducted across all shards. Results are returned in order according to the governing index RANGE key, with the following caveats:\n\n* Paged results across multiple shards are internally sorted by RANGE key but not guaranteed to be in order across shards.\n\n* There may be some overlap at page edges once page results are combined & sorted.\n\nFor best results:\n\n* Sharding can be added to any entity as required! Design under the assumption that all entities will be sharded.\n\n* Progressively integrate new page results into previous results & declaratively sort results prior to display.","operationId":"mySearchMessages","parameters":[{"name":"templateId","in":"query","description":"Filter by `templateId`.","required":false,"schema":{"$ref":"#/components/schemas/templateId"}},{"name":"createdFrom","in":"query","description":"From created timestamp.","required":false,"schema":{"$ref":"#/components/schemas/createdFrom"}},{"name":"createdTo","in":"query","description":"To created timestamp.","required":false,"schema":{"$ref":"#/components/schemas/createdTo"}},{"name":"distId","in":"query","description":"Filter by Template distribution identifier. Not valid for `applicationManager` distToken.","required":false,"schema":{"$ref":"#/components/schemas/distId"}},{"name":"distToken","in":"query","description":"Type of template distribution, if any. Required if `distId` is populated.","required":false,"schema":{"$ref":"#/components/schemas/distToken"}},{"name":"isArchived","in":"query","description":"Filter by archived state.","required":false,"schema":{"$ref":"#/components/schemas/isArchived"}},{"name":"isHidden","in":"query","description":"Filter by hidden state.","required":false,"schema":{"$ref":"#/components/schemas/isHidden"}},{"name":"isRead","in":"query","description":"Filter by read state.","required":false,"schema":{"$ref":"#/components/schemas/isRead"}},{"name":"limit","in":"query","description":"Max number of return records desired. Actual records returned will depend on available records, search constraints, shard structure, and `pageSize`. Default value is set by the service on a per-entity basis.","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"pageKeys","in":"query","description":"A compressed map of shardKeys to pageKeys. This value is returned in the `pageKeys` property of the previous search response body. If omitted, returns the first search page. An empty string indicates no more pages and will always return an empty result set.","required":false,"schema":{"$ref":"#/components/schemas/pageKeys"}},{"name":"pageSize","in":"query","description":"Size of each database query page. Trades search performance against minimum result size. Default value is set by the service on a per-entity basis.","required":false,"schema":{"$ref":"#/components/schemas/pageSize"}},{"name":"sortOrder","in":"query","description":"Sort order. See endpoint description for default value.","required":false,"schema":{"$ref":"#/components/schemas/sortOrder"}},{"name":"userId","in":"query","description":"Filter by `userId`","required":false,"schema":{"$ref":"#/components/schemas/userId"}}],"tags":["Cognito","Message"],"security":[{"cognito":["openid"]}],"responses":{"200":{"description":"Message record array & page keys.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageListResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}},"post":{"summary":"Create Messages","description":"Create Message records from source data & templates.\n\nValid request requires:\n\n* Authenticated User is ApplicationManager.","operationId":"myCreateMessages","parameters":[],"tags":["Cognito","Message"],"security":[{"cognito":["openid"]}],"requestBody":{"description":"Messages post request.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesPostRequest"}}}},"responses":{"200":{"description":"Empty response body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesPostResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/private/admin/purge":{"post":{"summary":"Purge database.","description":"Purge the service database.\n\nValid request requires:\n\n* `force === true` in production environments.","operationId":"privatePurgeMessage","parameters":[],"tags":["Private","Message"],"security":[{"private":[]},{"x-api-key":[]}],"requestBody":{"description":"Purge config.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPurgePostRequest"}}}},"responses":{"200":{"description":"Purge results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPurgePostResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/private/message":{"get":{"summary":"Get Message","description":"Retrieve a Message record by `messageId`.\n\nValid request requires:\n\n* `messageId` Message record exists.\n\n* One of:\n\n  * Authenticated User is ApplicationManager.\n\n  * Authenticated User is User corresponding to Message `userId`.","operationId":"privateGetMessage","parameters":[{"name":"messageId","in":"query","description":"The messageId of the Message record to retrieve.","required":true,"schema":{"$ref":"#/components/schemas/messageId"}}],"tags":["Private","Message"],"security":[{"private":[]},{"x-api-key":[]}],"responses":{"200":{"description":"Message record array.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageGetResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}},"patch":{"summary":"Update Message","description":"Update a Message record.\n\nValid request requires:\n* `body.messageId` Message record exists.","operationId":"privateUpdateMessage","parameters":[],"tags":["Private","Message"],"security":[{"private":[]},{"x-api-key":[]}],"requestBody":{"description":"Editable Message properties.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePatchRequest"}}}},"responses":{"200":{"description":"Message record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRecordResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}},"post":{"summary":"Create Message","description":"Create a Message record.","operationId":"privateCreateMessage","parameters":[],"tags":["Private","Message"],"security":[{"private":[]},{"x-api-key":[]}],"requestBody":{"description":"Message post request.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePostRequest"}}}},"responses":{"200":{"description":"Message record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRecordResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/private/message/archive":{"patch":{"summary":"Archive/Unarchive Message","description":"Archive a Message record.\n\nValid request requires:\n* `body.messageId` Message record exists.\n\n* `body.archive` not equal to current archive state.","operationId":"privateArchiveMessage","parameters":[],"tags":["Private","Message"],"security":[{"private":[]},{"x-api-key":[]}],"requestBody":{"description":"Message archive state.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageArchivePatchRequest"}}}},"responses":{"200":{"description":"Message record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRecordResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/private/message/read":{"patch":{"summary":"Read/Unread Message","description":"Read a Message record.\n\nValid request requires:\n* `body.messageId` Message record exists.\n\n* `body.read` not equal to current read state.","operationId":"privateReadMessage","parameters":[],"tags":["Private","Message"],"security":[{"private":[]},{"x-api-key":[]}],"requestBody":{"description":"Message read state.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageReadPatchRequest"}}}},"responses":{"200":{"description":"Message record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRecordResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}},"/private/messages":{"get":{"summary":"Search Messages","description":"Retrieve an array of Message records.\n\nDefault sort order is `asc` for `user` sort, `desc` otherwise.\n\nValid request requires:\n\n* One of:\n\n  * Authenticated User is ApplicationManager.\n\n  * Authenticated User is User corresponding to Message `userId`.\n\nSearch is transparently conducted across all shards. Results are returned in order according to the governing index RANGE key, with the following caveats:\n\n* Paged results across multiple shards are internally sorted by RANGE key but not guaranteed to be in order across shards.\n\n* There may be some overlap at page edges once page results are combined & sorted.\n\nFor best results:\n\n* Sharding can be added to any entity as required! Design under the assumption that all entities will be sharded.\n\n* Progressively integrate new page results into previous results & declaratively sort results prior to display.","operationId":"privateSearchMessages","parameters":[{"name":"templateId","in":"query","description":"Filter by `templateId`.","required":false,"schema":{"$ref":"#/components/schemas/templateId"}},{"name":"createdFrom","in":"query","description":"From created timestamp.","required":false,"schema":{"$ref":"#/components/schemas/createdFrom"}},{"name":"createdTo","in":"query","description":"To created timestamp.","required":false,"schema":{"$ref":"#/components/schemas/createdTo"}},{"name":"distId","in":"query","description":"Filter by Template distribution identifier. Not valid for `applicationManager` distToken.","required":false,"schema":{"$ref":"#/components/schemas/distId"}},{"name":"distToken","in":"query","description":"Type of template distribution, if any. Required if `distId` is populated.","required":false,"schema":{"$ref":"#/components/schemas/distToken"}},{"name":"isArchived","in":"query","description":"Filter by archived state.","required":false,"schema":{"$ref":"#/components/schemas/isArchived"}},{"name":"isHidden","in":"query","description":"Filter by hidden state.","required":false,"schema":{"$ref":"#/components/schemas/isHidden"}},{"name":"isRead","in":"query","description":"Filter by read state.","required":false,"schema":{"$ref":"#/components/schemas/isRead"}},{"name":"limit","in":"query","description":"Max number of return records desired. Actual records returned will depend on available records, search constraints, shard structure, and `pageSize`. Default value is set by the service on a per-entity basis.","required":false,"schema":{"$ref":"#/components/schemas/limit"}},{"name":"pageKeys","in":"query","description":"A compressed map of shardKeys to pageKeys. This value is returned in the `pageKeys` property of the previous search response body. If omitted, returns the first search page. An empty string indicates no more pages and will always return an empty result set.","required":false,"schema":{"$ref":"#/components/schemas/pageKeys"}},{"name":"pageSize","in":"query","description":"Size of each database query page. Trades search performance against minimum result size. Default value is set by the service on a per-entity basis.","required":false,"schema":{"$ref":"#/components/schemas/pageSize"}},{"name":"sortOrder","in":"query","description":"Sort order. See endpoint description for default value.","required":false,"schema":{"$ref":"#/components/schemas/sortOrder"}},{"name":"userId","in":"query","description":"Filter by `userId`","required":false,"schema":{"$ref":"#/components/schemas/userId"}}],"tags":["Private","Message"],"security":[{"private":[]},{"x-api-key":[]}],"responses":{"200":{"description":"Message record array & page keys.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageListResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}},"post":{"summary":"Create Messages","description":"Create Message records from data & templates.","operationId":"privateCreateMessages","parameters":[],"tags":["Private","Message"],"security":[{"private":[]},{"x-api-key":[]}],"requestBody":{"description":"Messages post request.","required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesPostRequest"}}}},"responses":{"200":{"description":"Empty response body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesPostResponse"}}},"headers":{"Access-Control-Allow-Origin":{"description":"The Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin). - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Origin"}},"Access-Control-Allow-Credentials":{"description":"The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the request's credentials mode ([Request.credentials](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)) is include. - [MDN Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials)","schema":{"$ref":"#/components/schemas/Access-Control-Allow-Credentials"}}}}}}}},"servers":[{"url":"https://api.veterancrowd.com/message-v0","description":"AWS prod environment."}],"tags":[{"name":"Public","description":"Public endpoints."},{"name":"Cognito","description":"Cognito authenticated endpoints."},{"name":"Private","description":"API key authenticated endpoints."},{"name":"Message","description":"Message entity endpoints."}]}