{"openapi":"3.0.0","info":{"title":"Twake on Matrix APIs documentation","version":"0.0.1","description":"This is The documentation of all available APIs of this repository"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"AccessToken":{"type":"apiKey","in":"header","name":"x-access-token"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"lemonldap"}},"schemas":{"MatrixError":{"type":"object","properties":{"errcode":{"type":"string","description":"A Matrix error code"},"error":{"type":"string","description":"A human-readable error message"}},"required":["error"]},"Addressbook":{"type":"object","properties":{"id":{"type":"string"},"owner":{"type":"string"},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}}}},"Contact":{"type":"object","properties":{"id":{"type":"string"},"mxid":{"type":"string"},"display_name":{"type":"string"},"active":{"type":"boolean"},"addressbook_id":{"type":"string"}}},"ContactCreationPayload":{"type":"object","properties":{"mxid":{"type":"string"},"display_name":{"type":"string"}}},"ContactUpdatePayload":{"type":"object","properties":{"display_name":{"type":"string"},"active":{"type":"boolean","required":false}}},"Invitation":{"type":"object","properties":{"contact":{"type":"string","description":"The contact to send the invitation to"},"medium":{"type":"string","description":"The medium to send the invitation through"}},"required":["contact","medium"]},"ActivityMetric":{"type":"object","properties":{"dailyActiveUsers":{"type":"number"},"weeklyActiveUsers":{"type":"number"},"monthlyActiveUsers":{"type":"number"},"weeklyNewUsers":{"type":"number"},"monthlyNewUsers":{"type":"number"}}},"MessageMetric":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"message_count":{"type":"number"}}}},"sms":{"type":"object","properties":{"to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"text":{"type":"string"}}},"UserInfo":{"type":"object","description":"Representation of a Matrix user enriched with optional data from\nthe local user database and common settings.\n","required":["uid","display_name"],"properties":{"uid":{"type":"string","description":"The fully‑qualified Matrix user identifier (e.g.\n`@johndoe:matrix.org`). **Always present**.\n","example":"@johndoe:matrix.org"},"display_name":{"type":"string","description":"Human‑readable name for the user. **Always present**.\n","example":"John Doe"},"avatar_url":{"type":"string","format":"uri","description":"URL of the user’s avatar (`mxc://` URI). Present only if the\nMatrix server stores an avatar for the user.\n","example":"mxc://synapse/mediaid"},"phones":{"type":"array","description":"List of phone numbers associated with the user in the local\nUserDB. Present only when such associations exist.\n","items":{"type":"string","example":"+1 234 567 8910"}},"emails":{"type":"array","description":"List of e‑mail addresses associated with the user in the local\nUserDB. Present only when such associations exist.\n","items":{"type":"string","format":"email","example":"j.doe@email.com"}},"sn":{"type":"string","description":"*DEPRECATED* Surname (family name) from the UserDB. Present only when the\nUserDB contains this attribute.\n","example":"Doe"},"last_name":{"type":"string","description":"Given name (first name) from the UserDB. Present only when the\nUserDB contains this attribute.\n","example":"John"},"givenName":{"type":"string","description":"*DEPRECATED* Surname (family name) from the UserDB. Present only when the\nUserDB contains this attribute.\n","example":"Doe"},"first_name":{"type":"string","description":"Given name (first name) from the UserDB. Present only when the\nUserDB contains this attribute.\n","example":"John"},"language":{"type":"string","description":"Preferred language code (e.g. `en`, `fr`). Present only when\ncommon settings are enabled and a value is stored.\n","example":"en"},"timezone":{"type":"string","description":"IANA time‑zone identifier (e.g. `Europe/Paris`). Present only\nwhen common settings are enabled and a value is stored.\n","example":"Europe/Paris"}}}},"responses":{"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"The message describing the internal error"}}}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixError"},"example":{"errcode":"M_UNAUTHORIZED","error":"Unauthorized"}}}},"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixError"},"example":{"errcode":"M_MISSING_PARAMS","error":"Properties are missing in the request body"}}}},"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixError"},"example":{"errcode":"M_FORBIDDEN","error":"Forbidden"}}}},"Conflict":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixError"},"example":{"error":"Conflict"}}}},"PermanentRedirect":{"description":"Permanent Redirect","headers":{"Location":{"schema":{"type":"string","description":"URL to use for recdirect"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixError"},"example":{"errcode":"M_UNKNOWN","error":"This non-standard endpoint has been removed"}}}},"NotFound":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixError"},"example":{"errcode":"M_NOT_FOUND","error":"Not Found"}}}},"Unrecognized":{"description":"Unrecognized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixError"},"example":{"errcode":"M_UNRECOGNIZED","error":"Unrecognized"}}}}},"parameters":{"userId":{"in":"path","name":"userId","description":"The user‑id used in the request path.","required":true,"schema":{"type":"string"}}}},"security":[{"bearerAuth":[]}],"paths":{"/_matrix/identity/v2":{"get":{"tags":["Identity server"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#get_matrixidentityv2"}},"/_matrix/identity/v2/hash_details":{"get":{"tags":["Federated identity service"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#get_matrixidentityv2hash_details"}},"/_matrix/identity/v2/lookup":{"post":{"tags":["Federated identity service"],"description":"Extends https://spec.matrix.org/v1.6/identity-service-api/#post_matrixidentityv2lookup to display inactive users and 3PID users","requestBody":{"description":"Object containing hashes of mails/phones to search","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"addresses":{"type":"array","items":{"type":"string","description":"List of (hashed) addresses to lookup"}},"algorithm":{"type":"string","description":"Algorithm the client is using to encode the addresses"},"pepper":{"type":"string","description":"Pepper from '/hash_details'"}},"required":["addresses","algorithm","pepper"]},"example":{"addresses":["4kenr7N9drpCJ4AfalmlGQVsOn3o2RHjkADUpXJWZUc","nlo35_T5fzSGZzJApqu8lgIudJvmOQtDaHtr-I4rU7I"],"algorithm":"sha256","pepper":"matrixrocks"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"mappings":{"type":"object","additionalProperties":{"type":"string"},"description":"List of active accounts"},"inactive_mappings":{"type":"object","additionalProperties":{"type":"string"},"description":"List of inactive accounts"},"third_party_mappings":{"type":"object","description":"List of hashed addresses by identity server hostname","properties":{"hostname":{"type":"object","properties":{"actives":{"type":"array","items":{"type":"string","description":"List of (hashed) active accounts addresses matching request body addresses"}},"inactives":{"type":"array","items":{"type":"string","description":"List of (hashed) inactive accounts addresses matching request body addresses"}}}}}}}},"example":{"mappings":{"4kenr7N9drpCJ4AfalmlGQVsOn3o2RHjkADUpXJWZUc":"@dwho:company.com"},"inactive_mappings":{"nlo35_T5fzSGZzJApqu8lgIudJvmOQtDaHtr-I4rU7I":"@rtyler:company.com"},"third_party_mappings":{"identity1.example.com":{"actives":["78jnr7N9drpCJ4AfalmlGQVsOn3o2RHjkADUpXJWZUc","gtr42_T5fzSGZzJAmlp5lgIudJvmOQtDaHtr-I4rU7I"],"inactives":["qfgt57N9drpCJ4AfalmlGQVsOn3o2RHjkADUpXJWZUc","lnbc8_T5fzSGZzJAmlp5lgIudJvmOQtDaHtr-I4rU7I"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"405":{"$ref":"#/components/responses/Unrecognized"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/_matrix/identity/v2/account":{"get":{"tags":["Identity server"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#get_matrixidentityv2account"}},"/_matrix/identity/v2/account/register":{"post":{"tags":["Identity server"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#post_matrixidentityv2accountregister"}},"/_matrix/identity/v2/account/logout":{"post":{"tags":["Identity server"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#post_matrixidentityv2accountlogout"}},"/_matrix/identity/v2/terms":{"get":{"tags":["Identity server"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#get_matrixidentityv2terms"}},"/_matrix/identity/v2/validate/email/requestToken":{"post":{"tags":["Identity server"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#post_matrixidentityv2validateemailrequesttoken"}},"/_matrix/identity/v2/validate/email/submitToken":{"post":{"tags":["Identity server"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#post_matrixidentityv2validateemailsubmittoken"}},"/_matrix/identity/versions":{"get":{"tags":["Identity server"],"description":"Implements https://spec.matrix.org/v1.6/identity-service-api/#get_matrixidentityversions"}},"/_twake/identity/v1/lookup/match":{"post":{"tags":["Identity server"],"description":"Looks up the Organization User IDs which match value sent","requestBody":{"description":"Object containing detail for the search and the returned data","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"array","items":{"type":"string","description":"List of fields to search in (uid, mail,...)","deprecated":true}},"fields":{"type":"array","items":{"type":"string","description":"List of fields to return for matching users (uid, mail, mobile, displayName, givenName, cn, sn)","deprecated":true}},"val":{"type":"string","description":"Optional value to search"},"limit":{"type":"integer","description":"Optional max number of result to return (default 30)"},"offset":{"type":"integer","description":"Optional offset for pagination"}},"required":["scope","fields"]},"example":{"scope":["mail","uid"],"fields":["uid","displayName","sn","givenName","mobile"],"val":"rtyler","limit":3}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"matches":{"type":"array","description":"List of users that match","items":{"type":"object","properties":{"address":{"type":"string","description":"Matrix address, will be included in uid","deprecated":true},"uid":{"type":"string","description":"id of a matching user"},"display_name":{"type":"string","description":"Display name of a matching user"},"displayName":{"type":"string","description":"Display name of a matching user","deprecated":true},"givenName":{"type":"string","description":"Display name of a matching user","deprecated":true},"givenname":{"type":"string","description":"Display name of a matching user","deprecated":true},"cn":{"type":"string","description":"Display name of a matching user","deprecated":true},"avatar_url":{"type":"string","description":"Avatar URI of a matching user following the mxc format\nhttps://spec.matrix.org/v1.10/client-server-api/#matrix-content-mxc-uris"},"last_name":{"type":"string","description":"Last name of a matching user"},"first_name":{"type":"string","description":"First name of a matching user"},"mail":{"type":"string","description":"Email address of a matching user","deprecated":true},"emails":{"type":"array","items":{"type":"string","description":"Email addresses of a matching user"}},"mobile":{"type":"string","description":"Mobile phone number of a matching user","deprecated":true},"phones":{"type":"array","items":{"type":"string","description":"Mobile phone numbers of a matching user"}},"language":{"type":"string","description":"Language of a matching user"},"timezone":{"type":"string","description":"Timezone of a matching user"}}}}}},"example":{"matches":[{"uid":"rtyler","display_name":"Robert Tyler","avatar_url":"mxc://matrix.org/SEsfnsuifSDFWefnsdfWefnsd","last_name":"Tyler","first_name":"Robert","emails":["rtyler@matrix.org","robert.t@personal.tld"],"phones":["+33612345678"],"language":"en","timezone":"Europe/Paris"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/_twake/identity/v1/lookup/diff":{"post":{"tags":["Identity server"],"description":"Looks up the Organization User IDs updated since X","requestBody":{"description":"Object containing the timestamp","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"since":{"type":"integer","description":"timestamp"},"fields":{"type":"array","items":{"type":"string","description":"List of fields to return for matching users"}},"limit":{"type":"integer","description":"Optional max number of result to return (default 30)"},"offset":{"type":"integer","description":"Optional offset for pagination"}}},"example":{"since":1685074279,"fields":["uid","mail"],"limit":3}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"matches":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string","description":"Matrix address"},"timestamp":{"type":"integer","description":"current server timestamp"},"uid":{"type":"string","description":"id of a matching user"},"mail":{"type":"string","description":"email address of a matching user"}}},"description":"List of users that match"}}},"example":{"matches":[{"uid":"dwho","mail":"dwho@badwolf.com"}]}}}}}}},"/_twake/recoveryWords":{"get":{"tags":["Vault API"],"description":"Allow for the connected user to retrieve its recovery words","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"words":{"type":"string","description":"Recovery words of the connected user"}}},"example":{"words":"This is the recovery sentence of rtyler"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Connected user has no recovery sentence"}}},"example":{"error":"User has no recovery sentence"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Connected user has multiple recovery sentence"}}},"example":{"error":"User has more than one recovery sentence"}}}},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Vault API"],"description":"Store connected user recovery words in database","requestBody":{"description":"Object containing the recovery words of the connected user","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"words":{"type":"string","description":"The recovery words of the connected user"}},"required":["words"]},"example":{"words":"This is the recovery sentence of rtyler"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Message indicating that words have been successfully saved"}},"example":{"message":"Saved recovery words sucessfully"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"delete":{"tags":["Vault API"],"description":"Delete the user recovery words in the database","responses":{"204":{"description":"Delete success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Connected user has no recovery sentence"}}},"example":{"error":"User has no recovery sentence"}}}},"500":{"$ref":"#/components/responses/InternalServerError"}}},"put":{"tags":["Vault API"],"description":"Update stored connected user recovery words in database","requestBody":{"description":"Object containing the recovery words of the connected user","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"words":{"type":"string","description":"The new recovery words of the connected user"}},"required":["words"]},"example":{"words":"This is the updated recovery sentence of rtyler"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Message indicating that words have been successfully updated"}},"example":{"message":"Updated recovery words sucessfully"}}}}},"400":{"description":"Bad request"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/.well-known/matrix/client":{"get":{"tags":["Auto configuration"],"description":"Get server metadata for auto-configuration","responses":{"200":{"description":"Server metadata used for auto‑configuration","content":{"application/json":{"schema":{"type":"object","properties":{"m.homeserver":{"type":"object","description":"Matrix homeserver information","properties":{"base_url":{"type":"string","format":"uri","description":"Base URL of the Matrix server"}}},"m.identity_server":{"type":"object","description":"Identity‑server information","properties":{"base_url":{"type":"string","format":"uri","description":"Base URL of the Identity server"}}},"org.matrix.msc3575.proxy":{"type":"object","description":"Proxy service used by MSC‑3575","properties":{"url":{"type":"string","format":"uri","description":"URL of the proxy service"}}},"m.federated_identity_services":{"type":"object","nullable":true,"description":"Federated identity services (optional)","properties":{"base_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"List of base URLs for each federated identity service"}}},"t.server":{"type":"object","description":"Twake‑Chat server metadata","properties":{"base_url":{"type":"string","format":"uri","description":"Base URL of the Twake‑Chat server"},"server_name":{"type":"string","description":"Domain handled by the Matrix server"}}},"m.integrations":{"type":"object","description":"Integration configuration (currently only Jitsi)","properties":{"jitsi":{"type":"object","properties":{"preferredDomain":{"type":"string","description":"Preferred domain for Jitsi meetings"},"baseUrl":{"type":"string","format":"uri","description":"Base URL of the Jitsi server"},"useJwt":{"type":"boolean","description":"Whether the Jitsi server expects a JWT"},"jwt":{"type":"object","nullable":true,"description":"JWT configuration (present only when `useJwt` is true)","properties":{"algorithm":{"type":"string","description":"Algorithm used to sign the token (e.g. HS256)"},"secret":{"type":"string","description":"Secret used to sign the token"},"issuer":{"type":"string","description":"Issuer claim of the token"}}}}}}},"m.authentication":{"type":"object","nullable":true,"description":"OpenID Connect authentication configuration","properties":{"issuer":{"type":"string","format":"uri","description":"URL of the OIDC issuer"}}},"app.twake.chat":{"type":"object","description":"Twake‑Chat specific configuration (the whole `twake_chat` object)","properties":{"default_homeserver":{"type":"string","description":"Matrix homeserver identifier (value of `config.matrix_server`)"},"homeserver":{"type":"string","format":"uri","description":"Full URL of the homeserver (`https:///`)"},"common_settings":{"type":"object","description":"Feature‑flag group for “Common Settings”","properties":{"enabled":{"type":"boolean","description":"Whether the Common Settings integration is enabled"}}},"matrix_profile_updates_allowed":{"type":"boolean","description":"Whether a user may update their Matrix profile from the UI"},"application_name":{"type":"string","description":"Human‑readable name of the Twake application"},"application_welcome_message":{"type":"string","description":"Message displayed on the welcome screen"},"privacy_url":{"type":"string","format":"uri","description":"Link to the privacy‑policy page"},"render_html":{"type":"boolean","description":"If true, the client renders HTML inside messages"},"hide_redacted_events":{"type":"boolean","description":"Hide redacted events when true"},"hide_unknown_events":{"type":"boolean","description":"Hide events of unknown type when true"},"issue_id":{"type":"string","description":"Identifier used for issue tracking / support tickets"},"registration_url":{"type":"string","format":"uri","description":"Direct link to the registration page"},"twake_workplace_homeserver":{"type":"string","format":"uri","description":"Homeserver URL used for the “workplace” integration"},"app_grid_dashboard_available":{"type":"boolean","description":"Controls exposure of the App‑Grid Dashboard feature"},"platform":{"type":"string","description":"Target platform identifier (e.g. `web`, `mobile`, `desktop`)"},"default_max_upload_avatar_size_in_bytes":{"type":"string","description":"Maximum allowed avatar file size (bytes) – stored as a string in the config"},"dev_mode":{"type":"boolean","description":"Enable dev‑mode UI (extra debugging information)"},"qr_code_download_url":{"type":"string","format":"uri","description":"URL to download a QR‑code image for mobile login"},"enable_logs":{"type":"boolean","description":"Enable client‑side logging sent to the server"},"support_url":{"type":"string","format":"uri","description":"Link to a support portal / help centre"},"enable_invitations":{"type":"boolean","description":"Allow users to invite external contacts"}}}},"example":{"m.homeserver":{"base_url":"https://matrix.docker.localhost/"},"m.identity_server":{"base_url":"https://tom.docker.localhost"},"org.matrix.msc3575.proxy":{"url":"https://syncv3.docker.localhost"},"t.server":{"base_url":"https://tom.docker.localhost","server_name":"docker.localhost"},"m.integrations":{"jitsi":{"preferredDomain":"","baseUrl":"","useJwt":false}},"app.twake.chat":{"application_name":"","application_welcome_message":"","default_homeserver":"matrix.docker.localhost","privacy_url":"","render_html":false,"hide_redacted_events":false,"hide_unknown_events":false,"issue_id":"","registration_url":"","twake_workplace_homeserver":"","app_grid_dashboard_available":false,"platform":"","default_max_upload_avatar_size_in_bytes":"","dev_mode":false,"qr_code_download_url":"","enable_logs":false,"support_url":"","enable_invitations":false,"homeserver":"https://matrix.docker.localhost/","common_settings":{"enabled":false},"matrix_profile_updates_allowed":false},"m.federated_identity_services":{"base_urls":["https://global-federated-identity-service.twake.app/","https://other-federated-identity-service.twake.app/","https://fed.docker.localhost/"]},"m.authentication":{"issuer":"https://auth.docker.localhost"}}}}}}}}},"/_matrix/identity/v2/lookups":{"post":{"tags":["Federated identity service"],"description":"Implements https://github.com/guimard/matrix-spec-proposals/blob/unified-identity-service/proposals/4004-unified-identity-service-view.md","requestBody":{"description":"Object containing hashes to store in federated identity service database","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mappings":{"type":"object","description":"List of hashed addresses by identity server hostname","properties":{"hostname":{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"active":{"type":"number"}}}}}},"algorithm":{"type":"string","description":"Algorithm the client is using to encode the addresses"},"pepper":{"type":"string","description":"Pepper from '/hash_details'"}},"required":["addresses","algorithm","pepper"]},"example":{"mappings":{"identity1.example.com":[{"hash":"4kenr7N9drpCJ4AfalmlGQVsOn3o2RHjkADUpXJWZUc","active":1},{"hash":"nlo35_T5fzSGZzJApqu8lgIudJvmOQtDaHtr-I4rU7I","active":0}]},"algorithm":"sha256","pepper":"matrixrocks"}}}},"responses":{"201":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"405":{"$ref":"#/components/responses/Unrecognized"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/_twake/addressbook":{"get":{"tags":["Addressbook"],"description":"List all contacts in the addressbook","responses":{"200":{"description":"List of contacts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Addressbook"}}}}},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error"}}},"delete":{"tags":["Addressbook"],"description":"Delete the addressbook","responses":{"200":{"description":"Addressbook deleted"},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error"}}},"post":{"tags":["Addressbook"],"description":"Add contacts to the addressbook","requestBody":{"description":"The contacts to add","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/ContactCreationPayload"}}}}}}},"responses":{"200":{"description":"List of contacts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Addressbook"}}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error"}}}},"/_twake/addressbook/{id}":{"get":{"tags":["Addressbook"],"description":"Get a contact","responses":{"200":{"description":"Contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Contact not found"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error"}}},"put":{"tags":["Addressbook"],"description":"Update a contact","requestBody":{"description":"The contact to update","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdatePayload"}}}},"responses":{"200":{"description":"Contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"404":{"description":"Contact not found"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error"}}},"delete":{"tags":["Addressbook"],"description":"Delete a contact","responses":{"200":{"description":"Contact deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Contact not found"},"429":{"description":"Too many requests"},"500":{"description":"Internal server error"}}}},"/_twake/admin/deactivate-user/{id}":{"post":{"summary":"Deactivate a user","tags":["Admin"],"security":[{"AccessToken":[]}],"parameters":[{"in":"path","name":"id","required":true,"description":"The user ID to deactivate","schema":{"type":"string"}}],"responses":{"200":{"description":"User deactivated"},"400":{"description":"Missing user ID or user is already deactivated"},"401":{"description":"Unauthorized"},"404":{"description":"User not found"},"500":{"description":"Internal server error"}}}},"/_twake/v1/invite":{"post":{"tags":["Invitation"],"description":"Sends an invitation to a user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"responses":{"200":{"description":"Invitation sent","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"id":{"type":"string"}}}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests"},"500":{"description":"Internal Server Error"}}}},"/_twake/v1/invite/generate":{"post":{"tags":["Invitation"],"description":"generates an invitation link","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"responses":{"200":{"description":"Invitation sent","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"type":"string"},"id":{"type":"string"}}}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}}}},"/_twake/v1/invite/list":{"get":{"tags":["Invitation"],"description":"List all invitations sent by the user","responses":{"200":{"description":"List of invitations","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sender":{"type":"string"},"recipient":{"oneOf":[{"type":"string"},{"type":null}]},"medium":{"oneOf":[{"type":"string"},{"type":null}]},"expiration":{"type":"number"},"accessed":{"type":"boolean"},"matrix_id":{"oneOf":[{"type":"string"},{"type":null}]}}}}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"}}}},"/_twake/v1/invite/{id}":{"delete":{"tags":["Invitation"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"The invitation ID"}],"description":"Remove an invitation","responses":{"200":{"description":"Invitation removed"},"400":{"description":"Invalid invitation"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Invitation not found"},"500":{"description":"Internal error"}}},"get":{"tags":["Invitation"],"security":[{"cookieAuth":[]}],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"The invitation ID"}],"description":"Accepts an invitation","responses":{"301":{"description":"Redirect to the invitation redirect url"},"400":{"description":"Invalid invitation"},"404":{"description":"Invitation not found"}}}},"/_twake/v1/invite/{id}/status":{"get":{"tags":["Invitation"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"The invitation ID"}],"description":"Get the status of an invitation","responses":{"200":{"description":"Invitation status","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sender":{"type":"string"},"recipient":{"oneOf":[{"type":"string"},{"type":null}]},"medium":{"oneOf":[{"type":"string"},{"type":null}]},"expiration":{"type":"number"},"accessed":{"type":"boolean"},"matrix_id":{"oneOf":[{"type":"string"},{"type":null}]}}}}}},"400":{"description":"Invalid invitation"},"401":{"description":"Unauthorized"},"403":{"description":"You are not the owner of this invitation"},"404":{"description":"Invitation not found"},"500":{"description":"Internal error"}}}},"/_twake/v1/metrics/activity":{"get":{"tags":["Metrics"],"description":"Get user activity metrics","responses":{"200":{"description":"Activity metrics found","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/ActivityMetric"}}}},"400":{"description":"Bad request"},"403":{"description":"Forbidden"},"500":{"description":"Internal error"}}}},"/_twake/v1/metrics/messages":{"get":{"tags":["Metrics"],"description":"Get user messages metrics","responses":{"200":{"description":"Messages metrics found","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/MessageMetric"}}}},"400":{"description":"Bad request"},"403":{"description":"Forbidden"},"500":{"description":"Internal error"}}}},"/_twake/v1/qrcode":{"get":{"tags":["QR Code"],"description":"Get access QR Code","responses":{"200":{"description":"QR code generated","content":{"image/svg+xml":{"schema":{"type":"string"}}}},"400":{"description":"Access token is missing"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}}}},"/_twake/sms":{"post":{"requestBody":{"description":"SMS object","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sms"}}}},"tags":["SMS"],"description":"Send an SMS to a phone number","responses":{"200":{"description":"SMS sent successfully"},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}}}},"/_twake/v1/user_info/{userId}":{"get":{"tags":["User Info"],"description":"Get user info","parameters":[{"$ref":"#/components/parameters/userId"}],"responses":{"200":{"description":"User info found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"404":{"description":"User info not found"},"500":{"description":"Internal server error"}}}},"/_twake/v1/user_info/{userId}/visibility":{"get":{"tags":["User Info"],"description":"Get user info visibility","parameters":[{"$ref":"#/components/parameters/userId"}],"responses":{"200":{"description":"User info visibility settings found","content":{"application/json":{"schema":{"UserInfoVisibilitySettings":{"type":"object","description":"Representation of the User Information Visibility Settings","required":["visibility","visible_fields"],"properties":{"visibility":{"type":"string","description":"Defines who can access the selected fields","enum":["public","private","contacts"],"example":"contacts"},"visible_fields":{"type":"array","description":"Name of the fields visible according to visibility","uniqueItems":true,"maxItems":2,"items":{"type":"string","enum":["email","phone"]}}}}}}}},"404":{"description":"User info not found"},"500":{"description":"Internal server error"}}}}},"tags":[]}