safe-backup.schema.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. $schema: 'http://json-schema.org/draft-07/schema#'
  2. $id: 'https://safe.threema.ch/schema/1.json'
  3. description: Threema Safe backup format
  4. type: object
  5. properties:
  6. info:
  7. type: object
  8. properties:
  9. version:
  10. type: integer
  11. description: Current version
  12. anyOf:
  13. - title: Version 1
  14. const: 1
  15. - {}
  16. device:
  17. type: string
  18. description: A string with device information
  19. examples:
  20. - 1.2.3/de_DE
  21. required:
  22. - version
  23. user:
  24. type: object
  25. properties:
  26. privatekey:
  27. type: string
  28. description: The private key, 32 bytes base64 encoded
  29. examples:
  30. - ZWNob2VjaG9lY2hvZWNob2VjaG9lY2hvZWNob2VjaG8=
  31. nickname:
  32. type: string
  33. description: The public nickname
  34. examples:
  35. - julia
  36. profilePic:
  37. type: string
  38. description: |-
  39. Base64 encoded byte array. Image format: JPEG, q=60, maxsize=400x400,
  40. no metadata.
  41. profilePicRelease:
  42. type: array
  43. description: |-
  44. Array of Threema IDs. If profile picture distribution is disabled, the
  45. array should contain a single `null` value. If the profile picture
  46. should be distributed to everyone, the array should contain a single
  47. `"*"` value.
  48. items:
  49. type:
  50. - string
  51. - 'null'
  52. minLength: 1
  53. maxLength: 8
  54. pattern: '^([0-9A-Z\*][0-9A-Z]{7}|\*)$'
  55. examples:
  56. - ECHOECHO
  57. - '*'
  58. - null
  59. minItems: 1
  60. links:
  61. type: array
  62. description: Linked contact details (e.g. phone number or email)
  63. items:
  64. type: object
  65. properties:
  66. type:
  67. type: string
  68. description: The link type
  69. anyOf:
  70. - title: Phone number
  71. const: mobile
  72. - title: Email
  73. const: email
  74. - {}
  75. name:
  76. type: string
  77. description: A link description, e.g. "private" or "office".
  78. value:
  79. type: string
  80. description: |-
  81. The email or phone number (in E.164 format without leading +).
  82. examples:
  83. - '41704567890'
  84. - hello@example.com
  85. required:
  86. - type
  87. - value
  88. required:
  89. - privatekey
  90. contacts:
  91. type: array
  92. description: Contacts
  93. items:
  94. type: object
  95. properties:
  96. identity:
  97. type: string
  98. description: Threema ID
  99. minLength: 8
  100. maxLength: 8
  101. pattern: '[0-9A-Z\*][0-9A-Z]{7}'
  102. examples:
  103. - ECHOECHO
  104. publickey:
  105. type: string
  106. description: |-
  107. Base64 encoded public key. Required for contacts with a verification
  108. level 2 and for revoked contacts.
  109. examples:
  110. - ZWNob2VjaG9lY2hvZWNob2VjaG9lY2hvZWNob2VjaG8=
  111. createdAt:
  112. type: integer
  113. description: |-
  114. When this contact was added, unix-ish timestamp in milliseconds.
  115. minimum: 0
  116. maximum: 18446744073709552000
  117. examples:
  118. - 1524489122916
  119. verification:
  120. type: integer
  121. description: The verification level
  122. anyOf:
  123. - title: Unverified
  124. const: 0
  125. - title: Server verified
  126. const: 1
  127. - title: Fully verified
  128. const: 2
  129. - {}
  130. workVerified:
  131. type: boolean
  132. description:
  133. Whether this contact was verified by the Threema Work admin
  134. default: false
  135. hidden:
  136. type: boolean
  137. description: |-
  138. Whether the contact is directly acquainted and should be visible
  139. (false) or the contact was introduced by a group and should be
  140. hidden until a direct conversation has been initiated (true)
  141. default: false
  142. firstname:
  143. type: string
  144. description: First name
  145. default: ''
  146. examples:
  147. - Peter
  148. lastname:
  149. type: string
  150. description: Last name
  151. default: ''
  152. examples:
  153. - Muster
  154. nickname:
  155. type: string
  156. description: Nickname without ~ prefix
  157. default: ''
  158. examples:
  159. - pete
  160. lastUpdate:
  161. type:
  162. - integer
  163. - 'null'
  164. description: |-
  165. When the conversation with this contact was last updated, unix-ish
  166. timestamp in milliseconds (or null)
  167. default: null
  168. minimum: 0
  169. maximum: 18446744073709552000
  170. examples:
  171. - 1524489122916
  172. - null
  173. private:
  174. type: boolean
  175. description: |-
  176. Whether the conversation with this contact should be protected
  177. (_private chat_)
  178. default: 'false'
  179. readReceipts:
  180. type: integer
  181. description: Whether to send read receipts
  182. anyOf:
  183. - title: Apply default
  184. const: 0
  185. - title: Send
  186. const: 1
  187. - title: Don't send
  188. const: 2
  189. - {}
  190. typingIndicators:
  191. type: integer
  192. description: Whether to send typing indicators
  193. anyOf:
  194. - title: Apply default
  195. const: 0
  196. - title: Send
  197. const: 1
  198. - title: Don't send
  199. const: 2
  200. - {}
  201. required:
  202. - identity
  203. - verification
  204. groups:
  205. type: array
  206. items:
  207. type: object
  208. properties:
  209. id:
  210. type: string
  211. description: |-
  212. Unique group identity (8 bytes represented as a lowercase hex
  213. string)
  214. examples:
  215. - 0123456789abcdef
  216. creator:
  217. type: string
  218. description: The group creator's Threema ID
  219. minLength: 8
  220. maxLength: 8
  221. pattern: '[0-9A-Z\*][0-9A-Z]{7}'
  222. examples:
  223. - ECHOECHO
  224. groupname:
  225. type: string
  226. description: Group name
  227. examples:
  228. - Foodies
  229. createdAt:
  230. type: integer
  231. description: |-
  232. When the group has been created locally, unix-ish timestamp in
  233. milliseconds
  234. minimum: 0
  235. maximum: 18446744073709552000
  236. examples:
  237. - 1459269133488
  238. members:
  239. type: array
  240. description: |-
  241. Group members. If the list does not include the user itself, the
  242. group is marked as _left_. Should be empty if `deleted=true`.
  243. items:
  244. type: string
  245. description: Threema ID
  246. minLength: 8
  247. maxLength: 8
  248. pattern: '[0-9A-Z\*][0-9A-Z]{7}'
  249. examples:
  250. - ECHOECHO
  251. deleted:
  252. type: boolean
  253. description: |-
  254. Whether the group has been deleted. In case this is set to `true`,
  255. the list of members must be ignored.
  256. lastUpdate:
  257. type:
  258. - integer
  259. - 'null'
  260. description: |-
  261. When the conversation with this group was last updated, unix-ish
  262. timestamp in milliseconds (or null)
  263. default: null
  264. minimum: 0
  265. maximum: 18446744073709552000
  266. examples:
  267. - 1524489122916
  268. - null
  269. private:
  270. type: boolean
  271. description: |-
  272. Whether the conversation with this group should be protected
  273. (_private chat_)
  274. default: 'false'
  275. required:
  276. - id
  277. - creator
  278. - members
  279. - deleted
  280. distributionlists:
  281. type: array
  282. items:
  283. type: object
  284. properties:
  285. id:
  286. type: string
  287. description: |-
  288. Unique ID of the distribution list (8 bytes represented as a
  289. lowercase hex string)
  290. examples:
  291. - 0102030405060708
  292. name:
  293. type: string
  294. description: Distribution list name
  295. examples:
  296. - Friends
  297. createdAt:
  298. type: integer
  299. description: |-
  300. When the distribution list has been created locally, unix-ish
  301. timestamp in milliseconds
  302. minimum: 0
  303. maximum: 18446744073709552000
  304. examples:
  305. - 1459269133488
  306. members:
  307. type: array
  308. description: Distribution list members
  309. items:
  310. type: string
  311. description: Threema ID
  312. minLength: 8
  313. maxLength: 8
  314. pattern: '[0-9A-Z\*][0-9A-Z]{7}'
  315. examples:
  316. - ECHOECHO
  317. lastUpdate:
  318. type:
  319. - integer
  320. - 'null'
  321. description: |-
  322. When the conversation with this distribution list was last updated,
  323. unix-ish timestamp in milliseconds (or null)
  324. default: null
  325. minimum: 0
  326. maximum: 18446744073709552000
  327. examples:
  328. - 1524489122916
  329. - null
  330. private:
  331. type: boolean
  332. description: |-
  333. Whether the conversation of this distribution list should be
  334. protected (_private chat_)
  335. default: 'false'
  336. required:
  337. - name
  338. - members
  339. settings:
  340. type: object
  341. properties:
  342. syncContacts:
  343. type: boolean
  344. default: false
  345. blockUnknown:
  346. type: boolean
  347. default: false
  348. readReceipts:
  349. type: boolean
  350. default: true
  351. sendTyping:
  352. type: boolean
  353. default: true
  354. threemaCalls:
  355. type: boolean
  356. default: true
  357. relayThreemaCalls:
  358. type: boolean
  359. default: false
  360. disableScreenshots:
  361. type: boolean
  362. default: false
  363. incognitoKeyboard:
  364. type: boolean
  365. default: false
  366. blockedContacts:
  367. type: array
  368. description: Array of blocked Threema IDs
  369. items:
  370. type: string
  371. description: Threema ID
  372. minLength: 8
  373. maxLength: 8
  374. pattern: '[0-9A-Z\*][0-9A-Z]{7}'
  375. examples:
  376. - ECHOECHO
  377. syncExcludedIds:
  378. type: array
  379. description: Array of Threema IDs excluded from synchronization
  380. items:
  381. type: string
  382. description: Threema ID
  383. minLength: 8
  384. maxLength: 8
  385. pattern: '[0-9A-Z\*][0-9A-Z]{7}'
  386. examples:
  387. - ECHOECHO
  388. recentEmojis:
  389. type: array
  390. description: Array of recently used emoji (UTF8 encoded)
  391. items:
  392. type: string
  393. description: Emoji bytes
  394. examples:
  395. - 🐱
  396. required:
  397. - syncContacts
  398. required:
  399. - info
  400. - user
  401. - settings