safe-backup.schema.yml 11 KB

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