directory.openapi.yml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041
  1. .references:
  2. work-servers: &work-servers
  3. - url: https://ds-apip-work.threema.ch
  4. description: Production server
  5. - url: https://ds-apip-work.test.threema.ch
  6. description: Sandbox server
  7. base64: &base64
  8. type: string
  9. format: byte
  10. u64: &u64
  11. type: integer
  12. minimum: 0
  13. maximum: 18446744073709551615
  14. identity: &identity
  15. description: A Threema ID.
  16. type: string
  17. minLength: 8
  18. maxLength: 8
  19. pattern: ^[0-9A-Z*]{1}[0-9A-Z]{7}$
  20. example: ECHOECHO
  21. public-key: &public-key
  22. <<: *base64
  23. description: Public Key (32 bytes, base64) associated to a Threema ID.
  24. example: ZWNob2VjaG9lY2hvZWNob2VjaG9lY2hvZWNob2VjaG8=
  25. app-version: &app-version
  26. description: |-
  27. App version. This is the CSP `client-info` but with the following special postfix:
  28. 1. If at least one Threema-MDM parameter and at least one external MDM parameter is active, append `;me`
  29. 2. If at least one Threema-MDM parameter is active, append `;m`
  30. 3. If at least one external MDM parameter is active, append `;e`
  31. 4. If no MDM parameter is active, don't append. (A lone `;` is also acceptable.)
  32. type: string
  33. minLength: 1
  34. example: 1.2.3;Q;de/DE;...
  35. work-username: &work-username
  36. description: Work license username.
  37. type: string
  38. minLength: 1
  39. example: echoecho@threema.ch
  40. work-password: &work-password
  41. description: Work license password.
  42. type: string
  43. minLength: 1
  44. example: super-secret-password
  45. work-nickname: &work-nickname
  46. description: |-
  47. User's nickname sourced from the MDM parameter `th_nickname`. Empty is
  48. equivalent to unset.
  49. type: string
  50. example: personal-🦜
  51. work-first-name: &work-first-name
  52. description: |-
  53. User's first name sourced from the MDM parameter `th_firstname`. Empty is
  54. equivalent to unset.
  55. type: string
  56. example: Aria
  57. work-last-name: &work-last-name
  58. description: |-
  59. User's last name sourced from the MDM parameter `th_lastname`. Empty is
  60. equivalent to unset.
  61. type: string
  62. example: Reverb
  63. work-user-identifier: &work-user-identifier
  64. description: |-
  65. Custom unique identifier of the user (e.g. employee number), sourced from
  66. the MDM parameter `th_csi`. Also known as _Customer Specific Identifier_.
  67. Empty is equivalent to unset.
  68. type: string
  69. work-job-title: &work-job-title
  70. description: |-
  71. Job title of the user, sourced from the MDM parameter `th_job_title`.
  72. Empty is equivalent to unset.
  73. type: string
  74. work-department: &work-department
  75. description: |-
  76. Department the user is working in, sourced from the MDM parameter
  77. `th_department`. Empty is equivalent to unset.
  78. type: string
  79. work-user-category-labels-delimited: &work-user-category-labels-delimited
  80. description: |-
  81. Custom category labels assigned to the user (e.g. building name, room
  82. number), sourced from the MDM parameter `th_category`. Empty is equivalent
  83. to unset.
  84. Note: For compatibility with the app configuration parameter
  85. `th_category`, this is the delimited variant with the category label
  86. separated by the category delimiter (`,` by default).
  87. type: string
  88. example: Building 1, Room 337
  89. work-user-category-id: &work-user-category-id
  90. description: A custom category ID.
  91. type: string
  92. minLength: 1
  93. example: 'jNekOWhQ8B'
  94. work-user-category-ids: &work-user-category-ids
  95. description: |-
  96. Custom category IDs of the user (e.g. mapping to a corresponding label
  97. such as building name or room number), chosen by the Work subscription
  98. administrator.
  99. type: array
  100. items: *work-user-category-id
  101. example:
  102. - '1'
  103. - 'jNekOWhQ8B'
  104. work-contacts-match: &work-contacts-match
  105. type: array
  106. items: *identity
  107. example:
  108. - ECHOECHO
  109. - '*SUPPORT'
  110. work-contact: &work-contact
  111. type: object
  112. required:
  113. - id
  114. - pk
  115. properties:
  116. id: *identity
  117. pk: *public-key
  118. first:
  119. <<: *work-first-name
  120. type:
  121. - string
  122. - 'null'
  123. last:
  124. <<: *work-last-name
  125. type:
  126. - string
  127. - 'null'
  128. jobTitle: *work-job-title
  129. department: *work-department
  130. work-organisation: &work-organisation
  131. type: object
  132. required:
  133. - name
  134. properties:
  135. name:
  136. description: |-
  137. Optional name of the organisation, translated by the `Accept-Language`
  138. header (if provided).
  139. type:
  140. - string
  141. - 'null'
  142. work-directory-page-index: &work-directory-page-index
  143. description: Page index.
  144. type: integer
  145. minimum: 0
  146. work-directory-sort: &work-directory-sort
  147. type: object
  148. properties:
  149. by:
  150. description: The sort key applied to the resulting contacts.
  151. type: string
  152. anyOf:
  153. - title: First name
  154. const: firstName
  155. - title: Last name
  156. const: lastName
  157. - {}
  158. default: firstName
  159. asc:
  160. description: |-
  161. Sort contacts ascending by `by` if `true`, sort descending if `false`.
  162. type: boolean
  163. default: true
  164. auth-challenge-request: &auth-challenge-request
  165. description: Authentication required.
  166. type: object
  167. required:
  168. - token
  169. - tokenRespKeyPub
  170. properties:
  171. token:
  172. <<: *base64
  173. description: An arbitrary challenge token (base64) to be _signed_.
  174. tokenRespKeyPub:
  175. <<: *base64
  176. description: |-
  177. The ephemeral public key (EPK, 32 bytes, base64) to derive a shared
  178. secret for solving the challenge.
  179. auth-challenge-response: &auth-challenge-response
  180. type: object
  181. required:
  182. - token
  183. - response
  184. properties:
  185. token:
  186. <<: *base64
  187. description: The token of the challenge request (base64).
  188. response:
  189. <<: *base64
  190. description: |-
  191. The token of the challenge request, _signed_ in the following way:
  192. ```text
  193. base64(
  194. BLAKE2b(
  195. key=BLAKE2b(
  196. key=X25519HSalsa20(CK.secret, EPK.public),
  197. salt='dir',
  198. personal='3ma-csp',
  199. ),
  200. input=<token>
  201. )
  202. )
  203. ```
  204. blob-credentials-request: &blob-credentials-request
  205. type: object
  206. required:
  207. - identity
  208. properties:
  209. identity: *identity
  210. blob-credentials-response:
  211. ok: &blob-credentials-response-ok
  212. description: |-
  213. Blob server authentication credentials retrieved successfully.
  214. type: object
  215. required:
  216. - success
  217. - token
  218. - expiration
  219. properties:
  220. success:
  221. type: boolean
  222. const: true
  223. token:
  224. description: |-
  225. An opaque token used to authenticate against the blob server.
  226. HTTP requests towards the the blob server must include it as a
  227. header in the following way: `Authorization: ThreemaBlobToken
  228. <token>`
  229. type: string
  230. expiration:
  231. <<: *u64
  232. description: |-
  233. Amount of seconds until the token expires and must be discarded.
  234. example:
  235. success: true
  236. token: givemeaccessplz
  237. expiration: 600
  238. error: &blob-credentials-response-error
  239. description: |-
  240. Blob server authentication credentials could not be retrieved.
  241. type: object
  242. required:
  243. - success
  244. properties:
  245. success:
  246. type: boolean
  247. const: false
  248. error:
  249. type: string
  250. example:
  251. sucess: false
  252. error: 'Identity not found'
  253. id-revocation-request: &id-revocation-request
  254. type: object
  255. required:
  256. - identity
  257. properties:
  258. identity: *identity
  259. id-revocation-key-v1: &id-revocation-key-v1
  260. <<: *base64
  261. minLength: 8
  262. maxLength: 8
  263. description: |-
  264. A legacy (v1) identity revocation key.
  265. The revocation key is computed as follows (`[:4]` denotes the first four bytes):
  266. ```text
  267. base64(
  268. SHA256(revocation-password)[:4]
  269. )
  270. ```
  271. id-revocation-request-v1: &id-revocation-request-v1
  272. type: object
  273. required:
  274. - identity
  275. - revocationKey
  276. properties:
  277. identity: *identity
  278. revocationKey: *id-revocation-key-v1
  279. id-revocation-key-check-response:
  280. found: &id-revocation-key-check-response-found
  281. description: 'ID revocation key was set'
  282. required:
  283. - revocationKeySet
  284. - lastChanged
  285. properties:
  286. revocationKeySet:
  287. type: boolean
  288. const: true
  289. lastChanged:
  290. type: string
  291. format: date-time
  292. example:
  293. revocationKeySet: true
  294. lastChanged: '2014-10-29T12:32:54Z'
  295. empty: &id-revocation-key-check-response-empty
  296. description: 'ID revocation key was not set'
  297. required:
  298. - revocationKeySet
  299. properties:
  300. revocationKeySet:
  301. type: boolean
  302. const: false
  303. id-revocation-response:
  304. ok: &id-revocation-response-ok
  305. description: 'ID revocation key request was successful'
  306. type: object
  307. required:
  308. - success
  309. properties:
  310. success:
  311. type: boolean
  312. const: true
  313. error: &id-revocation-response-error
  314. description: 'ID revocation key was not successful'
  315. type: object
  316. required:
  317. - success
  318. properties:
  319. success:
  320. type: boolean
  321. const: false
  322. error:
  323. type: string
  324. example:
  325. sucess: false
  326. error: 'Identity not found'
  327. sfu-credentials-request: &sfu-credentials-request
  328. type: object
  329. required:
  330. - identity
  331. properties:
  332. identity: *identity
  333. sfu-credentials-response:
  334. ok: &sfu-credentials-response-ok
  335. description: SFU information retrieved successfully.
  336. type: object
  337. required:
  338. - success
  339. - sfuBaseUrl
  340. - allowedSfuHostnameSuffixes
  341. - sfuToken
  342. - expiration
  343. properties:
  344. success:
  345. type: boolean
  346. const: true
  347. sfuBaseUrl:
  348. description: |-
  349. Base URL used to create and distribute new calls.
  350. type: string
  351. allowedSfuHostnameSuffixes:
  352. description: |-
  353. A set of allowed hostname suffixes to be applied against a _SFU
  354. Base URL_ when joining calls.
  355. If the provided _SFU Base URL_'s hostname does not end with one of
  356. the provided hostname suffixes, joining or peeking that call is
  357. disallowed.
  358. type: array
  359. items:
  360. type: string
  361. sfuToken:
  362. description: |-
  363. An opaque token used to authenticate against a SFU.
  364. HTTP requests towards the SFU must include it as a header in the
  365. following way: `Authorization: ThreemaSfuToken <token>`
  366. type: string
  367. expiration:
  368. <<: *u64
  369. description: |-
  370. Amount of seconds until the SFU information is considered stale and
  371. must be discarded.
  372. example:
  373. success: true
  374. sfuBaseUrl: https://sfu.threema.ch
  375. allowedSfuHostnameSuffixes:
  376. - threema.ch
  377. sfuToken: givemeaccessplz
  378. expiration: 600
  379. error: &sfu-credentials-response-error
  380. description: SFU information could not be retrieved.
  381. type: object
  382. required:
  383. - success
  384. properties:
  385. success:
  386. type: boolean
  387. const: false
  388. error:
  389. type: string
  390. example:
  391. sucess: false
  392. error: 'Identity not found'
  393. update-work-data-request: &update-work-data-request
  394. type: object
  395. required:
  396. - identity
  397. - licenseUsername
  398. - licensePassword
  399. - version
  400. properties:
  401. identity: *identity
  402. licenseUsername: *work-username
  403. licensePassword: *work-password
  404. version: *app-version
  405. publicNickname: *work-nickname
  406. firstName: *work-first-name
  407. lastName: *work-last-name
  408. csi: *work-user-identifier
  409. jobTitle: *work-job-title
  410. department: *work-department
  411. category: *work-user-category-labels-delimited
  412. update-work-data-response:
  413. ok: &update-work-data-response-ok
  414. description: Work data updated successfully.
  415. type: object
  416. required:
  417. - success
  418. properties:
  419. success:
  420. type: boolean
  421. const: true
  422. error: &update-work-data-response-error
  423. description: Updating Work data failed.
  424. type: object
  425. required:
  426. - success
  427. properties:
  428. success:
  429. type: boolean
  430. const: false
  431. error:
  432. type: string
  433. example:
  434. sucess: false
  435. error: 'Missing parameters'
  436. work-auth: &work-auth
  437. type: object
  438. required:
  439. - username
  440. - password
  441. properties:
  442. username: *work-username
  443. password: *work-password
  444. sync-work-data-request: &sync-work-data-request
  445. type: object
  446. required:
  447. - contacts
  448. properties:
  449. contacts:
  450. <<: *work-contacts-match
  451. description: |-
  452. A list of all existing contacts of the user to match against the Work
  453. subscription.
  454. Note: This is necessary to determine whether a contact is part of the
  455. user's Work subscription and, in that case, get additional
  456. information.
  457. Note 2: Explicitly providing all of the user's contacts also prevents
  458. having to configure **all** Work contacts of the same subscription.
  459. sync-work-data-response: &sync-work-data-response
  460. type: object
  461. required:
  462. - checkInterval
  463. - org
  464. - logo
  465. - support
  466. - directory
  467. - mdm
  468. - contacts
  469. properties:
  470. checkInterval:
  471. <<: *u64
  472. description: |-
  473. Target amount of seconds until a subsequent Work sync should be
  474. initiated.
  475. org: *work-organisation
  476. logo:
  477. description: Logo to be displayed in the app.
  478. type: object
  479. required:
  480. - light
  481. - dark
  482. properties:
  483. light: &work-logo-url
  484. description: |-
  485. Optional URL to a logo to be displayed in the app. The logo must
  486. be provided in PNG format.
  487. type:
  488. - string
  489. - 'null'
  490. dark: *work-logo-url
  491. support:
  492. description: Optional custom in-app support base URL.
  493. type:
  494. - string
  495. - 'null'
  496. directory:
  497. oneOf:
  498. - description: Disabled Work directory.
  499. type: object
  500. required:
  501. - enabled
  502. properties:
  503. enabled:
  504. type: boolean
  505. const: false
  506. - description: Enabled Work directory.
  507. type: object
  508. required:
  509. - enabled
  510. - cat
  511. properties:
  512. enabled:
  513. type: boolean
  514. const: true
  515. cat:
  516. description: |-
  517. Map of contact category IDs to their respective label.
  518. type: object
  519. additionalProperties: *work-user-category-id
  520. mdm:
  521. description: App configuration to be applied.
  522. type: object
  523. required:
  524. - override
  525. - params
  526. properties:
  527. override:
  528. description: |-
  529. Whether the app configuration parameters provided here take
  530. precedence over the the externally configured MDM parameters.
  531. type: boolean
  532. params:
  533. description: |-
  534. A key/value map of app configuration / MDM parameters as defined
  535. by the protocol.
  536. type: object
  537. additionalProperties:
  538. oneOf:
  539. - type: string
  540. - *u64
  541. - type: boolean
  542. contacts:
  543. description: |-
  544. A list of contacts from the same Work subscription to be configured
  545. on the user's device.
  546. type: array
  547. items:
  548. <<: *work-contact
  549. description: A configured Work contact.
  550. work-contacts-request: &work-contacts-request
  551. type: object
  552. required:
  553. - contacts
  554. properties:
  555. contacts:
  556. <<: *work-contacts-match
  557. description: |-
  558. A list of contacts (Threema IDs) to get additional Work properties for.
  559. Note: This is necessary to determine whether a contact is part of the
  560. user's Work subscription and, in that case, get additional
  561. information.
  562. work-contacts-response: &work-contacts-response
  563. type: object
  564. required:
  565. - contacts
  566. properties:
  567. contacts:
  568. description: |-
  569. A subset of the provided contacts that are part of the same Work
  570. subscription with the associated additional Work properties.
  571. type: array
  572. items:
  573. <<: *work-contact
  574. description: A Work contact.
  575. work-directory-request-wildcard: &work-directory-request-wildcard
  576. type: object
  577. required:
  578. - query
  579. - page
  580. - cateogries
  581. properties:
  582. identity:
  583. <<: *identity
  584. description: The user's Threema ID.
  585. page: *work-directory-page-index
  586. query:
  587. description: Wildcard search query.
  588. type: string
  589. const: '*'
  590. categories:
  591. <<: *work-user-category-ids
  592. description: At least one category ID to narrow down the search with.
  593. minLength: 1
  594. sort: *work-directory-sort
  595. work-directory-request-specific: &work-directory-request-specific
  596. type: object
  597. required:
  598. - query
  599. - page
  600. properties:
  601. identity:
  602. <<: *identity
  603. description: The user's Threema ID.
  604. page: *work-directory-page-index
  605. query:
  606. description: |-
  607. Search query. Matches any of Threema ID, first name, or last name.
  608. type: string
  609. minLength: 3
  610. example: Bob
  611. categories:
  612. <<: *work-user-category-ids
  613. description: Optional category IDs to narrow down the search with.
  614. sort: *work-directory-sort
  615. work-directory-response: &work-directory-response
  616. type: object
  617. required:
  618. - contacts
  619. - paging
  620. properties:
  621. paging:
  622. description: Page information.
  623. type: object
  624. required:
  625. - size
  626. - total
  627. properties:
  628. size:
  629. description: Maximum amount of results present in a single page.
  630. type: integer
  631. minimum: 0
  632. total:
  633. description: Total amount of results (spread across pages).
  634. type: integer
  635. minimum: 0
  636. prev:
  637. description: Previous page index, if any is available.
  638. type: integer
  639. minimum: 0
  640. next:
  641. description: Next page index, if any is available.
  642. type: integer
  643. minimum: 1
  644. contacts:
  645. description: |-
  646. A Work contact of the same subcription that matches the search query.
  647. type: array
  648. items: !merge-objects
  649. - *work-contact
  650. - type: object
  651. required:
  652. - org
  653. properties:
  654. csi: *work-user-identifier
  655. cat: *work-user-category-ids
  656. org: *work-organisation
  657. openapi: 3.1.0
  658. info:
  659. title: Directory and Work Sync Server API
  660. description: |-
  661. Maintains the directory of allocated Threema IDs and all associated
  662. properties.
  663. version: 1.0.0
  664. servers:
  665. - url: https://ds-apip.threema.ch
  666. description: Production server
  667. - url: https://ds-apip.test.threema.ch
  668. description: Sandbox server
  669. paths:
  670. /identity/blob_cred:
  671. post:
  672. summary: Blob Server Credentials
  673. description: |-
  674. Retrieve blob server authentication credentials.
  675. The first call without the challenge response properties initiates the
  676. challenge request. The second call must repeat the exact same properties
  677. and the challenge response.
  678. requestBody:
  679. required: true
  680. content:
  681. application/json:
  682. schema:
  683. oneOf:
  684. - *blob-credentials-request
  685. - !merge-objects
  686. - *auth-challenge-response
  687. - *blob-credentials-request
  688. responses:
  689. '200':
  690. description: Success... or not.
  691. content:
  692. application/json:
  693. schema:
  694. oneOf:
  695. - *auth-challenge-request
  696. - *blob-credentials-response-ok
  697. - *blob-credentials-response-error
  698. '429':
  699. description: Rate limit exceeded.
  700. /identity/revoke:
  701. post:
  702. summary: ID Revocation by Client Key
  703. description: |-
  704. Revoke a Threema ID by proofing the knowledge of the client key.
  705. The first call without the challenge response properties initiates the
  706. challenge request. The second call must repeat the exact same properties
  707. and the challenge response.
  708. requestBody:
  709. required: true
  710. content:
  711. application/json:
  712. schema:
  713. oneOf:
  714. - *id-revocation-request
  715. - !merge-objects
  716. - *id-revocation-request
  717. - *auth-challenge-response
  718. responses:
  719. '200':
  720. description: Success... or not.
  721. content:
  722. application/json:
  723. schema:
  724. oneOf:
  725. - *auth-challenge-request
  726. - *id-revocation-response-ok
  727. - *id-revocation-response-error
  728. /identity/set_revocation_key:
  729. post:
  730. summary: Set ID Revocation Key
  731. description: |-
  732. Set the revocation key for an identity.
  733. The first call without the challenge response properties initiates the
  734. challenge request. The second call must repeat the exact same properties
  735. and the challenge response.
  736. requestBody:
  737. required: true
  738. content:
  739. application/json:
  740. schema:
  741. oneOf:
  742. - *id-revocation-request-v1
  743. - !merge-objects
  744. - *id-revocation-request-v1
  745. - *auth-challenge-response
  746. responses:
  747. '200':
  748. description: Success... or not.
  749. content:
  750. application/json:
  751. schema:
  752. oneOf:
  753. - *auth-challenge-request
  754. - *id-revocation-response-ok
  755. - *id-revocation-response-error
  756. /identity/check_revocation_key:
  757. post:
  758. summary: Check ID Revocation Key
  759. description: |-
  760. Check whether a revocation key is set for a given ID
  761. The first call without the challenge response properties initiates the
  762. challenge request. The second call must repeat the exact same properties
  763. and the challenge response.
  764. requestBody:
  765. required: true
  766. content:
  767. application/json:
  768. schema:
  769. oneOf:
  770. - *id-revocation-request
  771. - !merge-objects
  772. - *id-revocation-request-v1
  773. - *auth-challenge-response
  774. responses:
  775. '200':
  776. description: Success... or not.
  777. content:
  778. application/json:
  779. schema:
  780. oneOf:
  781. - *auth-challenge-request
  782. - *id-revocation-response-error
  783. - *id-revocation-key-check-response-found
  784. - *id-revocation-key-check-response-empty
  785. /identity/ws/revoke:
  786. post:
  787. summary: ID Revocation by User-set Key
  788. description:
  789. Revoke a Threema ID with a user-set key previously derived from a
  790. password.
  791. requestBody:
  792. required: true
  793. content:
  794. application/json:
  795. schema:
  796. oneOf:
  797. - *id-revocation-request-v1
  798. responses:
  799. '200':
  800. description: Success... or not.
  801. content:
  802. application/json:
  803. schema:
  804. oneOf:
  805. - *id-revocation-response-ok
  806. - *id-revocation-response-error
  807. /identity/sfu_cred:
  808. post:
  809. summary: SFU Information
  810. description: |-
  811. Retrieve SFU information including URLs and authentication credentials.
  812. The first call without the challenge response properties initiates the
  813. challenge request. The second call must repeat the exact same properties
  814. and the challenge response.
  815. requestBody:
  816. required: true
  817. content:
  818. application/json:
  819. schema:
  820. oneOf:
  821. - *sfu-credentials-request
  822. - !merge-objects
  823. - *auth-challenge-response
  824. - *sfu-credentials-request
  825. responses:
  826. '200':
  827. description: Success... or not.
  828. content:
  829. application/json:
  830. schema:
  831. oneOf:
  832. - *auth-challenge-request
  833. - *sfu-credentials-response-ok
  834. - *sfu-credentials-response-error
  835. '429':
  836. description: Rate limit exceeded.
  837. /identity/update_work_info:
  838. post:
  839. summary: Work Properties
  840. description: |-
  841. Update Work properties associated to the currently used Threema ID. Only
  842. used by the _Work_ flavour of Threema.
  843. The first call without the challenge response properties initiates the
  844. challenge request. The second call must repeat the exact same properties
  845. and the challenge response.
  846. Note that all data of the request must be sourced **exclusively** from
  847. MDM parameters. For example, the data source for `nickname` must be
  848. `th_nickname` and not the custom nickname chosen by the user.
  849. TODO(SE-368): When sending/receiving steps.
  850. requestBody:
  851. required: true
  852. content:
  853. application/json:
  854. schema:
  855. oneOf:
  856. - *update-work-data-request
  857. - !merge-objects
  858. - *auth-challenge-response
  859. - *update-work-data-request
  860. responses:
  861. '200':
  862. description: Success... or not.
  863. content:
  864. application/json:
  865. schema:
  866. oneOf:
  867. - *auth-challenge-request
  868. - *update-work-data-response-ok
  869. - *update-work-data-response-error
  870. '429':
  871. description: Rate limit exceeded.
  872. /fetch2:
  873. post:
  874. summary: Work Sync
  875. description: |-
  876. Full sync of all data associated to the Work subscription. Only used by
  877. the _Work_ flavour of Threema.
  878. TODO(SE-368): When sending/receiving steps.
  879. servers: *work-servers
  880. requestBody:
  881. required: true
  882. content:
  883. application/json:
  884. schema: !merge-objects
  885. - *work-auth
  886. - *sync-work-data-request
  887. responses:
  888. '200':
  889. description: Work subscription data.
  890. content:
  891. application/json:
  892. schema: *sync-work-data-response
  893. '400':
  894. description: Invalid request.
  895. '401':
  896. description: Invalid username or password.
  897. '429':
  898. description: Rate limit exceeded.
  899. /identities:
  900. post:
  901. summary: Work Contacts
  902. description: |-
  903. Request properties associated to a contact of the same Work subscription.
  904. Note: This endpoint is currently buggy. See TWRK-1633 for a list of bugs.
  905. TODO(SE-368): When sending/receiving steps. Send before adding a new
  906. contact.
  907. servers: *work-servers
  908. requestBody:
  909. required: true
  910. content:
  911. application/json:
  912. schema: !merge-objects
  913. - *work-auth
  914. - *work-contacts-request
  915. responses:
  916. '200':
  917. description: Matching Work contacts in the same Work subscription.
  918. content:
  919. application/json:
  920. schema: *work-contacts-response
  921. '400':
  922. description: Invalid request.
  923. '401':
  924. description: Invalid username or password.
  925. '429':
  926. description: Rate limit exceeded.
  927. /directory:
  928. post:
  929. summary: Work Directory
  930. description: |-
  931. Search for contacts in the same Work subscription as the user.
  932. TODO(SE-368): When sending/receiving steps.
  933. servers: *work-servers
  934. requestBody:
  935. required: true
  936. content:
  937. application/json:
  938. schema:
  939. oneOf:
  940. - !merge-objects
  941. - *work-auth
  942. - *work-directory-request-wildcard
  943. - !merge-objects
  944. - *work-auth
  945. - *work-directory-request-specific
  946. responses:
  947. '200':
  948. description: Queried Work contacts of the same Work subscription.
  949. content:
  950. application/json:
  951. schema: *work-directory-response
  952. '400':
  953. description: Invalid request.
  954. '401':
  955. description: Invalid username or password.
  956. '429':
  957. description: Rate limit exceeded.