idnits 2.17.1 draft-ietf-jmap-core-16.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 2 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 8, 2019) is 1876 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'RFC5246' is mentioned on line 2964, but not defined ** Obsolete undefined reference: RFC 5246 (Obsoleted by RFC 8446) -- Possible downref: Non-RFC (?) normative reference: ref. 'EventSource' == Outdated reference: A later version (-17) exists of draft-ietf-jmap-core-14 ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 5785 (Obsoleted by RFC 8615) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7525 (Obsoleted by RFC 9325) ** Obsolete normative reference: RFC 7807 (Obsoleted by RFC 9457) Summary: 8 errors (**), 0 flaws (~~), 3 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 JMAP N. Jenkins 3 Internet-Draft FastMail 4 Intended status: Standards Track C. Newman 5 Expires: September 9, 2019 Oracle 6 March 8, 2019 8 JSON Meta Application Protocol 9 draft-ietf-jmap-core-16 11 Abstract 13 This document specifies a protocol for clients to efficiently query, 14 fetch and modify JSON-based data objects, with support for push 15 notification of changes and fast resynchronisation, and out-of-band 16 binary data upload/download. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at https://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on September 9, 2019. 35 Copyright Notice 37 Copyright (c) 2019 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (https://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 53 1.1. Notational conventions . . . . . . . . . . . . . . . . . 4 54 1.2. The Id data type . . . . . . . . . . . . . . . . . . . . 5 55 1.3. The Int and UnsignedInt data types . . . . . . . . . . . 6 56 1.4. The Date and UTCDate data types . . . . . . . . . . . . . 6 57 1.5. JSON as the data encoding format . . . . . . . . . . . . 6 58 1.6. Terminology . . . . . . . . . . . . . . . . . . . . . . . 7 59 1.6.1. User . . . . . . . . . . . . . . . . . . . . . . . . 7 60 1.6.2. Accounts . . . . . . . . . . . . . . . . . . . . . . 7 61 1.6.3. Data types and records . . . . . . . . . . . . . . . 7 62 1.7. The JMAP API model . . . . . . . . . . . . . . . . . . . 8 63 1.8. Vendor-specific extensions . . . . . . . . . . . . . . . 8 64 2. The JMAP Session resource . . . . . . . . . . . . . . . . . . 9 65 2.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . 12 66 2.2. Service autodiscovery . . . . . . . . . . . . . . . . . . 14 67 3. Structured data exchange . . . . . . . . . . . . . . . . . . 14 68 3.1. Making an API request . . . . . . . . . . . . . . . . . . 14 69 3.1.1. The Invocation data type . . . . . . . . . . . . . . 14 70 3.2. The Request object . . . . . . . . . . . . . . . . . . . 15 71 3.2.1. Example request . . . . . . . . . . . . . . . . . . . 16 72 3.3. The Response object . . . . . . . . . . . . . . . . . . . 16 73 3.3.1. Example response: . . . . . . . . . . . . . . . . . . 17 74 3.4. Omitting arguments . . . . . . . . . . . . . . . . . . . 17 75 3.5. Errors . . . . . . . . . . . . . . . . . . . . . . . . . 17 76 3.5.1. Request-level errors . . . . . . . . . . . . . . . . 18 77 3.5.2. Method-level errors . . . . . . . . . . . . . . . . . 19 78 3.6. References to previous method results . . . . . . . . . . 20 79 3.7. Localisation of user-visible strings . . . . . . . . . . 25 80 3.8. Security . . . . . . . . . . . . . . . . . . . . . . . . 26 81 3.9. Concurrency . . . . . . . . . . . . . . . . . . . . . . . 26 82 4. The Core/echo method . . . . . . . . . . . . . . . . . . . . 26 83 4.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . 26 84 5. Standard methods and naming convention . . . . . . . . . . . 26 85 5.1. /get . . . . . . . . . . . . . . . . . . . . . . . . . . 27 86 5.2. /changes . . . . . . . . . . . . . . . . . . . . . . . . 28 87 5.3. /set . . . . . . . . . . . . . . . . . . . . . . . . . . 30 88 5.4. /copy . . . . . . . . . . . . . . . . . . . . . . . . . . 35 89 5.5. /query . . . . . . . . . . . . . . . . . . . . . . . . . 38 90 5.6. /queryChanges . . . . . . . . . . . . . . . . . . . . . . 42 91 5.7. Examples . . . . . . . . . . . . . . . . . . . . . . . . 45 92 5.8. Proxy considerations . . . . . . . . . . . . . . . . . . 51 93 6. Binary data . . . . . . . . . . . . . . . . . . . . . . . . . 52 94 6.1. Uploading binary data . . . . . . . . . . . . . . . . . . 53 95 6.2. Downloading binary data . . . . . . . . . . . . . . . . . 54 96 6.3. Blob/copy . . . . . . . . . . . . . . . . . . . . . . . . 54 97 7. Push . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 98 7.1. The StateChange object . . . . . . . . . . . . . . . . . 56 99 7.1.1. Example . . . . . . . . . . . . . . . . . . . . . . . 56 100 7.2. PushSubscription . . . . . . . . . . . . . . . . . . . . 57 101 7.2.1. PushSubscription/get . . . . . . . . . . . . . . . . 59 102 7.2.2. PushSubscription/set . . . . . . . . . . . . . . . . 59 103 7.2.3. Example . . . . . . . . . . . . . . . . . . . . . . . 60 104 7.3. Event Source . . . . . . . . . . . . . . . . . . . . . . 63 105 8. Security considerations . . . . . . . . . . . . . . . . . . . 64 106 8.1. Transport confidentiality . . . . . . . . . . . . . . . . 64 107 8.2. Authentication scheme . . . . . . . . . . . . . . . . . . 64 108 8.3. Service autodiscovery . . . . . . . . . . . . . . . . . . 65 109 8.4. JSON parsing . . . . . . . . . . . . . . . . . . . . . . 65 110 8.5. Denial of service . . . . . . . . . . . . . . . . . . . . 65 111 8.6. Connection to unknown push server . . . . . . . . . . . . 65 112 8.7. Push encryption . . . . . . . . . . . . . . . . . . . . . 66 113 8.8. Traffic analysis . . . . . . . . . . . . . . . . . . . . 66 114 9. IANA considerations . . . . . . . . . . . . . . . . . . . . . 67 115 9.1. Assignment of jmap service name . . . . . . . . . . . . . 67 116 9.2. Registration of well-known URI suffix for JMAP . . . . . 67 117 9.3. Registration of the jmap URN sub-namespace . . . . . . . 67 118 9.4. Creation of "JMAP Capabilities" registry . . . . . . . . 68 119 9.4.1. Preliminary community review . . . . . . . . . . . . 68 120 9.4.2. Submit request to IANA . . . . . . . . . . . . . . . 69 121 9.4.3. Designated expert review . . . . . . . . . . . . . . 69 122 9.4.4. Change procedures . . . . . . . . . . . . . . . . . . 69 123 9.4.5. JMAP Capabilities registry template: . . . . . . . . 70 124 9.4.6. Initial registration for JMAP core . . . . . . . . . 70 125 9.4.7. Registration for JMAP error placeholder in JMAP 126 capabilities registry . . . . . . . . . . . . . . . . 70 127 9.5. Creation of "JMAP Error Codes" registry . . . . . . . . . 70 128 9.5.1. Designated expert review . . . . . . . . . . . . . . 71 129 9.5.2. JMAP Error Codes registry template: . . . . . . . . . 71 130 9.5.3. Initial JMAP Error Codes registry . . . . . . . . . . 72 131 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 79 132 10.1. Normative References . . . . . . . . . . . . . . . . . . 79 133 10.2. Informative References . . . . . . . . . . . . . . . . . 83 134 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 83 136 1. Introduction 138 JMAP is a protocol for synchronising data, such as mail, calendars or 139 contacts, between a client and a server. It is optimised for mobile 140 and web environments, and aims to provide a consistent interface to 141 different data types. 143 This specification is for the generic mechanism of data 144 synchronisation. Further specifications define the data models for 145 different data types that may be synchronised via JMAP. 147 JMAP is designed to make efficient use of limited network resources. 148 Multiple API calls may be batched in a single request to the server, 149 reducing round trips and improving battery life on mobile devices. 150 Push connections remove the need for polling, and an efficient delta 151 update mechanism ensures a minimum of data is transferred. 153 JMAP is designed to be horizontally scalable to a very large number 154 of users. This is facilitated by separate end points for users after 155 login, the separation of binary and structured data, and a data model 156 for sharing that does not allow data dependencies between accounts. 158 1.1. Notational conventions 160 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 161 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 162 "OPTIONAL" in this document are to be interpreted as described in BCP 163 14 [RFC2119] [RFC8174] when, and only when, they appear in all 164 capitals, as shown here. 166 The underlying format used for this specification is JSON. 167 Consequently, the terms "object" and "array" as well as the four 168 primitive types (strings, numbers, booleans, and null) are to be 169 interpreted as described in section 1 of [RFC8259]. Unless otherwise 170 noted, all the property names and values are case sensitive. 172 Some examples in this document contain "partial" JSON documents used 173 for illustrative purposes. In these examples, three periods "..." 174 are used to indicate a portion of the document that has been removed 175 for compactness. 177 For compatibility with publishing requirements, line breaks have been 178 inserted inside long JSON strings, with the following continuation 179 lines indented. To form the valid JSON example, any line breaks 180 inside a string must be replaced with a space, and any other white- 181 space after the line break removed. 183 Unless otherwise specified, examples of API exchanges only show the 184 _methodCalls_ array of the Request object or the _methodResponses_ 185 array of the Response object. For compactness, the rest of the 186 Request/Response object is omitted. 188 Type signatures are given for all JSON values in this document. The 189 following conventions are used: 191 o "*" - The type is undefined (the value could be any type, although 192 permitted values may be constrained by the context of this value). 194 o "String" - The JSON string type. 196 o "Number" - The JSON number type. 198 o "Boolean" - The JSON boolean type. 200 o "A[B]" - A JSON object where the keys are all of type "A", and the 201 values are all of type "B". 203 o "A[]" - An array of values of type "A". 205 o "A|B" - The value is either of type "A" or of type "B". 207 Other types may also be given, with their representation defined 208 elsewhere in this document. 210 Object properties may also have a set of attributes defined along 211 with the type signature. These have the following meanings: 213 o *server-set*: Only the server can set the value for this property. 214 The client MUST NOT send this property when creating a new object 215 of this type. 217 o *immutable*: The value MUST NOT change after the object is 218 created. 220 o *default*: (This is followed by a JSON value). The value that 221 will be used for this property if it is omitted in an argument, or 222 when creating a new object of this type. 224 1.2. The Id data type 226 All record ids are assigned by the server, and are immutable. 228 Where "Id" is given as a datatype, it means a "String" of at least 1 229 and maximum 255 octets in size, and MUST only contain characters from 230 the "URL and Filename safe" Base 64 Alphabet, as defined in section 5 231 of [RFC4648], excluding the pad character ("="). This means the 232 allowed characters are the ASCII alphanumeric characters ("A-Za- 233 z0-9"), hyphen ("-"), and underscore ("_"). 235 These characters are safe to use in almost any context (e.g., 236 filesystems, URIs, IMAP atoms). For maximum safety, servers SHOULD 237 also follow defensive allocation strategies to avoid creating risks 238 where glob completion or data type detection may be present (e.g., on 239 filesystems or in spreadsheets). In particular, it is wise to avoid: 241 o Ids starting with a dash 243 o Ids starting with digits 244 o Ids that contain only digits 246 o Ids that differ only by ASCII case (for example, A vs. a) 248 o the specific sequence of three characters "NIL" (because this 249 sequence can be confused with the IMAP protocol expression of the 250 null value) 252 A good solution to these issues is to prefix every id with a single 253 alphabetical character. 255 1.3. The Int and UnsignedInt data types 257 Where "Int" is given as a data type, it means an integer in the range 258 -2^53+1 <= value <= 2^53-1, the safe range for integers stored in a 259 floating-point double, represented as a JSON "Number". 261 Where "UnsignedInt" is given as a data type, it means an "Int" where 262 the value MUST be in the range 0 <= value <= 2^53-1. 264 1.4. The Date and UTCDate data types 266 Where "Date" is given as a type, it means a string in [RFC3339] 267 _date-time_ format. To ensure a normalised form, the _time-secfrac_ 268 MUST always be omitted if zero, and any letters in the string (e.g. 269 "T" and "Z") MUST be upper-case. For example, 270 ""2014-10-30T14:12:00+08:00"". 272 Where "UTCDate" is given as a type, it means a "Date" where the 273 _time-offset_ component MUST be "Z" (i.e. it must be in UTC time). 274 For example, ""2014-10-30T06:12:00Z"". 276 1.5. JSON as the data encoding format 278 JSON is a text-based data interchange format as specified in 279 [RFC8259]. The I-JSON format defined in [RFC7493] is a strict subset 280 of this, adding restrictions to avoid potentially confusing scenarios 281 (for example, it mandates that an object MUST NOT have two members 282 with the same name). 284 All data sent from the client to the server or from the server to the 285 client (except binary file upload/download) MUST be valid I-JSON 286 according to the RFC, and is therefore case-sensitive and encoded in 287 UTF-8 ([RFC3629]). 289 1.6. Terminology 291 1.6.1. User 293 A user is a person accessing data via JMAP. A user has a set of 294 permissions determining the data that they can see. 296 1.6.2. Accounts 298 An account is a collection of data. A single account may contain an 299 arbitrary set of data types, for example a collection of mail, 300 contacts and calendars. Most JMAP methods take a mandatory 301 _accountId_ argument that specifies on which account the operations 302 are to take place. 304 An account is not the same as a user, although it is common for a 305 primary account to directly belong to the user. For example, you may 306 have an account that contains data for a group or business, to which 307 multiple users have access. 309 A single set of credentials may provide access to multiple accounts, 310 for example if another user is sharing their work calendar with the 311 authenticated user, or if there is a group mailbox for a support-desk 312 inbox. 314 In the event of a severe internal error, a server may have to 315 reallocate ids or do something else that violates standard JMAP data 316 constraints for an account. In this situation, the data on the 317 server is no longer compatible with cached data the client may have 318 from before. The server MUST treat this as though the account has 319 been deleted and then recreated with a new account id. Clients will 320 then be forced to throw away any data with the old account id and 321 refetch all data from scratch. 323 1.6.3. Data types and records 325 JMAP provides a uniform interface for creating, retrieving, updating 326 and deleting various types of objects. A *data type* is a collection 327 of named, typed properties, just like the schema for a database 328 table. Each instance of a data type is called a *record*. 330 The id of a record is immutable, and assigned by the server. The id 331 MUST be unique among all records of the *same type* within the *same 332 account*. Ids may clash across accounts, or for two records of 333 different types within the same account. 335 1.7. The JMAP API model 337 JMAP uses HTTP [RFC7230] to expose API, Push, Upload and Download 338 resources. All HTTP requests MUST be use the "https://" scheme 339 ([RFC2818] HTTP over TLS). All HTTP requests MUST be authenticated. 341 An authenticated client can fetch the JMAP Session object with 342 details about the data and capabilities the server can provide as 343 shown in section 2. The client may then exchange data with the 344 server in the following ways: 346 1. The client may make an API request to the server to get or set 347 structured data. This request consists of an ordered series of 348 method calls. These are processed by the server, which then 349 returns an ordered series of responses. This is described in 350 sections 3 to 5. 352 2. The client may download or upload binary files from/to the 353 server. This is detailed in section 6. 355 3. The client may connect to a push channel on the server, to be 356 notified when data has changed. This is explained in section 7. 358 1.8. Vendor-specific extensions 360 Individual services will have custom features they wish to expose 361 over JMAP. This may take the form of extra data types and/or methods 362 not in the spec, or extra arguments to JMAP methods, or extra 363 properties on existing data types (which may also appear in arguments 364 to methods that take property names). 366 The server can advertise custom extensions it supports by including 367 the identifiers in the capabilities object. Identifiers for vendor 368 extensions MUST be a URL belonging to a domain owned by the vendor, 369 to avoid conflict. The URL SHOULD resolve to documentation for the 370 changes the extension makes. 372 To ensure compatibility with clients that don't know about a specific 373 custom extension, and for compatibility with future versions of JMAP, 374 to use an extension the client MUST opt in by passing the appropriate 375 capability identifier in the _using_ array of the Request object, as 376 described in section 3.2. The server MUST only follow the 377 specifications that are opted-into and behave as though it does not 378 implement anything else when processing a request. 380 2. The JMAP Session resource 382 You need two things to connect to a JMAP server: 384 1. The URL for the JMAP Session resource. This may be requested 385 directly from the user, or discovered automatically based on a 386 username domain (see section 2.2 below). 388 2. Credentials to authenticate with. How to obtain credentials is 389 out of scope for this document. 391 An authenticated GET request to the JMAP Session resource MUST return 392 the details about the data and capabilities the server can provide to 393 the client given those credentials. 395 The response to a successful request is a JSON-encoded *JMAP Session* 396 object. It has the following properties: 398 o *capabilities*: "String[Object]" An object specifying the 399 capabilities of this server. Each key is a URI for a capability 400 supported by the server. The value for each of these keys is an 401 object with further information about the server's capabilities in 402 relation to that capability. The client MUST ignore any 403 properties it does not understand. The capabilities object MUST 404 include a property called "urn:ietf:params:jmap:core". The value 405 of this property is an object which MUST contain the following 406 information on server capabilities (suggested minimum values for 407 limits are supplied that allow clients to make efficient use of 408 the network): 410 * *maxSizeUpload*: "UnsignedInt" The maximum file size, in 411 octets, that the server will accept for a single file upload 412 (for any purpose). Suggested minimum: 50,000,000. 414 * *maxConcurrentUpload*: "UnsignedInt" The maximum number of 415 concurrent requests the server will accept to the upload 416 endpoint. Suggested minimum: 4. 418 * *maxSizeRequest*: "UnsignedInt" The maximum size, in octets, 419 that the server will accept for a single request to the API 420 endpoint. Suggested minimum: 10,000,000. 422 * *maxConcurrentRequests*: "UnsignedInt" The maximum number of 423 concurrent requests the server will accept to the API endpoint. 424 Suggested minimum: 4. 426 * *maxCallsInRequest*: "UnsignedInt" The maximum number of method 427 calls the server will accept in a single request to the API 428 endpoint. Suggested minimum: 16. 430 * *maxObjectsInGet*: "UnsignedInt" The maximum number of objects 431 that the client may request in a single "/get" type method 432 call. Suggested minimum: 500 434 * *maxObjectsInSet*: "UnsignedInt" The maximum number of objects 435 the client may send to create, update or destroy in a single 436 "/set" type method call. This is the combined total, e.g. if 437 the maximum is 10 you could not create 7 objects and destroy 6, 438 as this would be 13 actions, which exceeds the limit. 439 Suggested minimum: 500. 441 * *collationAlgorithms*: "String[]" A list of identifiers for 442 algorithms registered in the collation registry defined in 443 [RFC4790] that the server supports for sorting when querying 444 records. 446 Specifications for future capabilities will define their own 447 properties on the capabilities object. Servers MAY advertise 448 vendor-specific JMAP extensions, as described in section 1.8. To 449 avoid conflict, an identifier for a vendor-specific extension MUST 450 be a URL with a domain owned by the vendor. Clients MUST opt in 451 to any capability it wishes to use (see section 3.2). 453 o *accounts*: "Id[Account]" A map of *account id* to Account object 454 for each account (see section 1.5.2) the user has access to. An 455 *Account* object has the following properties: 457 * *name*: "String" A user-friendly string to show when presenting 458 content from this account, e.g. the email address representing 459 the owner of the account. 461 * *isPersonal*: "Boolean" This is "true" if the account belongs 462 to the authenticated user, rather than a group account or a 463 personal account of another user that has been shared with 464 them. 466 * *isReadOnly*: "Boolean" This is "true" if the entire account is 467 read-only. 469 * *accountCapabilities*: "String[Object]" The set of capability 470 URIs for the methods supported in this account. Each key is a 471 URI for a capability that has methods you can use with this 472 account. The value for each of these keys is an object with 473 further information about the account's permissions and 474 restrictions with respect to this capability, as defined in the 475 capability's specification. The client MUST ignore any 476 properties it does not understand. The server advertises the 477 full list of capabilities it supports in the capabilities 478 object, as defined above. If the capability defines new 479 methods, the server MUST include it in the 480 _accountCapabilities_ object if the user may use those methods 481 with this account. It MUST NOT include it in the 482 _accountCapabilities_ object if the user cannot use those 483 methods with this account. For example, you may have access to 484 your own account with mail, calendars and contacts data, and 485 also a shared account that only has contacts data (a business 486 address book for example). In this case the 487 _accountCapabilities_ property on the first account would 488 include something like "urn:ietf:params:jmap:mail", 489 "urn:ietf:params:jmap:calendars", 490 "urn:ietf:params:jmap:contacts", while the second account would 491 just have the last of these. Attempts to use the methods 492 defined in a capability with one of the accounts that does not 493 support that capability are rejected with an 494 _accountNotSupportedByMethod_ error (see section 3.5.2: method- 495 level errors). 497 o *primaryAccounts*: "String[Id]" A map of capability URIs (as found 498 in _accountCapabilities_) to the account id to be considered the 499 user's main or default account for data pertaining to that 500 capability. If no account being returned belongs to the user, or 501 in any other way there is no appropriate way to determine a 502 default account, there MAY be no entry for a particular URI, even 503 though that capability is supported by the server (and in the 504 capabilities object). "urn:ietf:params:jmap:core" SHOULD NOT be 505 present. 507 o *username*: "String" The username associated with the given 508 credentials, or the empty string if none. 510 o *apiUrl*: "String" The URL to use for JMAP API requests. 512 o *downloadUrl*: "String" The URL endpoint to use when downloading 513 files, in [RFC6570] URI Template (level 1) format. The URL MUST 514 contain variables called "accountId", "blobId", "type" and "name". 515 The use of these variables is described in section 6.2. Due to 516 potential encoding issues with slashes in content types, it is 517 RECOMMENDED to put the "type" variable in the query section of the 518 URL. 520 o *uploadUrl*: "String" The URL endpoint to use when uploading 521 files, in [RFC6570] URI Template (level 1) format. The URL MUST 522 contain a variable called "accountId". The use of this variable 523 is described in section 6.1. 525 o *eventSourceUrl*: "String" The URL to connect to for push events, 526 as described in section 7.3, in [RFC6570] URI Template (level 1) 527 format. The URL MUST contain variables called "types", 528 "closeafter" and "ping". The use of these variables is described 529 in section 7.3. 531 o *state*: "String" A (preferably short) string representing the 532 state of this object on the server. If the value of any other 533 property on the session object changes, this string will change. 534 The current value is also returned on the API Response object (see 535 section 3.3), allowing clients to quickly determine if the session 536 information has changed (e.g. an account has been added or 537 removed) and so they need to refetch the object. 539 To ensure future compatibility, other properties MAY be included on 540 the JMAP Session object. Clients MUST ignore any properties they are 541 not expecting. 543 Implementors must take care to avoid inappropriate caching of the 544 session object at the HTTP layer. Since the client should only 545 refetch when it detects there is a change (via the sessionState 546 property of an API response), it is RECOMMENDED to disable HTTP 547 caching altogether, for example by setting "Cache-Control: no-cache, 548 no-store, must-revalidate" on the response. 550 2.1. Example 552 In the following example JMAP Session object, the user has access to 553 their own mail and contacts via JMAP, as well as read-only access to 554 shared mail from another user. The server is advertising a custom 555 "https://example.com/apis/foobar" capability. 557 { 558 "capabilities": { 559 "urn:ietf:params:jmap:core": { 560 "maxSizeUpload": 50000000, 561 "maxConcurrentUpload": 8, 562 "maxSizeRequest": 10000000, 563 "maxConcurrentRequest": 8, 564 "maxCallsInRequest": 32, 565 "maxObjectsInGet": 256, 566 "maxObjectsInSet": 128, 567 "collationAlgorithms": [ 568 "i;ascii-numeric", 569 "i;ascii-casemap", 570 "i;unicode-casemap" 571 ] 572 }, 573 "urn:ietf:params:jmap:mail": {} 574 "urn:ietf:params:jmap:contacts": {}, 575 "https://example.com/apis/foobar": { 576 "maxFoosFinangled": 42 577 } 578 }, 579 "accounts": { 580 "A13824": { 581 "name": "john@example.com", 582 "isPersonal": true, 583 "isReadOnly": false, 584 "accountCapabilities": { 585 "urn:ietf:params:jmap:mail": { 586 "maxMailboxesPerEmail": null, 587 "maxMailboxDepth": 10, 588 ... 589 }, 590 "urn:ietf:params:jmap:contacts": { 591 ... 592 } 593 } 594 }, 595 "A97813": { 596 "name": "jane@example.com", 597 "isPersonal": false, 598 "isReadOnly": true, 599 "accountCapabilities": { 600 "urn:ietf:params:jmap:mail": { 601 "maxMailboxesPerEmail": 1, 602 "maxMailboxDepth": 10, 603 ... 604 } 605 } 606 } 607 }, 608 "primaryAccounts": { 609 "urn:ietf:params:jmap:mail": "A13824", 610 "urn:ietf:params:jmap:contacts": "A13824" 611 }, 612 "username": "john@example.com", 613 "apiUrl": "https://jmap.example.com/api/", 614 "downloadUrl": "https://jmap.example.com 615 /download/{accountId}/{blobId}/{name}?accept={type}", 616 "uploadUrl": "https://jmap.example.com/upload/{accountId}/", 617 "eventSourceUrl": "https://jmap.example.com 618 /eventsource/?types={types}&closeafter={closeafter}&ping={ping}", 619 "state": "75128aab4b1b" 620 } 622 2.2. Service autodiscovery 624 There are two standardised autodiscovery methods in use for internet 625 protocols: 627 o *DNS SRV* ([RFC2782], [RFC6186] and [RFC6764]) 629 o *.well-known/servicename* ([RFC5785]) 631 A JMAP-supporting host for the domain "example.com" SHOULD publish a 632 SRV record "_jmap._tcp.example.com" which gives a _hostname_ and 633 _port_ (usually port "443"). The JMAP Session resource is then 634 "https://${hostname}[:${port}]/.well-known/jmap" (following any 635 redirects). 637 If the client has a username in the form of an email address, it MAY 638 use the domain portion of this to attempt autodiscovery of the JMAP 639 server. 641 3. Structured data exchange 643 The client may make an API request to the server to get or set 644 structured data. This request consists of an ordered series of 645 method calls. These are processed by the server, which then returns 646 an ordered series of responses. 648 3.1. Making an API request 650 To make an API request, the client makes an authenticated POST 651 request to the API resource, which is defined by the _apiUrl_ 652 property in the JMAP Session object. 654 The request MUST be of type "application/json" and consist of a 655 single JSON *Request* object, as defined in section 3.2. If 656 successful, the response MUST also be of type "application/json" and 657 consist of a single *Response* object, as defined in section 3.3. 659 3.1.1. The Invocation data type 661 Method calls and responses are represented by the *Invocation* data 662 type. This is a tuple, represented as a JSON array containing three 663 elements: 665 1. A "String" *name* of the method to call or of the response. 667 2. A "String[*]" object containing _named_ *arguments* for that 668 method or response. 670 3. A "String" *method call id*: an arbitrary string from the client 671 to be echoed back with the responses emitted by that method call 672 (a method may return 1 or more responses, as it may make implicit 673 calls to other methods; all responses initiated by this method 674 call get the same method call id in the response). 676 3.2. The Request object 678 A *Request* object has the following properties: 680 o *using*: "String[]" The set of capabilities the client wishes to 681 use. The client MAY include capability identifiers even if the 682 method calls it makes do not utilise those capabilities. The 683 server advertises the set of specifications it supports in the 684 JMAP Session object, as keys on the _capabilities_ property. 686 o *methodCalls*: "Invocation[]" An array of method calls to process 687 on the server. The method calls MUST be processed sequentially, 688 in order. 690 o *createdIds*: "Id[Id]" (optional) A map of (client-specified) 691 creation id to the id the server assigned when a record was 692 successfully created. As described later in this specification, 693 some records may have a property that contains the id of another 694 record. To allow more efficient network usage, you can set this 695 property to reference a record created earlier in the same API 696 request. Since the real id is unknown when the request is 697 created, the client can instead specify the creation id it 698 assigned, prefixed with a "#" (see section 5.3 for more details). 699 As the server processes API requests, any time it successfully 700 creates a new record it adds to this map the creation id (see the 701 _create_ argument to "/set" in section 5.3), with the server- 702 assigned real id as the value. If it comes across a reference to 703 a creation id in a create/update, it looks it up in the map and 704 replaces the reference with the real id, if found. The client can 705 pass an initial value for this map as the _createdIds_ property of 706 the Request. This may be an empty object. If given in the 707 request, the response will also include a createdIds property, 708 with any additionally created ids added. This allows proxy 709 servers to easily split a JMAP request into multiple JMAP requests 710 to send to different servers. For example it could send the first 711 two method calls to server A, then the third to server B, before 712 sending the fourth to server A again. By passing the createdIds 713 of the previous response to the next request, it can ensure all of 714 these still resolve. See section 5.8 for further discussion of 715 proxy considerations. 717 Future specifications MAY add further properties to the Request 718 object to extend the semantics. To ensure forwards compatibility, a 719 server MUST ignore any other properties it does not understand on the 720 JMAP request object. 722 3.2.1. Example request 724 { 725 "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ], 726 "methodCalls": [ 727 [ "method1", { 728 "arg1": "arg1data", 729 "arg2": "arg2data" 730 }, "c1" ], 731 [ "method2", { 732 "arg1": "arg1data" 733 }, "c2" ], 734 [ "method3", {}, "c3" ] 735 ] 736 } 738 3.3. The Response object 740 A *Response* object has the following properties: 742 o *methodResponses*: "Invocation[]" An array of responses, in the 743 same format as the _methodCalls_ on the request object. The 744 output of the methods MUST be added to the _methodResponses_ array 745 in the same order as the methods are processed. 747 o *createdIds*: "Id[Id]" (optional; only returned if given in 748 request) A map of (client-specified) creation id to the id the 749 server assigned when a record was successfully created. This 750 includes all values passed in the request, as well as any 751 additional ones added for newly created records. 753 o *sessionState*: "String" The current value of the "state" string 754 on the JMAP Session object, as described in section 2. Clients 755 may use this to detect if this object has changed and needs to be 756 refetched. 758 Unless otherwise specified, if the method call completed successfully 759 its response name is the same as the method name in the request. 761 3.3.1. Example response: 763 { 764 "methodResponses": [ 765 [ "method1", { 766 "arg1": 3, 767 "arg2": "foo" 768 }, "c1" ], 769 [ "method2", { 770 "isBlah": true 771 }, "c2" ], 772 [ "anotherResponseFromMethod2", { 773 "data": 10, 774 "yetmoredata": "Hello" 775 }, "c2"], 776 [ "error", { 777 "type":"unknownMethod" 778 }, "c3" ] 779 ], 780 "sessionState": "75128aab4b1b" 781 } 783 3.4. Omitting arguments 785 An argument to a method may be specified to have a default value. If 786 omitted by the client, the server MUST treat the method call the same 787 as if the default value had been specified. Similarly, the server 788 MAY omit any argument in a response which has the default value. 790 Unless otherwise specified in a method description, "null" is the 791 default value for any argument in a request or response where this is 792 allowed by the type signature. Other arguments may only be omitted 793 if an explicit default value is defined in the method description. 795 3.5. Errors 797 There are three different levels of granularity at which an error may 798 be returned in JMAP. 800 When an API request is made, the request as a whole may be rejected 801 due to rate limiting, malformed JSON, request for an unknown 802 capability etc. In this case the entire request is rejected with an 803 appropriate HTTP error response code, and an additional JSON body 804 with more detail for the client. 806 Provided the request itself is syntactically valid (the JSON is 807 valid, and when decoded matches the type signature of a Request 808 object), the methods within it are executed sequentially by the 809 server. Each method may individually fail, for example if invalid 810 arguments are given, or an unknown method name is called. 812 Finally, methods that make changes to the server state often act upon 813 a number of different records within a single call. Each record 814 change may be separately rejected with a SetError, as described in 815 section 5.3. 817 3.5.1. Request-level errors 819 When an HTTP error response is returned to the client, the server 820 SHOULD return a JSON "problem details" object as the response body, 821 as per [RFC7807]. 823 The following problem types are defined: 825 o "urn:ietf:params:jmap:error:unknownCapability" The client included 826 a capability in the "using" property of the request that the 827 server does not support. 829 o "urn:ietf:params:jmap:error:notJSON" The content type of the 830 request was not "application/json" or the request did not parse as 831 I-JSON. 833 o "urn:ietf:params:jmap:error:notRequest" The request parsed as JSON 834 but did not match the type signature of the Request object. 836 o "urn:ietf:params:jmap:error:limit" The request was not processed 837 as it would have exceeded one of the *request* limits defined on 838 the capability object, such as maxSizeRequest, maxCallsInRequest 839 or maxConcurrentRequests. A "limit" property MUST also be present 840 on the "problem details" object, containing the name of the limit 841 being applied. 843 3.5.1.1. Example 845 { 846 "type": "urn:ietf:params:jmap:error:unknownCapability", 847 "status": 400, 848 "detail": "The request object used capability 849 'https://example.com/apis/foobar', which is not supported 850 by this server." 851 } 853 Another example: 855 { 856 "type": "urn:ietf:params:jmap:error:limit", 857 "limit": "maxSizeRequest", 858 "status": 400, 859 "detail": "The request is larger than the server is willing to process." 860 } 862 3.5.2. Method-level errors 864 If a method encounters an error, the appropriate "error" response 865 MUST be inserted at the current point in the _methodResponses_ array 866 and, unless otherwise specified, further processing MUST NOT happen 867 within that method call. 869 Any further method calls in the request MUST then be processed as 870 normal. Errors at the method level MUST NOT generate an HTTP-level 871 error. 873 An "error" response looks like this: 875 [ "error", { 876 "type": "unknownMethod" 877 }, "call-id" ] 879 The response name is "error", and it MUST have a type property. 880 Other properties may be present with further information; these are 881 detailed in the error type descriptions where appropriate. 883 With the exception of "serverPartialFail", the externally-visible 884 state of the server MUST NOT have changed if an error is returned at 885 the method level. 887 The following error types are defined which may be returned for any 888 method call where appropriate: 890 "serverUnavailable": Some internal server resource was temporarily 891 unavailable. Attempting the same operation later (perhaps after a 892 backoff with a random factor) may succeed. 894 "serverFail": An unexpected or unknown error occurred during the 895 processing of the call. A _description_ property should provide more 896 details about the error. The method call made no changes to the 897 server's state. Attempting the same operation again is expected to 898 fail again. Contacting the service administrator is likely necessary 899 to resolve this problem if it is persistent. 901 "serverPartialFail": Some, but not all expected changes described by 902 the method occurred. The client MUST re-synchronise impacted data to 903 determine server state. Use of this error is strongly discouraged. 905 "unknownMethod": The server does not recognise this method name. 907 "invalidArguments": One of the arguments is of the wrong type or 908 otherwise invalid, or a required argument is missing. A 909 "description" property MAY be present to help debug with an 910 explanation of what the problem was. This is a non-localised string, 911 and is not intended to be shown directly to end users. 913 "invalidResultReference": The method used a result reference for one 914 of its arguments (see section 3.6), but this failed to resolve. 916 "forbidden": The method and arguments are valid, but executing the 917 method would violate an ACL or other permissions policy. 919 "accountNotFound": The _accountId_ does not correspond to a valid 920 account. 922 "accountNotSupportedByMethod": The _accountId_ given corresponds to a 923 valid account, but the account does not support this method or data 924 type. 926 "accountReadOnly": This method call would modify state in an account 927 that is read-only (as returned on the corresponding Account object in 928 the JMAP Session resource). 930 Further possible errors for a particular method are specified in the 931 method descriptions. 933 Further general errors MAY be defined in future RFCs. Should a 934 client receive an error type it does not understand, it MUST treat it 935 the same as the "serverFail" type. 937 3.6. References to previous method results 939 To allow clients to make more efficient use of the network and avoid 940 round trips, an argument to one method can be taken from the result 941 of a previous method call in the same request. 943 To do this, the client prefixes the argument name with "#" (an 944 octothorpe). The value is a _ResultReference_ object as described 945 below. When processing a method call, the server MUST first check 946 the arguments object for any names beginning with "#". If found, the 947 result reference should be resolved and the value used as the "real" 948 argument. The method is then processed as normal. If any result 949 reference fails to resolve, the whole method MUST be rejected with an 950 "invalidResultReference" error. If an argument object contains the 951 same argument name in normal and referenced form (e.g. "foo" and 952 "#foo"), the method MUST return an "invalidArguments" error. 954 A *ResultReference* object has the following properties: 956 o *resultOf*: "String" The method call id of the method call to get 957 the result from (the string given as the third item in the array 958 for a method call). 960 o *name*: "String" The expected name of the response. 962 o *path*: "String" A pointer into the arguments. This is an 963 [RFC6901] JSON Pointer, except it also allows the use of "*" to 964 map through an array (see description below). 966 To resolve: 968 1. Find the first response with a method call id identical to the 969 _resultOf_ property of the _ResultReference_ in the 970 _methodResponses_ array from previously processed method calls in 971 the same request. If none, evaluation fails. 973 2. If the response name is not identical to the _name_ property of 974 the _ResultReference_, evaluation fails. 976 3. Apply the _path_ to the arguments object of the response (the 977 second item in the response array) following the [RFC6901] JSON 978 Pointer algorithm, except with the following addition in section 979 4 (Evaluation): 981 If the currently referenced value is a JSON array, the reference 982 token may be exactly the single character "*", making the new 983 referenced value the result of applying the rest of the JSON pointer 984 tokens to every item in the array and returning the results in the 985 same order in a new array. If the result of applying the rest of the 986 pointer tokens to a value was itself an array, its items should be 987 included individually in the output rather than including the array 988 itself (i.e. the result is flattened from an array of arrays to a 989 single array). 991 As a simple example, suppose we have the following API request 992 _methodCalls_: 994 [[ "Foo/changes", { 995 "accountId": "A1", 996 "sinceState": "abcdef" 997 }, "t0" ], 998 [ "Foo/get", { 999 "accountId": "A1", 1000 "#ids": { 1001 "resultOf": "t0", 1002 "name": "Foo/changes", 1003 "path": "/created" 1004 } 1005 }, "t1" ]] 1007 After executing the first method call the _methodResponses_ array is: 1009 [[ "Foo/changes", { 1010 "accountId": "A1", 1011 "oldState": "abcdef", 1012 "newState": "123456", 1013 "hasMoreChanges": false, 1014 "created": [ "f1", "f4" ], 1015 "updated": [], 1016 "destroyed": [] 1017 }, "t0" ]] 1019 To execute the Foo/get call, we look through the arguments and find 1020 there is one with a "#" prefix. To resolve this, we apply the 1021 algorithm above: 1023 1. Find the first response with method call id "t0". The Foo/ 1024 changes response fulfils this criterion. 1026 2. Check the response name is the same as in the result reference. 1027 It is, so this is fine. 1029 3. Apply the _path_ as a JSON pointer to the arguments object. This 1030 simply selects the "created" property, so the result of 1031 evaluating is: "[ "f1", "f4" ]" 1033 The JMAP server now continues to process the Foo/get call as though 1034 the arguments were: 1036 { 1037 "accountId": "A1", 1038 "ids": [ "f1", "f4" ] 1039 } 1041 Now a more complicated example using the JMAP Mail data model: fetch 1042 the "from"/"date"/"subject" for every email in the first 10 threads 1043 in the Inbox (sorted newest first): 1045 [[ "Email/query", { 1046 "accountId": "A1", 1047 "filter": { "inMailbox": "id_of_inbox" }, 1048 "sort": [{ "property": "receivedAt", "isAscending": false }], 1049 "collapseThreads": true, 1050 "position": 0, 1051 "limit": 10, 1052 "calculateTotal": true 1053 }, "t0" ], 1054 [ "Email/get", { 1055 "accountId": "A1", 1056 "#ids": { 1057 "resultOf": "t0", 1058 "name": "Email/query", 1059 "path": "/ids" 1060 }, 1061 "properties": [ "threadId" ] 1062 }, "t1" ], 1063 [ "Thread/get", { 1064 "accountId": "A1", 1065 "#ids": { 1066 "resultOf": "t1", 1067 "name": "Email/get", 1068 "path": "/list/*/threadId" 1069 } 1070 }, "t2" ], 1071 [ "Email/get", { 1072 "accountId": "A1", 1073 "#ids": { 1074 "resultOf": "t2", 1075 "name": "Thread/get", 1076 "path": "/list/*/emailIds" 1077 }, 1078 "properties": [ "from", "receivedAt", "subject" ] 1079 }, "t3" ]] 1081 After executing the first 3 method calls the _methodResponses_ array 1082 might be: 1084 [[ "Email/query", { 1085 "accountId": "A1", 1086 "queryState": "abcdefg", 1087 "canCalculateChanges": true, 1088 "position": 0, 1089 "total": 101, 1090 "ids": [ "msg1023", "msg223", "msg110", "msg93", "msg91", 1091 "msg38", "msg36", "msg33", "msg11", "msg1" ] 1092 }, "t0" ], 1093 [ "Email/get", { 1094 "accountId": "A1", 1095 "state": "123456", 1096 "list": [{ 1097 "id": "msg1023", 1098 "threadId": "trd194" 1099 }, { 1100 "id": "msg223", 1101 "threadId": "trd114" 1102 }, 1103 ... 1104 ], 1105 "notFound": [] 1106 }, "t1" ], 1107 [ "Thread/get", { 1108 "accountId": "A1", 1109 "state": "123456", 1110 "list": [{ 1111 "id": "trd194", 1112 "emailIds": [ "msg1020", "msg1021", "msg1023" ] 1113 }, { 1114 "id": "trd114", 1115 "emailIds": [ "msg201", "msg223" ] 1116 }, 1117 ... 1118 ], 1119 "notFound": [] 1120 }, "t2" ]] 1122 So to execute the final Email/get call, we look through the arguments 1123 and find there is one with a "#" prefix. To resolve this, we apply 1124 the algorithm: 1126 1. Find the first response with method call id "t2". The "Thread/ 1127 get" response fulfils this criterion. 1129 2. "Thread/get" is the name specified in the result reference, so 1130 this is fine. 1132 3. Apply the _path_ as a JSON pointer to the arguments object. 1133 Token-by-token: 1135 1. "list": get the array of thread objects 1137 2. "*": for each of the items in the array: 1139 1. "emailIds": get the array of email ids 1141 2. Concatenate these into a single array of all the ids in 1142 the result. 1144 The JMAP server now continues to process the Email/get call as though 1145 the arguments were: 1147 { 1148 "accountId": "A1", 1149 "ids": [ "msg1020", "msg1021", "msg1023", "msg201", "msg223", ... ], 1150 "properties": [ "from", "receivedAt", "subject" ] 1151 } 1153 3.7. Localisation of user-visible strings 1155 If returning a custom string to be displayed to the user, for example 1156 an error message, the server SHOULD use information from the Accept- 1157 Language header of the request (as defined in [RFC7231] section 1158 5.3.5) to help determine the choice of localisation if multiple are 1159 available. The Content-Language header of the response (see 1160 section 3.1.3.2 of [RFC7231]) SHOULD indicate the language being used 1161 for user-visible strings. 1163 For example, suppose a request was made with the following header: 1165 Accept-Language: fr-CH, fr;q=0.9, de;q=0.8, en;q=0.7, *;q=0.5 1167 and a method generated an error to display to the user. The server 1168 has translations of the error message in English and German. Looking 1169 at the Accept-Language header, the user's preferred language is 1170 French. Since we don't have a translation for this, we look at the 1171 next most preferred which is German. We have a German translation so 1172 the server returns this, and indicates the language chosen in a 1173 Content-Language header like so: 1175 Content-Language: de 1177 3.8. Security 1179 As always, the server must be strict about data received from the 1180 client. Arguments need to be checked for validity; a malicious user 1181 could attempt to find an exploit through the API. In case of invalid 1182 arguments (unknown/insufficient/wrong type for data etc.) the method 1183 MUST return an "invalidArguments" error and terminate. 1185 3.9. Concurrency 1187 Method calls within a single request MUST be executed in order. 1188 However, method calls from different concurrent API requests may be 1189 interleaved. This means that the data on the server may change 1190 between two method calls within a single API request. 1192 4. The Core/echo method 1194 The _Core/echo_ method returns exactly the same arguments as it is 1195 given. It is useful for testing you have a valid authenticated 1196 connection to a JMAP API endpoint. 1198 4.1. Example 1200 Request: 1202 [[ "Core/echo", { 1203 "hello": true, 1204 "high": 5 1205 }, "b3ff" ]] 1207 Response: 1209 [[ "Core/echo", { 1210 "hello": true, 1211 "high": 5 1212 }, "b3ff" ]] 1214 5. Standard methods and naming convention 1216 JMAP provides a uniform interface for creating, retrieving, updating 1217 and deleting objects of a particular type. For a "Foo" data type, 1218 records of that type would be fetched via a "Foo/get" call and 1219 modified via a "Foo/set" call. Delta updates may be fetched via a 1220 "Foo/changes" call. These methods all follow a standard format as 1221 described below. 1223 Some types may not have all these methods. Specifications defining 1224 types MUST specify which methods are available for the type. 1226 5.1. /get 1228 Objects of type *Foo* are fetched via a call to _Foo/get_. 1230 It takes the following arguments: 1232 o *accountId*: "Id" The id of the account to use. 1234 o *ids*: "Id[]|null" The ids of the Foo objects to return. If 1235 "null" then *all* records of the data type are returned, if this 1236 is supported for that data type and the number of records does not 1237 exceed the _maxObjectsInGet_ limit. 1239 o *properties*: "String[]|null" If supplied, only the properties 1240 listed in the array are returned for each Foo object. If "null", 1241 all properties of the object are returned. The id property of the 1242 object is *always* returned, even if not explicitly requested. If 1243 an invalid property is requested, the call MUST be rejected with 1244 an "invalidArguments" error. 1246 The response has the following arguments: 1248 o *accountId*: "Id" The id of the account used for the call. 1250 o *state*: "String" A (preferably short) string representing the 1251 state on the server for *all* the data of this type in the account 1252 (not just the objects returned in this call). If the data 1253 changes, this string MUST change. If the Foo data is unchanged, 1254 servers SHOULD return the same state string on subsequent requests 1255 for this data type. When a client receives a response with a 1256 different state string to a previous call, it MUST either throw 1257 away all currently cached objects for the type, or call _Foo/ 1258 changes_ to get the exact changes. 1260 o *list*: "Foo[]" An array of the Foo objects requested. This is 1261 the *empty array* if no objects were found, or if the _ids_ 1262 argument passed in was also the empty array. The results MAY be 1263 in a different order to the _ids_ in the request arguments. If an 1264 identical id is included more than once in the request, the server 1265 MUST only include it once in either the _list_ or _notFound_ 1266 argument of the response. 1268 o *notFound*: "Id[]" This array contains the ids passed to the 1269 method for records that do not exist. The array is empty if all 1270 requested ids were found, or if the _ids_ argument passed in was 1271 either "null" or the empty array. 1273 The following additional error may be returned instead of the _Foo/ 1274 get_ response: 1276 "requestTooLarge": The number of _ids_ requested by the client 1277 exceeds the maximum number the server is willing to process in a 1278 single method call. 1280 5.2. /changes 1282 When the state of the set of Foo records in an account changes on the 1283 server (whether due to creation, updates or deletion), the _state_ 1284 property of the _Foo/get_ response will change. The _Foo/changes_ 1285 method allows a client to efficiently update the state of its Foo 1286 cache to match the new state on the server. It takes the following 1287 arguments: 1289 o *accountId*: "Id" The id of the account to use. 1291 o *sinceState*: "String" The current state of the client. This is 1292 the string that was returned as the _state_ argument in the _Foo/ 1293 get_ response. The server will return the changes that have 1294 occurred since this state. 1296 o *maxChanges*: "UnsignedInt|null" The maximum number of ids to 1297 return in the response. The server MAY choose to return fewer 1298 than this value, but MUST NOT return more. If not given by the 1299 client, the server may choose how many to return. If supplied by 1300 the client, the value MUST be a positive integer greater than 0. 1301 If a value outside of this range is given, the server MUST reject 1302 the call with an "invalidArguments" error. 1304 The response has the following arguments: 1306 o *accountId*: "Id" The id of the account used for the call. 1308 o *oldState*: "String" This is the _sinceState_ argument echoed 1309 back; the state from which the server is returning changes. 1311 o *newState*: "String" This is the state the client will be in after 1312 applying the set of changes to the old state. 1314 o *hasMoreChanges*: "Boolean" If "true", the client may call _Foo/ 1315 changes_ again with the _newState_ returned to get further 1316 updates. If "false", _newState_ is the current server state. 1318 o *created*: "Id[]" An array of ids for records which have been 1319 created since the old state. 1321 o *updated*: "Id[]" An array of ids for records which have been 1322 updated since the old state. 1324 o *destroyed*: "Id[]" An array of ids for records which have been 1325 destroyed since the old state. 1327 If a record has been created AND updated since the old state, the 1328 server SHOULD just return the id in the _created_ list, but MAY 1329 return it in the _updated_ list as well. 1331 If a record has been updated AND destroyed since the old state, the 1332 server SHOULD just return the id in the _destroyed_ list, but MAY 1333 return it in the _updated_ list as well. 1335 If a record has been created AND destroyed since the old state, the 1336 server SHOULD remove the id from the response entirely, but MAY 1337 include it in the _destroyed_ list, and if so MAY also include it in 1338 the _created_ list. 1340 If a _maxChanges_ is supplied, or set automatically by the server, 1341 the server MUST ensure the number of ids returned across _created_, 1342 _updated_ and _destroyed_ does not exceed this limit. If there are 1343 more changes than this between the client's state and the current 1344 server state, the server SHOULD generate an update to take the client 1345 to an intermediate state, from which the client can continue to call 1346 _Foo/changes_ until it is fully up to date. If it is unable to 1347 calculate an intermediate state, it MUST return a 1348 "cannotCalculateChanges" error response instead. 1350 When generating intermediate states, the server may choose how to 1351 divide up the changes. For many types it will provide a better user 1352 experience to return the more recent changes first, as this is more 1353 likely to be what the user is most interested in. The client can 1354 then continue to page in the older changes while the user is viewing 1355 the newer data. For example, suppose a server went through the 1356 following states: 1358 A -> B -> C -> D -> E 1360 And a client asks for changes from state "B". The server might first 1361 get the ids of records created, updated or destroyed between states D 1362 and E, returning them with: 1364 state: "B-D-E" 1365 hasMoreChanges: true 1367 The client will then ask for the change from state "B-D-E", and the 1368 server can return the changes between states C and D, returning: 1370 state: "B-C-E" 1371 hasMoreChanges: true 1373 Finally the client will request the changes from "B-C-E" and the 1374 server can return the changes between states B and C, returning: 1376 state: "E" 1377 hasMoreChanges: false 1379 Should the state on the server be modified in the middle of all this 1380 (to "F"), the server still does the same but now when the update to 1381 state "E" is returned, it would indicate that it still has more 1382 changes for the client to fetch. 1384 Where multiple changes to a record are split across different 1385 intermediate states, the server MUST NOT return a record as created 1386 in a later response than one which gives it as updated or destroyed, 1387 and MUST NOT return a record as destroyed before a response that 1388 gives it as created or updated. The server may have to coalesce 1389 multiple changes to a record to satisfy this requirement. 1391 The following additional errors may be returned instead of the _Foo/ 1392 changes_ response: 1394 "cannotCalculateChanges": The server cannot calculate the changes 1395 from the state string given by the client. Usually due to the 1396 client's state being too old, or the server being unable to produce 1397 an update to an intermediate state when there are too many updates. 1398 The client MUST invalidate its Foo cache. 1400 Maintaining state to allow calculation of _Foo/changes_ can be 1401 expensive for the server, but always returning 1402 _cannotCalculateChanges_ severely increases network traffic and 1403 resource usage for the client. To allow efficient sync, servers 1404 SHOULD be able to calculate changes from any state string that was 1405 given to a client within the last 30 days (but of course may support 1406 calculating updates from states older than this). 1408 5.3. /set 1410 Modifying the state of Foo objects on the server is done via the 1411 _Foo/set_ method. This encompasses creating, updating and destroying 1412 Foo records. This allows the server to sort out ordering and 1413 dependencies that may exist if doing multiple operations at once (for 1414 example to ensure there is always a minimum number of a certain 1415 record type). 1417 The _Foo/set_ method takes the following arguments: 1419 o *accountId*: "Id" The id of the account to use. 1421 o *ifInState*: "String|null" This is a state string as returned by 1422 the _Foo/get_ method (representing the state of all objects of 1423 this type in the account). If supplied, the string must match the 1424 current state, otherwise the method will be aborted and a 1425 "stateMismatch" error returned. If "null", any changes will be 1426 applied to the current state. 1428 o *create*: "Id[Foo]|null" A map of _creation id_ (a temporary id 1429 set by the client) to Foo objects, or "null" if no objects are to 1430 be created. The Foo object type definition may define default 1431 values for properties. Any such property may be omitted by the 1432 client. The client MUST omit any properties that may only be set 1433 by the server (for example, the _id_ property on most object 1434 types). 1436 o *update*: "Id[PatchObject]|null" A map of id to a Patch object to 1437 apply to the current Foo object with that id, or "null" if no 1438 objects are to be updated. A _PatchObject_ is of type 1439 "String[*]", and represents an unordered set of patches. The keys 1440 are a path in [RFC6901] JSON pointer format, with an implicit 1441 leading "/" (i.e. prefix each key with "/" before applying the 1442 JSON pointer evaluation algorithm). All paths MUST also conform 1443 to the following restrictions; if there is any violation, the 1444 update MUST be rejected with an "invalidPatch" error: 1446 * The pointer MUST NOT reference inside an array (i.e. you MUST 1447 NOT insert/delete from an array; the array MUST be replaced in 1448 its entirety instead). 1450 * All parts prior to the last (i.e. the value after the final 1451 slash) MUST already exist on the object being patched. 1453 * There MUST NOT be two patches in the PatchObject where the 1454 pointer of one is the prefix of the pointer of the other, e.g. 1455 "alerts/1/offset" and "alerts". 1457 The value associated with each pointer determines how to apply 1458 that patch: 1460 * If "null", set to the default value if specified for this 1461 property, otherwise remove the property from the patched 1462 object. If the key is not present in the parent, this a no-op. 1464 * Anything else: The value to set for this property (this may be 1465 a replacement or addition to the object being patched). 1467 Any server-set properties MAY be included in the patch if their 1468 value is identical to the current server value (before applying 1469 the patches to the object). Otherwise, the update MUST be 1470 rejected with an _invalidProperties_ SetError. This patch 1471 definition is designed such that an entire Foo object is also a 1472 valid PatchObject. The client MAY choose to optimise network 1473 usage by just sending the diff, or MAY just send the whole object; 1474 the server processes it the same either way. 1476 o *destroy*: "Id[]|null" A list of ids for Foo objects to 1477 permanently delete, or "null" if no objects are to be destroyed. 1479 Each creation, modification or destruction of an object is considered 1480 an atomic unit. It is permissible for the server to commit changes 1481 to some objects but not others, however it MUST NOT only commit part 1482 of an update to a single record (e.g. update a _name_ property but 1483 not a _count_ property, if both are supplied in the update object). 1485 The final state MUST be valid after the Foo/set is finished, however 1486 the server may have to transition through invalid intermediate states 1487 (not exposed to the client) while processing the individual 1488 create/update/destroy requests. For example, suppose there is a 1489 "name" property that must be unique. A single method call could 1490 rename an object A => B, and simultaneously rename another object B 1491 => A. If the final state is valid, this is allowed. Otherwise, each 1492 creation, modification or destruction of an object should be 1493 processed sequentially and accepted/rejected based on the current 1494 server state. 1496 If a create, update or destroy is rejected, the appropriate error 1497 MUST be added to the notCreated/notUpdated/notDestroyed property of 1498 the response and the server MUST continue to the next create/update/ 1499 destroy. It does not terminate the method. 1501 If an id given cannot be found, the update or destroy MUST be 1502 rejected with a "notFound" set error. 1504 The server MAY skip an update (rejecting it with a "willDestroy" 1505 SetError) if that object is destroyed in the same /set request. 1507 Some records may hold references to other records (foreign keys). 1508 That reference may be set (via create or update) in the same request 1509 as the referenced record is created. To do this, the client refers 1510 to the new record using its creation id prefixed with a "#". The 1511 order of the method calls in the request by the client MUST be such 1512 that the record being referenced is created in the same or an earlier 1513 call. The server thus never has to look ahead. Instead, while 1514 processing a request the server MUST keep a simple map for the 1515 duration of the request of creation id to record id for each newly 1516 created record, so it can substitute in the correct value if 1517 necessary in later method calls. In the case of records with 1518 references to the same type, the server MUST order the creates and 1519 updates within a single method call so that creates happen before 1520 their creation ids are referenced by another create/update/destroy in 1521 the same call. 1523 Creation ids are not scoped by type but are a single map for all 1524 types. A client SHOULD NOT reuse a creation id anywhere in the same 1525 API request. If a creation id is reused, the server MUST map the 1526 creation id to the most recently created item with that id. To allow 1527 easy proxying of API requests, an initial set of creation id to real 1528 id values may be passed with a request (see The Request object in 1529 section 3.2) and the final state of the map passed out with the 1530 response (see section 3.3). 1532 The response has the following arguments: 1534 o *accountId*: "Id" The id of the account used for the call. 1536 o *oldState*: "String|null" The state string that would have been 1537 returned by _Foo/get_ before making the requested changes, or 1538 "null" if the server doesn't know what the previous state string 1539 was. 1541 o *newState*: "String" The state string that will now be returned by 1542 _Foo/get_. 1544 o *created*: "Id[Foo]|null" A map of the creation id to an object 1545 containing any properties of the created Foo object that were not 1546 sent by the client. This includes all server-set properties (such 1547 as the _id_ in most object types) and any properties that were 1548 omitted by the client and so set to a default by the server. This 1549 argument is "null" if no Foo objects were successfully created. 1551 o *updated*: "Id[Foo|null]|null" The _keys_ in this map are the ids 1552 of all Foos that were successfully updated. The _value_ for each 1553 id is a Foo object containing any property that changed in a way 1554 _not_ explicitly requested by the _PatchObject_ sent to the 1555 server, or "null" if none. This lets the client know of any 1556 changes to server-set or computed properties. This argument is 1557 "null" if no Foo objects were successfully updated. 1559 o *destroyed*: "Id[]|null" A list of Foo ids for records that were 1560 successfully destroyed, or "null" if none. 1562 o *notCreated*: "Id[SetError]|null" A map of creation id to a 1563 SetError object for each record that failed to be created, or 1564 "null" if all successful. 1566 o *notUpdated*: "Id[SetError]|null" A map of Foo id to a SetError 1567 object for each record that failed to be updated, or "null" if all 1568 successful. 1570 o *notDestroyed*: "Id[SetError]|null" A map of Foo id to a SetError 1571 object for each record that failed to be destroyed, or "null" if 1572 all successful. 1574 A *SetError* object has the following properties: 1576 o *type*: "String" The type of error. 1578 o *description*: "String|null" A description of the error to help 1579 debug with an explanation of what the problem was. This is a non- 1580 localised string, and is not intended to be shown directly to end 1581 users. 1583 The following SetError types are defined and may be returned for set 1584 operations on any record type where appropriate: 1586 o "forbidden": (create; update; destroy) The create/update/destroy 1587 would violate an ACL or other permissions policy. 1589 o "overQuota": (create; update) The create would exceed a server- 1590 defined limit on the number or total size of objects of this type. 1592 o "tooLarge": (create; update) The create/update would result in an 1593 object that exceeds a server-defined limit for the maximum size of 1594 a single object of this type. 1596 o "rateLimit": (create) Too many objects of this type have been 1597 created recently, and a server-defined rate limit has been 1598 reached. It may work if tried again later. 1600 o "notFound": (update; destroy) The id given to update/destroy 1601 cannot be found. 1603 o "invalidPatch": (update) The PatchObject given to update the 1604 record was not a valid patch (see the patch description). 1606 o "willDestroy" (update) The client requested an object be both 1607 updated and destroyed in the same /set request, and the server has 1608 decided to therefore ignore the update. 1610 o "invalidProperties": (create; update) The record given is invalid 1611 in some way. For example: 1613 * It contains properties which are invalid according to the type 1614 specification of this record type. 1616 * It contains a property that may only be set by the server (e.g. 1617 "id") and is different to the current value. Note, to allow 1618 clients to pass whole objects back, it is not an error to 1619 include a server-set property in an update so long as the value 1620 is identical to the current value on the server. 1622 * There is a reference to another record (foreign key) and the 1623 given id does not correspond to a valid record. 1625 The SetError object SHOULD also have a property called 1626 _properties_ of type "String[]" that lists *all* the properties 1627 that were invalid. Individual methods MAY specify more specific 1628 errors for certain conditions that would otherwise result in an 1629 invalidProperties error. If the condition of one of these is met, 1630 it MUST be returned instead of the invalidProperties error. 1632 o "singleton": (create; destroy) This is a singleton type, so you 1633 cannot create another one or destroy the existing one. 1635 Other possible SetError types MAY be given in specific method 1636 descriptions. Other properties MAY also be present on the _SetError_ 1637 object, as described in the relevant methods. 1639 The following additional errors may be returned instead of the _Foo/ 1640 set_ response: 1642 "requestTooLarge": The total number of objects to create, update or 1643 destroy exceeds the maximum number the server is willing to process 1644 in a single method call. 1646 "stateMismatch": An "ifInState" argument was supplied and it does not 1647 match the current state. 1649 5.4. /copy 1651 The only way to move Foo records *between* two different accounts is 1652 to copy them using the _Foo/copy_ method, then once the copy has 1653 succeeded, delete the original. The _onSuccessDestroyOriginal_ 1654 argument allows you to try to do this in one method call, however 1655 note that the two different actions are not atomic, and so it is 1656 possible for the copy to succeed but the original not to be destroyed 1657 for some reason. 1659 The copy is conceptually in three phases: 1661 1. Reading the current values from the "from" account. 1663 2. Writing the new copies to the other account. 1665 3. Destroying the originals in the "from" account, if requested. 1667 Data may change in between phases due to concurrent requests. 1669 The _Foo/copy_ method takes the following arguments: 1671 o *fromAccountId*: "Id" The id of the account to copy records from. 1673 o *ifFromInState*: "String|null" This is a state string as returned 1674 by the _Foo/get_ method. If supplied, the string must match the 1675 current state of the account referenced by the fromAccountId when 1676 reading the data to be copied, otherwise the method will be 1677 aborted and a "stateMismatch" error returned. If "null", the data 1678 will be read from the current state. 1680 o *accountId*: "Id" The id of the account to copy records to. This 1681 MUST be different to the "fromAccountId". 1683 o *ifInState*: "String|null" This is a state string as returned by 1684 the _Foo/get_ method. If supplied, the string must match the 1685 current state of the account referenced by the accountId, 1686 otherwise the method will be aborted and a "stateMismatch" error 1687 returned. If "null", any changes will be applied to the current 1688 state. 1690 o *create*: "Id[Foo]" A map of _creation id_ to a Foo object. The 1691 object MUST contain an id property: the id (in the fromAccount) of 1692 the record to be copied. Any other properties included are used 1693 instead of the current value for that property on the original 1694 when creating the copy. 1696 o *onSuccessDestroyOriginal*: "Boolean" (default: false) If "true", 1697 an attempt will be made to destroy the original records that were 1698 successfully copied: after emitting the _Foo/copy_ response, but 1699 before processing the next method, the server MUST make a single 1700 call to _Foo/set_ to destroy the original of each successfully 1701 copied record; the output of this is added to the responses as 1702 normal to be returned to the client. 1704 o *destroyFromIfInState*: "String|null" This argument is passed on 1705 as the "ifInState" argument to the implicit _Foo/set_ call, if 1706 made at the end of this request. 1708 Each record copy is considered an atomic unit which may succeed or 1709 fail individually. 1711 The response has the following arguments: 1713 o *fromAccountId*: "Id" The id of the account records were copied 1714 from. 1716 o *accountId*: "Id" The id of the account records were copied to. 1718 o *oldState*: "String|null" The state string that would have been 1719 returned by _Foo/get_ on the account records were copied to before 1720 making the requested changes, or "null" if the server doesn't know 1721 what the previous state string was. 1723 o *newState*: "String" The state string that will now be returned by 1724 _Foo/get_ on the account records were copied to. 1726 o *created*: "Id[Foo]|null" A map of the creation id to an object 1727 containing any properties of the copied Foo object that are set by 1728 the server (such as the _id_ in most object types; note, the id is 1729 likely to be different to the id of the object in the account it 1730 was copied from). This argument is "null" if no Foo objects were 1731 successfully copied. 1733 o *notCreated*: "Id[SetError]|null" A map of creation id to a 1734 SetError object for each record that failed to be copied, "null" 1735 if none. 1737 The *SetError* may be any of the standard set errors that may be 1738 returned for a _create_ or _update_. In addition, the following 1739 SetError is defined: 1741 "alreadyExists": The server forbids duplicates and the record already 1742 exists in the target account. An _existingId_ property of type "Id" 1743 MUST be included on the error object with the id of the existing 1744 record. 1746 The following additional errors may be returned instead of the _Foo/ 1747 copy_ response: 1749 "fromAccountNotFound": The _fromAccountId_ does not correspond to a 1750 valid account. 1752 "fromAccountNotSupportedByMethod": The _fromAccountId_ given 1753 corresponds to a valid account, but the account does not support this 1754 data type. 1756 "stateMismatch": An "ifInState" argument was supplied and it does not 1757 match the current state, or an "ifFromInState" argument was supplied 1758 and it does not match the current state in the from account. 1760 5.5. /query 1762 For data sets where the total amount of data is expected to be very 1763 small, clients can just fetch the complete set of data and then do 1764 any sorting/filtering locally. However, for large data sets (e.g. 1765 multi-gigabyte mailboxes), the client needs to be able to 1766 search/sort/window the data type on the server. 1768 A query on the set of Foos in an account is made by calling _Foo/ 1769 query_. This takes a number of arguments to determine which records 1770 to include, how they should be sorted, and which part of the result 1771 should be returned (the full list may be _very_ long). The result is 1772 returned as a list of Foo ids. 1774 A call to _Foo/query_ takes the following arguments: 1776 o *accountId*: "Id" The id of the account to use. 1778 o *filter*: "FilterOperator|FilterCondition|null" Determines the set 1779 of Foos returned in the results. If "null", all objects in the 1780 account of this type are included in the results. A 1781 *FilterOperator* object has the following properties: 1783 * *operator*: "String" This MUST be one of the following strings: 1784 "AND" / "OR" / "NOT": 1786 + *AND*: all of the conditions must match for the filter to 1787 match. 1789 + *OR*: at least one of the conditions must match for the 1790 filter to match. 1792 + *NOT*: none of the conditions must match for the filter to 1793 match. 1795 * *conditions*: "(FilterOperator|FilterCondition)[]" The 1796 conditions to evaluate against each record. 1798 A *FilterCondition* is an "object" whose allowed properties and 1799 semantics depend on the data type and is defined in the _/query_ 1800 method specification for that type. It MUST NOT have an 1801 _operator_ property. 1803 o *sort*: "Comparator[]|null" Lists the names of properties to 1804 compare between two Foo records, and how to compare them, to 1805 determine which comes first in the sort. If two Foo records have 1806 an identical value for the first comparator, the next comparator 1807 will be considered and so on. If all comparators are the same 1808 (this includes the case where an empty array or "null" is given as 1809 the _sort_ argument), the sort order is server-dependent, but MUST 1810 be stable between calls to Foo/query. A *Comparator* has the 1811 following properties: 1813 * *property*: "String" The name of the property on the Foo 1814 objects to compare. 1816 * *isAscending*: "Boolean" (optional; default: true) If "true", 1817 sort in ascending order. If "false", reverse the comparator's 1818 results to sort in descending order. 1820 * *collation*: "String" (optional; default is server-dependent) 1821 The identifier, as registered in the collation registry defined 1822 in [RFC4790], for the algorithm to use when comparing the order 1823 of strings. The algorithms the server supports are advertised 1824 in the capabilities object returned with the JMAP Session 1825 object. If omitted, the default algorithm is server-dependent, 1826 but: 1828 1. It MUST be unicode-aware. 1830 2. It MAY be selected based on an Accept-Language header in 1831 the request (as defined in [RFC7231] section 5.3.5), or 1832 out-of-band information about the user's language/locale. 1834 3. It SHOULD be case-insensitive where such a concept makes 1835 sense for a language/locale. Where the user's language is 1836 unknown, it is RECOMMENDED to follow the advice in section 1837 5.2.3 of [RFC8264]. 1839 The "i;unicode-casemap" collation ([RFC5051]) and the Unicode 1840 Collation Algorithm () 1841 are two examples that fulfil these criterion and provide 1842 reasonable behaviour for a large number of languages. When the 1843 property being compared is not a string, the _collation_ 1844 property is ignored and the following comparison rules apply 1845 based on the type. In ascending order: 1847 + "Boolean": "false" comes before "true". 1849 + "Number": A lower number comes before a higher number. 1851 + "Date"/"UTCDate": The earlier date comes first. 1853 The Comparator object may also have additional properties as 1854 required for specific sort operations defined in a type's /query 1855 method. 1857 o *position*: "Int" (default: 0) The 0-based index of the first id 1858 in the full list of results to return. If a negative value is 1859 given, it is an offset from the end of the list. Specifically, 1860 the negative value MUST be added to the total number of results 1861 given the filter, and if still negative clamped to "0". This is 1862 now the 0-based index of the first id to return. If the index is 1863 greater than or equal to the total number of objects in the 1864 results list then the _ids_ array in the response will be empty, 1865 but this is not an error. 1867 o *anchor*: "Id|null" A Foo id. If supplied the _position_ argument 1868 is ignored. The index of this id in the results will be used in 1869 combination with the "anchorOffset" argument to determine the 1870 index of the first result to return (see below for more details). 1872 o *anchorOffset*: "Int" (default: 0) The index of the first result 1873 to return relative to the index of the anchor, if an anchor is 1874 given. This MAY be negative. For example, "-1" means the Foo 1875 immediately preceding the anchor is the first result in the list 1876 returned (see below for more details). 1878 o *limit*: "UnsignedInt|null" The maximum number of results to 1879 return. If "null", no limit presumed. The server MAY choose to 1880 enforce a maximum "limit" argument. In this case, if a greater 1881 value is given (or if it is "null"), the limit is clamped to the 1882 maximum; the new limit is returned with the response so the client 1883 is aware. If a negative value is given, the call MUST be rejected 1884 with an "invalidArguments" error. 1886 o *calculateTotal*: "Boolean" (default: false) Does the client wish 1887 to know the total number of results in the query? This may be 1888 slow and expensive for servers to calculate, particularly with 1889 complex filters, so clients should take care to only request the 1890 total when needed. 1892 If an *anchor* argument is given, then after filtering and sorting 1893 the anchor is looked for in the results. If found, the *anchor 1894 offset* is then added to its index. If the resulting index is now 1895 negative, it is clamped to 0. This index is now used exactly as 1896 though it were supplied as the "position" argument. If the anchor is 1897 not found, the call is rejected with an "anchorNotFound" error. 1899 If an _anchor_ is specified, any position argument supplied by the 1900 client MUST be ignored. If no _anchor_ is supplied, any anchor 1901 offset argument MUST be ignored. 1903 A client can use _anchor_ instead of _position_ to find the index of 1904 an id within a large set of results. 1906 The response has the following arguments: 1908 o *accountId*: "Id" The id of the account used for the call. 1910 o *queryState*: "String" A string encoding the current state of the 1911 query on the server. This string MUST change if the results of 1912 the query (i.e. the matching ids and their sort order) have 1913 changed. The queryState string MAY change if something has 1914 changed on the server which means the results may have changed but 1915 the server doesn't know for sure. The queryState string only 1916 represents the ordered list of ids that match the particular query 1917 (including its sort/filter). There is no requirement for it to 1918 change if a property on an object matching the query changes but 1919 the query results are unaffected (indeed, it is more efficient if 1920 the queryState string does not change in this case). The 1921 queryState string only has meaning when compared to future 1922 responses to a query with the same type/sort/filter, or when used 1923 with /queryChanges to fetch changes. Should a client receive back 1924 a response with a different queryState string to a previous call 1925 it MUST either throw away the currently cached query and fetch it 1926 again (note, this does not require fetching the records again, 1927 just the list of ids) or call _Foo/queryChanges_ to get the 1928 difference. 1930 o *canCalculateChanges*: "Boolean" This is "true" if the server 1931 supports calling _Foo/queryChanges_ with these "filter"/"sort" 1932 parameters. Note, this does not guarantee that the _Foo/ 1933 queryChanges_ call will succeed, as it may only be possible for a 1934 limited time afterwards due to server internal implementation 1935 details. 1937 o *position*: "UnsignedInt" The 0-based index of the first result in 1938 the "ids" array within the complete list of query results. 1940 o *ids*: "Id[]" The list of ids for each foo in the query results, 1941 starting at the index given by the _position_ argument of this 1942 response, and continuing until it hits the end of the results or 1943 reaches the "limit" number of ids. If _position_ is >= _total_, 1944 this MUST be the empty list. 1946 o *total*: "UnsignedInt" (only if requested) The total number of 1947 foos in the results (given the _filter_). This argument MUST be 1948 omitted if the _calculateTotal_ request argument is not "true". 1950 o *limit*: "UnsignedInt" (if set by the server) The limit enforced 1951 by the server on the maximum number of results to return. This is 1952 only returned if the server set a limit, or used a different limit 1953 to that given in the request. 1955 The following additional errors may be returned instead of the _Foo/ 1956 query_ response: 1958 "anchorNotFound": An anchor argument was supplied, but it cannot be 1959 found in the results of the query. 1961 "unsupportedSort": The _sort_ is syntactically valid, but includes a 1962 property the server does not support sorting on, or a collation 1963 method it does not recognise. 1965 "unsupportedFilter": The _filter_ is syntactically valid, but the 1966 server cannot process it. If the filter was the result of a user's 1967 search input, the client SHOULD suggest the user simplify their 1968 search. 1970 5.6. /queryChanges 1972 The "Foo/queryChanges" method allows a client to efficiently update 1973 the state of a cached query to match the new state on the server. It 1974 takes the following arguments: 1976 o *accountId*: "Id" The id of the account to use. 1978 o *filter*: "FilterOperator|FilterCondition|null" The filter 1979 argument that was used with _Foo/query_. 1981 o *sort*: "Comparator[]|null" The sort argument that was used with 1982 _Foo/query_. 1984 o *sinceQueryState*: "String" The current state of the query in the 1985 client. This is the string that was returned as the _queryState_ 1986 argument in the _Foo/query_ response with the same sort/filter. 1987 The server will return the changes made to the query since this 1988 state. 1990 o *maxChanges*: "UnsignedInt|null" The maximum number of changes to 1991 return in the response. See error descriptions below for more 1992 details. 1994 o *upToId*: "Id|null" The last (highest-index) id the client 1995 currently has cached from the query results. When there are a 1996 large number of results, in a common case the client may have only 1997 downloaded and cached a small subset from the beginning of the 1998 results. If the sort and filter are both only on immutable 1999 properties, this allows the server to omit changes after this 2000 point in the results, which can significantly increase efficiency. 2001 If they are not immutable, this argument is ignored. 2003 o *calculateTotal*: "Boolean" (default: false) Does the client wish 2004 to know the total number of results now in the query? This may be 2005 slow and expensive for servers to calculate, particularly with 2006 complex filters, so clients should take care to only request the 2007 total when needed. 2009 The response has the following arguments: 2011 o *accountId*: "Id" The id of the account used for the call. 2013 o *oldQueryState*: "String" This is the "sinceQueryState" argument 2014 echoed back; the state from which the server is returning changes. 2016 o *newQueryState*: "String" This is the state the query will be in 2017 after applying the set of changes to the old state. 2019 o *total*: "UnsignedInt" (only if requested) The total number of 2020 foos in the results (given the _filter_). This argument MUST be 2021 omitted if the _calculateTotal_ request argument is not "true". 2023 o *removed*: "Id[]" The _id_ for every foo that was in the query 2024 results in the old state and is not in the results in the new 2025 state. If the server cannot calculate this exactly, the server 2026 MAY return extra foos in addition that may have been in the old 2027 results but are not in the new results. If the sort and filter 2028 are both only on immutable properties and an _upToId_ is supplied 2029 and exists in the results, any ids that were removed but have a 2030 higher index than _upToId_ SHOULD be omitted. If the _filter_ or 2031 _sort_ includes a mutable property, the server MUST include all 2032 foos in the current results for which this property may have 2033 changed. The position of these may have moved in the results so 2034 must be reinserted by the client to ensure its query cache is 2035 correct. 2037 o *added*: "AddedItem[]" The id and index in the query results (in 2038 the new state) for every foo that has been added to the results 2039 since the old state AND every foo in the current results that was 2040 included in the _removed_ array (due to a filter or sort based 2041 upon a mutable property). If the sort and filter are both only on 2042 immutable properties and an _upToId_ is supplied and exists in the 2043 results, any ids that were added but have a higher index than 2044 _upToId_ SHOULD be omitted. The array MUST be sorted in order of 2045 index, lowest index first. An *AddedItem* object has the 2046 following properties: 2048 * *id*: "Id" 2050 * *index*: "UnsignedInt" 2052 The result of this is that if the client has a cached sparse array of 2053 foo ids corresponding to the results in the old state: 2055 fooIds = [ "id1", "id2", null, null, "id3", "id4", null, null, null ] 2057 then if it *splices out* all ids in the removed array that it has in 2058 its cached results: 2060 removed = [ "id2", "id31", ... ]; 2061 fooIds => [ "id1", null, null, "id3", "id4", null, null, null ] 2063 and *splices in* (one-by-one in order, starting with the lowest 2064 index) all of the ids in the added array: 2066 added = [{ id: "id5", index: 0, ... }]; 2067 fooIds => [ "id5", "id1", null, null, "id3", "id4", null, null, null ] 2069 and *truncates* or *extends* to the new total length, then the 2070 results will now be in the new state. 2072 Note: splicing in adds the item at the given index, incrementing the 2073 index of all items previously at that or a higher index. Splicing 2074 out is the inverse, removing the item and decrementing the index of 2075 every item after it in the array. 2077 The following additional errors may be returned instead of the _Foo/ 2078 queryChanges_ response: 2080 "tooManyChanges": There are more changes than the client's 2081 _maxChanges_ argument. Each item in the removed or added array is 2082 considered as one change. The client may retry with a higher max 2083 changes or invalidate its cache of the query results. 2085 "cannotCalculateChanges": The server cannot calculate the changes 2086 from the queryState string given by the client. Usually due to the 2087 client's state being too old. The client MUST invalidate its cache 2088 of the query results. 2090 5.7. Examples 2092 Suppose we have a type _Todo_ with the following properties: 2094 o *id*: "Id" (immutable; server-set) The id of the object. 2096 o *title*: "String" A brief summary of what is to be done. 2098 o *keywords*: "String[Boolean]" (default: {}) A set of keywords that 2099 apply to the todo. The set is represented as an object, with the 2100 keys being the _keywords_. The value for each key in the object 2101 MUST be "true". (This format allows you to update an individual 2102 key using patch syntax rather than having to update the whole set 2103 of keywords as one, which an "String[]" representation would 2104 require.) 2106 o *neuralNetworkTimeEstimation*: "Number" (server-set) The title and 2107 keywords are fed into the server's state-of-the-art neural network 2108 to get an estimation of how long this todo will take, in seconds. 2110 o *subTodoIds*: "Id[]|null" The ids of a list of subtodos to 2111 complete as part of this todo. 2113 Suppose also that all the standard methods are defined for this type, 2114 and the FilterCondition object supports a "hasKeyword" property to 2115 match todos with the given keyword. 2117 A client might want to display the list of todos with either a 2118 "music" keyword or a "video" keyword, so it makes the following 2119 method call: 2121 [[ "Todo/query", { 2122 "accountId": "x", 2123 "filter": { 2124 "operator": "OR", 2125 "conditions": [ 2126 { "hasKeyword": "music" }, 2127 { "hasKeyword": "video" } 2128 ] 2129 }, 2130 "sort": [{ "property": "title" }], 2131 "position": 0, 2132 "limit": 10 2133 }, "0" ], 2134 [ "Todo/get", { 2135 "accountId": "x", 2136 "#ids": { 2137 "resultOf": "0", 2138 "name": "Todo/query", 2139 "path": "/ids" 2140 } 2141 }, "1" ]] 2143 This would query the server for the set of todos with a keyword of 2144 either "music" or "video", sorted by title, and limited to the first 2145 10 results. It fetches the full object for each of these Todos using 2146 back-references to reference the result of the query. The response 2147 might look something like: 2149 [[ "Todo/query", { 2150 "accountId": "x", 2151 "queryState": "y13213", 2152 "canCalculateChanges": true, 2153 "position": 0, 2154 "ids": [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" ] 2155 }, "0" ], 2156 [ "Todo/get", { 2157 "accountId": "x", 2158 "state": "10324", 2159 "list": [{ 2160 "id": "a", 2161 "title": "Practise Piano", 2162 "keywords": { 2163 "music": true, 2164 "beethoven": true, 2165 "mozart": true, 2166 "liszt": true, 2167 "rachmaninov": true 2168 }, 2169 "neuralNetworkTimeEstimation": 3600 2170 }, { 2171 "id": "b", 2172 "title": "Watch Daft Punk music video", 2173 "keywords": { 2174 "music": true, 2175 "video": true, 2176 "trance": true 2177 }, 2178 "neuralNetworkTimeEstimation": 18000 2179 }, 2180 ... 2181 ] 2182 }, "1" ]] 2184 Now suppose the user adds a keyword "chopin" and removes the keyword 2185 "mozart" from the "Practise Piano" task. The client may send the 2186 whole object to the server, as this is a valid PatchObject: 2188 [[ "Todo/set", { 2189 "accountId": "x", 2190 "ifInState": "10324", 2191 "update": { 2192 "a": { 2193 "id": "a", 2194 "title": "Practise Piano", 2195 "keywords": { 2196 "music": true, 2197 "beethoven": true, 2198 "chopin": true, 2199 "liszt": true, 2200 "rachmaninov": true 2201 }, 2202 "neuralNetworkTimeEstimation": 360 2203 } 2204 } 2205 }, "0" ]] 2207 or it may send a minimal patch: 2209 [[ "Todo/set", { 2210 "accountId": "x", 2211 "ifInState": "10324", 2212 "update": { 2213 "a": { 2214 "keywords/chopin": true, 2215 "keywords/mozart": null 2216 } 2217 } 2218 }, "0" ]] 2220 The effect is exactly the same on the server in either case, and 2221 presuming the server is still in state "10324" it will probably 2222 return success: 2224 [[ "Todo/set", { 2225 "accountId": "x", 2226 "oldState": "10324", 2227 "newState": "10329", 2228 "updated": { 2229 "a": { 2230 "neuralNetworkTimeEstimation": 5400 2231 } 2232 } 2233 }, "0" ]] 2235 The server changed the "neuralNetworkTimeEstimation" property on the 2236 object as part of this change; as this changed in a way _not_ 2237 explicitly requested by the PatchObject sent to the server, it is 2238 returned with the "updated" confirmation. 2240 Let us now add a subtodo to our new "Practice Piano" todo. In this 2241 example we can see the use of a reference to a creation id to allow 2242 us to set a foreign key reference to a record created in the same 2243 request: 2245 [[ "Todo/set", { 2246 "accountId": "x", 2247 "create": { 2248 "k15": { 2249 "title": "Warm up with scales" 2250 } 2251 }, 2252 "update": { 2253 "a": { 2254 "subTodoIds": [ "#k15" ] 2255 } 2256 } 2257 }, "0" ]] 2259 Now, suppose another user deleted the "Listen to Daft Punk" todo. 2260 The first user will receive a push notification (see section 7) with 2261 the changed state string for the "Todo" type. Since the new string 2262 does not match its current state, it knows it needs to check for 2263 updates. It may make a request like: 2265 [[ "Todo/changes", { 2266 "accountId": "x", 2267 "sinceState": "10324", 2268 "maxChanges": 50 2269 }, "0" ], 2270 [ "Todo/queryChanges", { 2271 "accountId": "x", 2272 "filter": { 2273 "operator": "OR", 2274 "conditions": [ 2275 { "hasKeyword": "music" }, 2276 { "hasKeyword": "video" } 2277 ] 2278 }, 2279 "sort": [{ "property": "title" }], 2280 "sinceQueryState": "y13213", 2281 "maxChanges": 50 2282 }, "1" ]] 2284 and receive in response: 2286 [[ "Todo/changes", { 2287 "accountId": "x", 2288 "oldState": "10324", 2289 "newState": "871903", 2290 "hasMoreChanges": false, 2291 "created": [], 2292 "updated": [], 2293 "destroyed": ["b"] 2294 }, "0" ], 2295 [ "Todo/queryChanges", { 2296 "accountId": "x", 2297 "oldQueryState": "y13213", 2298 "newQueryState": "y13218", 2299 "removed": ["b"], 2300 "added": null 2301 }, "1" ]] 2303 Suppose the user has access to another account "y", for example a 2304 team account shared between multiple users. To move an existing Todo 2305 from account "x", the client would call: 2307 [[ "Todo/copy", { 2308 "fromAccountId": "x", 2309 "accountId": "y", 2310 "create": { 2311 "k5122": { 2312 "id": "a" 2313 } 2314 }, 2315 "onSuccessDestroyOriginal": true 2316 }, "0" ]] 2318 The server successfully copies the Todo to a new account (where it 2319 receives a new id) and deletes the original. Due to the implicit 2320 call to "Todo/set", there are two responses to the single method 2321 call, both with the same method call id: 2323 [[ "Todo/copy", { 2324 "fromAccountId": "x", 2325 "accountId": "y", 2326 "created": { 2327 "k5122": { 2328 "id": "DAf97" 2329 } 2330 }, 2331 "oldState": "c1d64ecb038c", 2332 "newState": "33844835152b" 2333 }, "0" ], 2334 [ "Todo/set", { 2335 "accountId": "x", 2336 "oldState": "871903", 2337 "newState": "871909", 2338 "destroyed": [ "a" ], 2339 ... 2340 }, "0" ]] 2342 5.8. Proxy considerations 2344 JMAP has been designed to allow an API endpoint to easily proxy 2345 through to one or more JMAP servers. This may be useful for load 2346 balancing, augmenting capabilities, or presenting a single endpoint 2347 to accounts hosted on different JMAP servers (splitting the request 2348 based on each method's "accountId" argument). The proxy need only 2349 understand the general structure of a JMAP Request object, it does 2350 not need to know anything specifically about the methods and 2351 arguments it will pass through to other servers. 2353 If splitting up the methods in a request to call them on different 2354 backend servers, the proxy must do two things to ensure back- 2355 references and creation id references resolve the same as if the 2356 entire request were processed on a single server: 2358 1. It must pass a "createdIds" property with each subrequest. If 2359 this is not given by the client, an empty object should be used 2360 for the first subrequest. The "createdIds" property of each 2361 subresponse should be passed on in the next subrequest. 2363 2. It must resolve back-references to previous method results that 2364 were processed on a different server. This is a relatively 2365 simple syntactic substitution, described in section 3.6. 2367 When splitting a request based on accountId, proxy implementors do 2368 need to be aware of "/copy" methods, that copy between accounts. If 2369 the accounts are on different servers, the proxy will have to 2370 implement this functionality directly. 2372 6. Binary data 2374 Binary data is referenced by a _blobId_ in JMAP, and uploaded/ 2375 downloaded separately to the core API. The blobId solely represents 2376 the raw bytes of data, not any associated metadata such as a file 2377 name or content type. Such metadata is stored alongside the blobId 2378 in the object referencing it. The data represented by a blobId is 2379 immutable. 2381 Any blobId that exists within an account may be used when creating/ 2382 updating another object in that account. For example, an Email type 2383 may have a blobId that represents the [RFC5322] representation of the 2384 message. A client could create a new Email object with an attachment 2385 and use this blobId, in effect attaching the old message to the new 2386 one. Similarly it could attach any existing attachment of an old 2387 message without having to download and upload it again. 2389 When the client uses a blobId in a create/update, the server MAY 2390 assign a new blobId to refer to the same binary data within the new/ 2391 updated object. If it does so, it MUST return any properties that 2392 contain a changed blobId in the created/updated response so the 2393 client gets the new ids. 2395 A blob that is not referenced by a JMAP object (e.g. as a message 2396 attachment) MAY be deleted by the server to free up resources. 2397 Uploads (see below) are initially unreferenced blobs. To ensure 2398 interoperability: 2400 o The server SHOULD use a separate quota for unreferenced blobs to 2401 the accounts's usual quota. This quota SHOULD be separate per 2402 user in the case of shared accounts. 2404 o This quota SHOULD be at least the maximum total size that a single 2405 object can reference on this server. For example, if supporting 2406 JMAP Mail, this should be at least the maximum total attachments 2407 size for a message. 2409 o When an upload would take the user over quota, the server MUST 2410 delete unreferenced blobs in date order, oldest first, until there 2411 is room for the new blob. 2413 o Except where quota restrictions force early deletion, an 2414 unreferenced blob MUST NOT be deleted for at least 1 hour from the 2415 time of upload; if reuploaded, the same blobId MAY be returned, 2416 but this SHOULD reset the expiry time. 2418 o A blob MUST NOT be deleted during the method call which removed 2419 the last reference, so that a client can issue a create and a 2420 destroy that both reference the blob within the same method call. 2422 6.1. Uploading binary data 2424 There is a single endpoint which handles all file uploads for an 2425 account, regardless of what they are to be used for. The JMAP 2426 Session object has an _uploadUrl_ property in [RFC6570] URI Template 2427 (level 1) format, which MUST contain a variable called "accountId". 2428 The client may use this template in combination with an _accountId_ 2429 to get the URL of the file upload resource. 2431 To upload a file, the client submits an authenticated POST request to 2432 the file upload resource. 2434 A successful request MUST return a single JSON object with the 2435 following properties as the response: 2437 o *accountId*: "Id" The id of the account used for the call. 2439 o *blobId*: "Id", The id representing the binary data uploaded. The 2440 data for this id is immutable. The id _only_ refers to the binary 2441 data, not any metadata. 2443 o *type*: "String" The media type of the file (as specified in 2444 [RFC6838], section 4.2) as set in the Content-Type header of the 2445 upload HTTP request. 2447 o *size*: "UnsignedInt" The size of the file in octets. 2449 If identical binary content to an existing blob in the account is 2450 uploaded, the existing blobId MAY be returned. 2452 Clients should use the blobId returned in a timely manner. Under 2453 rare circumstances the server may have deleted the blob before the 2454 client uses it; the client should keep a reference to the local file 2455 so it can upload it again in such a situation. 2457 When an HTTP error response is returned to the client, the server 2458 SHOULD return a JSON "problem details" object as the response body, 2459 as per [RFC7807]. 2461 As access controls are often determined by the object holding the 2462 reference to a blob, unreferenced blobs MUST only be accessible to 2463 the uploader, even in shared accounts. 2465 6.2. Downloading binary data 2467 The JMAP Session object has a _downloadUrl_ property, which is in 2468 [RFC6570] URI Template (level 1) format. The URL MUST contain 2469 variables called "accountId", "blobId", "type" and "name". 2471 To download a file, the client makes an authenticated GET request to 2472 the download URL with the appropriate variables substituted in: 2474 o "accountId": The id of the account to which the record with the 2475 blobId belongs. 2477 o "blobId": The blobId representing the data of the file to 2478 download. 2480 o "type": The type for the server to set in the "Content-Type" 2481 header of the response; the blobId only represents the binary data 2482 and does not have a content-type innately associated with it. 2484 o "name": The name for the file; the server MUST return this as the 2485 filename if it sets a "Content-Disposition" header. 2487 As the data for a particular blobId is immutable, and thus the 2488 response in the generated download URL is too, implementors are 2489 recommended to set long cache times and use the "immutable" Cache- 2490 Control extension ([RFC8246]) for a successful responses, for example 2491 "Cache-Control: private, immutable, max-age=31536000". 2493 When an HTTP error response is returned to the client, the server 2494 SHOULD return a JSON "problem details" object as the response body, 2495 as per [RFC7807]. 2497 6.3. Blob/copy 2499 Binary data may be copied *between* two different accounts using the 2500 _Blob/copy_ method, rather than having to download then re-upload on 2501 the client. 2503 The _Blob/copy_ method takes the following arguments: 2505 o *fromAccountId*: "Id" The id of the account to copy blobs from. 2507 o *accountId*: "Id" The id of the account to copy blobs to. 2509 o *blobIds*: "Id[]" A list of ids of blobs to copy to the other 2510 account. 2512 The response has the following arguments: 2514 o *fromAccountId*: "Id" The id of the account blobs were copied 2515 from. 2517 o *accountId*: "Id" The id of the account blobs were copied to. 2519 o *copied*: "Id[Id]|null" A map of the blobId in the _fromAccount_ 2520 to the id for the blob in the account it was copied to, or "null" 2521 if none were successfully copied. 2523 o *notCopied*: "Id[SetError]|null" A map of blobId to a SetError 2524 object for each blob that failed to be copied, "null" if none. 2526 The *SetError* may be any of the standard set errors that may be 2527 returned for a _create_, as defined in section 5.3. In addition, the 2528 "notFound" SetError error may be returned if the blobId to be copied 2529 cannot be found. 2531 The following additional method-level error may be returned instead 2532 of the _Blob/copy_ response: 2534 "fromAccountNotFound": The _fromAccountId_ included with the request 2535 does not correspond to a valid account. 2537 7. Push 2539 Push notifications allow clients to efficiently update (almost) 2540 instantly to stay in sync with data changes on the server. The 2541 general model for push is simple and sends minimal data over the push 2542 channel: just enough for the client to know whether it needs to 2543 resync. The format allows multiple changes to be coalesced into a 2544 single push update, and the frequency of pushes to be rate limited by 2545 the server. It doesn't matter if some push events are dropped before 2546 they reach the client; the next time it gets/sets any records of a 2547 changed type it will discover the data has changed and still sync all 2548 changes. 2550 There are two different mechanisms by which a client can receive push 2551 notifications, to allow for the different environments in which a 2552 client may exist. An event source resource (see section 7.3) allows 2553 clients that can hold transport connections open to receive push 2554 notifications directly from the JMAP server. This is simple and 2555 avoids 3rd parties, but is often not feasible on constrained 2556 platforms such as mobile devices. Alternatively, clients can make 2557 use of any push service supported by their environment. A URL for 2558 the push service is registered with the JMAP server (see section 2559 7.2), then the server then POSTs each notification to that URL. The 2560 push service is then responsible for routing these to the client. 2562 7.1. The StateChange object 2564 When something changes on the server, the server pushes a 2565 *StateChange* object to the client. A *StateChange* object has the 2566 following properties: 2568 o *@type*: "String" This MUST be the string "StateChange". 2570 o *changed*: "Id[TypeState]" A map of _account id_ to an object 2571 encoding the state of data types that have changed for that 2572 account since the last StateChange object was pushed, for each of 2573 the accounts to which the user has access and for which something 2574 has changed. A *TypeState* object is a map. The keys are the 2575 type name "Foo" (e.g. "Mailbox" or "Email"), and the value is the 2576 _state_ property that would currently be returned by a call to 2577 _Foo/get_. The client can compare the new state strings with its 2578 current values to see whether it has the current data for these 2579 types. If not, the changes can then be efficiently fetched in a 2580 single standard API request (using the _/changes_ type methods). 2582 7.1.1. Example 2584 In this example, the server has amalgamated a few changes together 2585 across two different accounts the user has access to, before pushing 2586 the following StateChange object to the client: 2588 { 2589 "@type": "StateChange", 2590 "changed": { 2591 "a3123": { 2592 "Email": "d35ecb040aab", 2593 "EmailDelivery": "428d565f2440", 2594 "CalendarEvent": "87accfac587a" 2595 }, 2596 "a43461d": { 2597 "Mailbox": "0af7a512ce70", 2598 "CalendarEvent": "7a4297cecd76" 2599 } 2600 } 2601 } 2603 The client can compare the state strings with its current state for 2604 the Email, CalendarEvent etc. object types in the appropriate 2605 accounts to see if it needs to fetch changes. 2607 If the client is itself making changes, it may receive a StateChange 2608 object while the /set API call is in flight. It can wait until the 2609 call completes and then compare if the new state string after the 2610 /set is the same as was pushed in the StateChange object; if so, and 2611 the old state of the /set response matches the client's previous 2612 state, it does not need to waste a request asking for changes it 2613 already knows. 2615 7.2. PushSubscription 2617 Clients may create a _PushSubscription_ to register a URL with the 2618 JMAP server. The JMAP server will then make an HTTP POST request to 2619 this URL for each push notification it wishes to send to the client. 2621 As a push subscription causes the JMAP server to make a number of 2622 requests to a previously unknown endpoint, it can be used as a vector 2623 for launching a denial of service attack. To prevent this, when a 2624 subscription is created the JMAP server immediately sends a 2625 PushVerification object to that URL (see section 7.2.2). The JMAP 2626 server MUST NOT make any further requests to the URL until the client 2627 receives the push and updates the subscription with the correct 2628 verification code. 2630 A *PushSubscription* object has the following properties: 2632 o *id*: "Id" (immutable; server-set) The id of the push 2633 subscription. 2635 o *deviceClientId*: "String" (immutable) An id that uniquely 2636 identifies the client + device it is running on. The purpose of 2637 this is to allow clients to identify which PushSubscription 2638 objects they created even if they lose their local state, so they 2639 can revoke or update them. This string MUST be different on 2640 different devices, and be different from apps from other vendors. 2641 It SHOULD be easy to re-generate, not depend on persisted state. 2642 It is RECOMMENDED to use a secure hash of a device id concatenated 2643 with a custom vendor/app id. To protect the privacy of the user, 2644 id MUST NOT contain an unobfuscated device id. 2646 o *url*: "String" (immutable) An absolute URL where the JMAP server 2647 will POST the data for the push message. This MUST begin with 2648 "https://". 2650 o *keys*: "Object|null" (immutable) Client-generated encryption 2651 keys. If supplied the server MUST use them as specified in 2652 [RFC8291] to encrypt all data sent to the push subscription. The 2653 object MUST have the following properties: 2655 * *p256dh*: the P-256 ECDH Diffie-Hellman public key as described 2656 in [RFC8291], encoded in URL-safe Base64 representation as 2657 defined in [RFC4648]. 2659 * *auth*: the authentication secret as described in [RFC8291], 2660 encoded in URL-safe Base64 representation as defined in 2661 [RFC4648]. 2663 o *verificationCode*: "String|null" This MUST be "null" (or omitted) 2664 when the subscription is created. The JMAP server then generates 2665 a verification code and sends it in a push message, and the client 2666 updates the PushSubscription object with the code; see section 2667 7.2.2 for details. 2669 o *expires*: "UTCDate|null" The time this push subscription expires. 2670 If specified, the JMAP server MUST NOT make further requests to 2671 this resource after this time. It MAY automatically destroy the 2672 push subscription at or after this time. The server MAY choose to 2673 set an expiry if none is given by the client, or modify the expiry 2674 time given by the client to a shorter duration. 2676 o *types*: "String[]|null" A list of types the client is interested 2677 in (using the same names as the keys in the _TypeState_ object 2678 defined in the previous section). A StateChange notification will 2679 only be sent if the data for one of these types changes. Other 2680 types are omitted from the TypeState object. If "null", changes 2681 will be pushed for all types. 2683 The POST request MUST have a content type of "application/json" and 2684 contain the UTF-8 JSON encoded object as the body. The request MUST 2685 have a "TTL" header, and MAY have "Urgency" and/or "Topic" headers, 2686 as specified in section 5 of [RFC8030]. The JMAP server is expected 2687 to understand and handle HTTP status responses in a reasonable 2688 manner. A "429" (Too Many Requests) response MUST cause the JMAP 2689 server to reduce the frequency of pushes; the JMAP push structure 2690 allows multiple changes to be coalesced into a single minimal 2691 StateChange object. See the security considerations in section 8.6 2692 for a discussion of the risks in connecting to unknown servers. 2694 The JMAP server acts as an Application Server as defined in 2695 [RFC8030]. A client MAY use the rest of [RFC8030] in combination 2696 with its own Push Service to form a complete end-to-end solution, or 2697 MAY rely on alternative mechanisms to ensure the delivery of the 2698 pushed data after it leaves the JMAP server. 2700 The push subscription is tied to the credentials used to authenticate 2701 the API request that created it. Should these credentials expire or 2702 be revoked, the push subscription MUST be destroyed by the JMAP 2703 server. Only subscriptions created by these credentials are returned 2704 when the client fetches existing subscriptions. 2706 When these credentials have their own expiry (i.e. it is a session 2707 with a timeout), the server SHOULD NOT set or bound the expiry time 2708 for the push subscription given by the client, but MUST expire it 2709 when the session expires. 2711 When these credentials are not time bounded (e.g. [RFC7617] Basic 2712 Authentication), the server SHOULD set an expiry time for the push 2713 subscription if none given, and limit the expiry time if set too far 2714 in the future. This maximum expiry time MUST be at least 48 hours in 2715 the future and SHOULD be at least 7 days in the future. An app 2716 running on a mobile device may only be able to refresh the push 2717 subscription lifetime when it is in the foreground, and so this gives 2718 a reasonable timeframe to allow this to happen. 2720 In the case of separate access and refresh credentials, as in 2721 [RFC6749] Oauth 2.0, the server SHOULD tie the push subscription to 2722 the validity of the refresh token rather than the access token, and 2723 behave according to whether this is time-limited or not. 2725 When a push subscription is destroyed, the server MUST securely erase 2726 the URL and encryption keys from memory and storage as soon as 2727 possible. 2729 7.2.1. PushSubscription/get 2731 Standard _/get_ method as described in section 5.1, except it does 2732 *not* take or return an _accountId_ argument, as push subscriptions 2733 are not tied to specific accounts. It also does *not* return a 2734 _state_ argument. The _ids_ argument may be "null" to fetch all at 2735 once. 2737 The server MUST only return push subscriptions that were created 2738 using the same authentication credentials as for this 2739 PushSubscription/get request. 2741 As the _url_ and _keys_ properties may contain data that is private 2742 to a particular device, the values for these properties MUST NOT be 2743 returned. If the _properties_ argument is "null" or omitted, the 2744 server MUST default to all properties excluding these two. If one of 2745 them is explicitly requested, the method call MUST be rejected with a 2746 "forbidden" error. 2748 7.2.2. PushSubscription/set 2750 Standard _/set_ method as described in section 5.3, except it does 2751 *not* take or return an _accountId_ argument, as push subscriptions 2752 are not tied to specific accounts. It also does *not* take an 2753 _ifInState_ argument or return _oldState_ or _newState_ arguments. 2755 The _url_ and _keys_ properties are immutable; if the client wishes 2756 to change these, it must destroy the current push subscription and 2757 create a new one. 2759 When a PushSubscription is created, the server MUST immediately push 2760 a *PushVerification* object to the URL. It has the following 2761 properties: 2763 o *@type*: "String" This MUST be the string "PushVerification". 2765 o *pushSubscriptionId*: "String" The id of the push subscription 2766 that was created. 2768 o *verificationCode*: "String" The verification code to add to the 2769 push subscription. This MUST contain sufficient entropy to avoid 2770 the client being able to brute force guess the code. 2772 The client MUST update the push subscription with the correct 2773 verification code before the server makes any further requests to the 2774 subscription's URL. Attempts to update the subscription with an 2775 invalid verification code MUST be rejected by the server with an 2776 "invalidProperties" SetError. 2778 The client may update the _expires_ property to extend (or, less 2779 commonly, shorten) the lifetime of a push subscription. The server 2780 MAY modify the proposed new expiry time to enforce server-defined 2781 limits. Extending the lifetime does not require the subscription to 2782 be verified again. 2784 Clients SHOULD NOT update or destroy a push subscription that they 2785 did not create (i.e. has a _deviceClientId_ that they do not 2786 recognise). 2788 7.2.3. Example 2790 At "2018-07-06T02:14:29Z", a client with deviceClientId "a889-ffea- 2791 910" fetches the set of push subscriptions currently on the server, 2792 making an API request with: 2794 [[ "PushSubscription/get", { 2795 "ids": null 2796 }, "0" ]] 2798 Which returns: 2800 [[ "PushSubscription/get", { 2801 "list": [{ 2802 "id": "e50b2c1d-9553-41a3-b0a7-a7d26b599ee1", 2803 "deviceClientId": "b37ff8001ca0", 2804 "verificationCode": "b210ef734fe5f439c1ca386421359f7b", 2805 "expires": "2018-07-31T00:13:21Z", 2806 "types": [ "Todo" ] 2807 }, { 2808 "id": "f2d0aab5-e976-4e8b-ad4b-b380a5b987e4", 2809 "deviceClientId": "X8980fc", 2810 "verificationCode": "f3d4618a9ae15c8b7f5582533786d531", 2811 "expires": "2018-07-12T05:55:00Z", 2812 "types": [ "Mailbox", "Email", "EmailDelivery" ] 2813 }], 2814 "notFound": [] 2815 }, "0" ]] 2817 Since neither of the returned push subscription objects have the 2818 client's deviceClientId, it knows it does not have a current push 2819 subscription active on the server. So it creates one, sending this 2820 request: 2822 [[ "PushSubscription/set", { 2823 "create": { 2824 "4f29": { 2825 "deviceClientId": "a889-ffea-910", 2826 "url": "https://example.com/push/?device=X8980fc&client=12c6d086", 2827 "types": null 2828 } 2829 } 2830 }, "0" ]] 2832 The server creates the push subscription but limits the expiry time 2833 to 7 days in the future, returning this response: 2835 [[ "PushSubscription/set", { 2836 "created": { 2837 "4f29": { 2838 "id": "P43dcfa4-1dd4-41ef-9156-2c89b3b19c60", 2839 "keys": null, 2840 "expires": "2018-07-13T02:14:29Z" 2841 } 2842 } 2843 }, "0" ]] 2845 The server also immediately makes a POST request to 2846 "https://example.com/push/?device=X8980fc&client=12c6d086" with the 2847 data: 2849 { 2850 "@type": "PushVerification", 2851 "pushSubscriptionId": "P43dcfa4-1dd4-41ef-9156-2c89b3b19c60", 2852 "verificationCode": "da1f097b11ca17f06424e30bf02bfa67" 2853 } 2855 The client receives this and updates the subscription with the 2856 verification code (note there is a potential race condition here; the 2857 client MUST be able to handle receiving the push while the request 2858 creating the subscription is still in progress): 2860 [[ "PushSubscription/set", { 2861 "update": { 2862 "P43dcfa4-1dd4-41ef-9156-2c89b3b19c60": { 2863 "verificationCode": "da1f097b11ca17f06424e30bf02bfa67" 2864 } 2865 } 2866 }, "0" ]] 2868 The server confirms the update was successful and will now make 2869 requests to the registered URL when the state changes. 2871 Two days later, the client updates the subscription to extend its 2872 lifetime, sending this request: 2874 [[ "PushSubscription/set", { 2875 "update": { 2876 "P43dcfa4-1dd4-41ef-9156-2c89b3b19c60": { 2877 "expires": "2018-08-13T00:00:00Z" 2878 } 2879 } 2880 }, "0" ]] 2882 The server extends the expiry time, but only again to its maximum 2883 limit of 7 days in the future, returning this response: 2885 [[ "PushSubscription/set", { 2886 "updated": { 2887 "P43dcfa4-1dd4-41ef-9156-2c89b3b19c60": { 2888 "expires": "2018-07-15T02:22:50Z" 2889 } 2890 } 2891 }, "0" ]] 2893 7.3. Event Source 2895 Clients that can hold transport connections open can connect directly 2896 to the JMAP server to receive push notifications via a "text/event- 2897 stream" resource, as described in [EventSource]. This is a long 2898 running HTTP request down which the server can push data. 2900 When a change occurs in the data on the server, it pushes an event 2901 called "state" to any connected clients, with the _StateChange_ 2902 object as the data. 2904 The server SHOULD also send a new event id that encodes the entire 2905 server state visible to the user immediately after sending a _state_ 2906 event. When a new connection is made to the event-source endpoint, a 2907 client following the server-sent events specification will send a 2908 Last-Event-ID HTTP header field with the last id it saw, which the 2909 server can use to work out whether the client has missed some 2910 changes. If so, it SHOULD send these changes immediately on 2911 connection. 2913 The JMAP Session object has an _eventSourceUrl_ property, which is in 2914 [RFC6570] URI Template (level 1) format. The URL MUST contain 2915 variables called "types", "closeafter" and "ping". 2917 To connect to the resource, the client makes an authenticated GET 2918 request to the event-source URL with the appropriate variables 2919 substituted in: 2921 o "types": This MUST be either: 2923 * A comma-separated list of type names, e.g. 2924 "Email,CalendarEvent". The server MUST only push changes for 2925 the types in this list. 2927 * The single character: "*". Changes to all types are pushed. 2929 o "closeafter": This MUST be one of the following values: 2931 * "state": The server MUST end the HTTP response after pushing a 2932 state event. This can be used by clients in environments where 2933 buffering proxies prevent the pushed data from arriving 2934 immediately, or indeed at all, when operating in the usual 2935 mode. 2937 * "no": The connection is persisted by the server as a standard 2938 event-source resource. 2940 o "ping": A positive integer value representing a length of time in 2941 seconds, e.g. "300". If non-zero, the server MUST send an event 2942 called "ping" whenever this time elapses since the previous event 2943 was sent. This MUST NOT set a new event id. If the value is "0" 2944 the server MUST NOT send ping events. The server MAY modify a 2945 requested ping interval to be subject to a minimum and/or maximum 2946 value. For interoperability, servers MUST NOT have a minimum 2947 allowed value higher than 30 or a maximum allowed value less than 2948 300. The data for the ping event MUST be a JSON object containing 2949 an _interval_ property, the value (type "UnsignedInt") being the 2950 interval in seconds the server is using to send pings (this may be 2951 different to the requested value if the server clamped it to be 2952 within a min/max value). Clients can monitor for the ping event 2953 to help determine when the closeafter mode may be required. 2955 A client MAY hold open multiple connections to the event-source 2956 resource, although it SHOULD try to use a single connection for 2957 efficiency. 2959 8. Security considerations 2961 8.1. Transport confidentiality 2963 To ensure the confidentiality and integrity of data sent and received 2964 via JMAP, all requests MUST use TLS 1.2 ([RFC5246]) or later, 2965 following the recommendations in [RFC7525]. Servers SHOULD support 2966 TLS 1.3 ([RFC8446]) or later. 2968 Clients MUST validate TLS certificate chains to protect against man- 2969 in-the-middle attacks. 2971 8.2. Authentication scheme 2973 A number of HTTP authentication schemes have been standardised 2974 (). Servers should take care to assess the security 2976 characteristics of different schemes in relation to their needs when 2977 deciding what to implement. 2979 Use of the Basic authentication scheme is NOT RECOMMENDED. Services 2980 that choose to use this are strongly recommended to require 2981 generation of a unique "app password" via some external mechanism for 2982 each client they wish to connect. This allows connections from 2983 different devices to be differentiated by the server, and access to 2984 be individually revoked. 2986 8.3. Service autodiscovery 2988 Unless secured by something like DNSSEC, DNS SRV-based autodiscovery 2989 of server details is vulnerable to a DNS poisoning attack leading to 2990 the client talking to an attacker's server instead of the real JMAP 2991 server. The attacker may then man-in-the-middle requests and 2992 depending on the authentication scheme, steal credentials to generate 2993 its own requests. 2995 Clients that do not support SRV lookups are likely to try just using 2996 the "/.well-known/jmap" path directly against the domain of the 2997 username over HTTPS. Servers SHOULD ensure this path resolves or 2998 redirects to the correct JMAP Session resource to allow this to work. 2999 If this is not feasible, servers MUST ensure this path cannot be 3000 controlled by an attacker, as again it may be used to steal 3001 credentials. 3003 8.4. JSON parsing 3005 The security considerations of [RFC8259] apply to the use of JSON as 3006 the data interchange format. 3008 8.5. Denial of service 3010 A small request may result in a very large response, and require 3011 considerable work on the server if resource limits are not enforced. 3012 JMAP provides mechanisms for advertising and enforcing a wide variety 3013 of limits for mitigating this threat, including limits on number of 3014 objects fetched in a single method call, number of methods in a 3015 single request, number of concurrent requests, etc. 3017 JMAP servers MUST implement sensible limits to mitigate against 3018 resource exhaustion attacks. 3020 8.6. Connection to unknown push server 3022 When a push subscription is registered, the application server will 3023 make POST requests to the given URL. There are a number of security 3024 considerations that MUST be considered when implementing this. 3026 The server MUST ensure the URL is externally resolvable to avoid 3027 server-side request forgery, where the server makes a request to a 3028 resource on its internal network. 3030 A malicious client may use the push subscription to attempt to flood 3031 a 3rd party server with requests, creating a denial of service attack 3032 and masking the attacker's true identity. There is no guarantee the 3033 URL that was given to the JMAP server is actually a valid push 3034 server. Upon creation of a push subscription the JMAP server sends a 3035 PushVerification object to the URL and MUST NOT send any further 3036 requests until the client verifies it has received the initial push. 3037 The verification code MUST contain sufficient entropy to prevent the 3038 client from being able to verify the subscription via brute force. 3040 The verification code does not guarantee the URL is a valid push 3041 server, only that the client is able to access the data submitted to 3042 it. While the verification step significantly reduces the set of 3043 potential targets, there is still a risk that the server is unrelated 3044 to the client and being targeted for a denial of service attack. 3046 The server MUST limit the number of push subscriptions any one user 3047 may have to ensure the user cannot cause the server to send a large 3048 number of push notifications at once, which could again be used as 3049 part of a denial-of-service attack. The rate of creation MUST also 3050 be limited to minimise the ability to abuse the verification request 3051 as an attack vector. 3053 8.7. Push encryption 3055 When data changes, a small object is pushed with the new state 3056 strings for the types that have changed. While the data here is 3057 minimal, a passive man-in-the-middle attacker may be able to gain 3058 useful information. To ensure confidentiality and integrity, if the 3059 push is sent via a third party outside of the control of the client 3060 and JMAP server the client MUST specify encryption keys when 3061 establishing the PushSubscription and ignore any push notification 3062 received that is not encrypted with those keys. 3064 The privacy and security considerations of [RFC8030] and [RFC8291] 3065 also all apply to the use of the PushSubscription mechanism. 3067 As there is no crypto algorithm agility in [RFC8291] Web Push 3068 Encryption, if new algorithms are required in the future a new 3069 specification will be needed to provide this. 3071 8.8. Traffic analysis 3073 While the data is encrypted, a passive observer with the ability to 3074 monitor network traffic may be able to glean information from the 3075 timing of API requests and push notifications. For example, suppose 3076 an email or calendar invitation is sent from User A (hosted on Server 3077 X) to User B (hosted on Server Y). If Server X hosts data for many 3078 users, a passive observer can see that the two servers connected but 3079 does not know who the data was for. However, if a push notification 3080 is immediately sent to User B and the attacker can observe this as 3081 well, they may reasonably conclude that someone on Server X is 3082 connecting to User B. 3084 9. IANA considerations 3086 9.1. Assignment of jmap service name 3088 IANA will assign the 'jmap' service name in the 'Service Name and 3089 Transport Protocol Port Number Registry' [RFC6335]. 3091 Service Name: jmap 3093 Transport Protocol(s): tcp 3095 Assignee: IESG 3097 Contact: IETF Chair 3099 Description: JSON Meta Application Protocol 3101 Reference: [I-D.ietf-jmap-core] 3103 Assignment Notes: this service name was previously assigned under the 3104 name _JSON Mail Access Protocol_. This will be de-assigned and re- 3105 assigned with the approval of the previous assignee. 3107 9.2. Registration of well-known URI suffix for JMAP 3109 IANA will register the following well-known URI suffix for JMAP as 3110 described in [RFC5785]: 3112 URI Suffix: jmap 3114 Change Controller: IETF 3116 Specification Document: [I-D.ietf-jmap-core], section 2.2. 3118 9.3. Registration of the jmap URN sub-namespace 3120 IANA will register the following URN sub-namespace in the "IETF URN 3121 Sub-namespace for Registered Protocol Parameter Identifiers" registry 3122 as described in [RFC3553]. 3124 Registered Parameter Identifier: jmap 3126 Reference: [I-D.ietf-jmap-core], next section 3127 IANA Registry Reference: {insert IANA registry URL for registry in 3128 next section, upon approval} 3130 9.4. Creation of "JMAP Capabilities" registry 3132 IANA will create a registry for JMAP capabilities as described in 3133 section 2. JMAP capabilities are advertised in the _capabilities_ 3134 property of the JMAP Session resource. They are used to extend the 3135 functionality of a JMAP server. A capability is referenced by a URI. 3136 The JMAP capability URI can be a URN starting with 3137 "urn:ietf:params:jmap:" plus a unique suffix which is the index value 3138 in the jmap URN sub-namespace. Registration of a JMAP capability 3139 with another form of URI has no impact on the jmap URN sub-namespace. 3141 This registry follows the expert review process unless the "intended 3142 use" field is _common_ or _placeholder_ in which case registration 3143 follows the specification required process. 3145 A JMAP capability registration can have an intended use of _common_, 3146 _placeholder_, _limited_, or _obsolete_. IANA will list common use 3147 registrations prominently and separately from those with other 3148 intended use values. 3150 The JMAP capability registration procedure is not a formal standards 3151 process, but rather an administrative procedure intended to allow 3152 community comment and sanity checking without excessive time delay. 3154 A _placeholder_ registration reserves part of the jmap urn namespace 3155 for another purpose but is typically not included in the 3156 _capabilities_ property of the JMAP Session resource. 3158 9.4.1. Preliminary community review 3160 Notice of a potential JMAP common use registration SHOULD be sent to 3161 the jmap@ietf.org mailing list for review. This mailing list is 3162 appropriate to solicit community feedback on a proposed JMAP 3163 capability. Registrations that are not intended for common use MAY 3164 be sent to the list for review as well; doing so is entirely 3165 OPTIONAL, but is encouraged. 3167 The intent of the public posting to this list is to solicit comments 3168 and feedback on the choice of capability name, the unambiguity of the 3169 specification document, and a review of any interoperability or 3170 security considerations. The submitter may submit a revised 3171 registration proposal or abandon the registration completely and at 3172 any time. 3174 9.4.2. Submit request to IANA 3176 Registration requests can be sent to iana@iana.org. 3178 9.4.3. Designated expert review 3180 For a limited use registration, the designated expert's (DE) primary 3181 concern is preventing name collisions and encouraging the submitter 3182 to document security and privacy considerations; a published 3183 specification is not required. For a common use registration, the DE 3184 is expected to confirm that suitable documentation as described in 3185 [RFC8126], section 4.6, is available. The DE should also verify the 3186 capability does not conflict with work that is active or already 3187 published within the IETF. 3189 Before a period of 30 days has passed, the DE will either approve or 3190 deny the registration request and publish a notice of the decision to 3191 the JMAP WG mailing list or its successor, as well as informing IANA. 3192 A denial notice must be justified by an explanation, and in the cases 3193 where it is possible, concrete suggestions on how the request can be 3194 modified so as to become acceptable should be provided. 3196 If the DE does not respond within 30 days, the registrant may request 3197 the IESG take action to process the request in a timely manner. 3199 9.4.4. Change procedures 3201 Once a JMAP capability has been published by the IANA, the change 3202 controller may request a change to its definition. The same 3203 procedure that would be appropriate for the original registration 3204 request is used to process a change request. 3206 JMAP capability registrations may not be deleted; capabilities that 3207 are no longer believed appropriate for use can be declared obsolete 3208 by a change to their "intended use" field; such capabilities will be 3209 clearly marked in the lists published by the IANA. 3211 Significant changes to a capability's definition should be requested 3212 only when there are serious omissions or errors in the published 3213 specification. When review is required, a change request may be 3214 denied if it renders entities that were valid under the previous 3215 definition invalid under the new definition. 3217 The owner of a JMAP capability may pass responsibility to another 3218 person or agency by informing the IANA; this can be done without 3219 discussion or review. 3221 The IESG may reassign responsibility for a JMAP capability. The most 3222 common case of this will be to enable changes to be made to 3223 capabilities where the author of the registration has died, moved out 3224 of contact, or is otherwise unable to make changes that are important 3225 to the community. 3227 9.4.5. JMAP Capabilities registry template: 3229 Capability name: (see capability property in section 2) 3231 Specification document: 3233 Intended use: (one of common, limited, placeholder, or obsolete) 3235 Change controller: (_IETF_ for standards-track/BCP RFCs) 3237 Security and privacy considerations: 3239 9.4.6. Initial registration for JMAP core 3241 Capability Name: "urn:ietf:params:jmap:core" 3243 Specification document: [I-D.ietf-jmap-core], section 2 3245 Intended use: common 3247 Change Controller: IETF 3249 Security and privacy considerations: [I-D.ietf-jmap-core], section 8. 3251 9.4.7. Registration for JMAP error placeholder in JMAP capabilities 3252 registry 3254 Capability Name: "urn:ietf:params:jmap:error:" 3256 Specification document: [I-D.ietf-jmap-core], section 9.5 3258 Intended use: placeholder 3260 Change Controller: IETF 3262 Security and privacy considerations: [I-D.ietf-jmap-core], section 8. 3264 9.5. Creation of "JMAP Error Codes" registry 3266 IANA will create a registry for JMAP error codes. JMAP error codes 3267 appear in the "type" member of a JSON problem details object (as 3268 described in section 3.5.1), in the "type" member in a JMAP error 3269 object (as described in section 3.5.2), or the "type" member of a 3270 JMAP method-specific error object (such as SetError in section 5.3). 3271 When used in a problem details object, the prefix 3272 'urn:ietf:params:jmap:error:' is always included, and when used in 3273 JMAP objects, the prefix is always omitted. 3275 This registry follows the expert review process. Preliminary 3276 community review for this registry follows the same procedures as the 3277 JMAP capabilities registry but is optional. The change procedures 3278 for this registry are the same as the change procedures for the JMAP 3279 capabilities registry. 3281 9.5.1. Designated expert review 3283 The designated expert should review the following aspects of the 3284 registration: 3286 1. Verify the error code does not conflict with existing names. 3288 2. Verify the error code follows the syntax limitations (does not 3289 require URI encoding). 3291 3. Encourage the error code to follow the naming convention of 3292 previously registered errors. 3294 4. Encourage description of client behaviors that are recommended in 3295 response to the error code. These may distinguish the error code 3296 from other error codes. 3298 5. Encourage description of when the server should issue the error 3299 as opposed to some other error code. 3301 6. Encourage the submitter to note any security considerations 3302 associated with the error, if any. For example, an error code 3303 that might disclose existence of data the authenticated user does 3304 not have permission to know about. 3306 Steps 3-6 are meant to promote a higher-quality registry. However, 3307 the expert is encouraged to approve any registration that would not 3308 actively harm JMAP interoperability to make this a relatively 3309 lightweight process. 3311 9.5.2. JMAP Error Codes registry template: 3313 JMAP Error Code: 3315 Intended use: (one of _common_, _limited_, _obsolete_) 3316 Change Controller: (_IETF_ for standards-track/BCP RFCs) 3318 Reference: (optional, only if defined in an RFC.) 3320 Description: 3322 9.5.3. Initial JMAP Error Codes registry 3324 +--------------------+-------+---------+---------------+------------+ 3325 | JMAP Error Code | Inten | Change | Reference | Descriptio | 3326 | | ded | Control | | n | 3327 | | Use | ler | | | 3328 +--------------------+-------+---------+---------------+------------+ 3329 | accountNotFound | commo | IETF | [I-D.ietf-jma | The | 3330 | | n | | p-core] | accountId | 3331 | | | | section 3.5.2 | does not | 3332 | | | | | correspond | 3333 | | | | | to a valid | 3334 | | | | | account. | 3335 | accountNotSupporte | commo | IETF | [I-D.ietf-jma | The | 3336 | dByMethod | n | | p-core] | accountId | 3337 | | | | section 3.5.2 | given corr | 3338 | | | | | esponds to | 3339 | | | | | a valid | 3340 | | | | | account, | 3341 | | | | | but the | 3342 | | | | | account | 3343 | | | | | does not | 3344 | | | | | support | 3345 | | | | | this | 3346 | | | | | method or | 3347 | | | | | data type. | 3348 | accountReadOnly | commo | IETF | [I-D.ietf-jma | This | 3349 | | n | | p-core] | method | 3350 | | | | section 3.5.2 | call would | 3351 | | | | | modify | 3352 | | | | | state in | 3353 | | | | | an account | 3354 | | | | | that is | 3355 | | | | | read-only | 3356 | | | | | (as | 3357 | | | | | returned | 3358 | | | | | on the cor | 3359 | | | | | responding | 3360 | | | | | Account | 3361 | | | | | object in | 3362 | | | | | the JMAP | 3363 | | | | | Session | 3364 | | | | | resource). | 3365 | anchorNotFound | commo | IETF | [I-D.ietf-jma | An anchor | 3366 | | n | | p-core] | argument | 3367 | | | | section 5.5 | was | 3368 | | | | | supplied, | 3369 | | | | | but it | 3370 | | | | | cannot be | 3371 | | | | | found in | 3372 | | | | | the | 3373 | | | | | results of | 3374 | | | | | the query. | 3375 | alreadyExists | commo | IETF | [I-D.ietf-jma | The server | 3376 | | n | | p-core] | forbids | 3377 | | | | section 5.4 | duplicates | 3378 | | | | | and the | 3379 | | | | | record | 3380 | | | | | already | 3381 | | | | | exists in | 3382 | | | | | the target | 3383 | | | | | account. | 3384 | | | | | An | 3385 | | | | | existingId | 3386 | | | | | property | 3387 | | | | | of type Id | 3388 | | | | | MUST be | 3389 | | | | | included | 3390 | | | | | on the | 3391 | | | | | error | 3392 | | | | | object | 3393 | | | | | with the | 3394 | | | | | id of the | 3395 | | | | | existing | 3396 | | | | | record. | 3397 | cannotCalculateCha | commo | IETF | [I-D.ietf-jma | The server | 3398 | nges | n | | p-core] | cannot | 3399 | | | | sections 5.2 | calculate | 3400 | | | | and 5.6 | the | 3401 | | | | | changes | 3402 | | | | | from the | 3403 | | | | | state | 3404 | | | | | string | 3405 | | | | | given by | 3406 | | | | | the | 3407 | | | | | client. | 3408 | forbidden | commo | IETF | [I-D.ietf-jma | The action | 3409 | | n | | p-core] | would | 3410 | | | | sections | violate an | 3411 | | | | 3.5.2, 5.3, | ACL or | 3412 | | | | and 7.2.1 | other perm | 3413 | | | | | issions | 3414 | | | | | policy. | 3415 | fromAccountNotFoun | commo | IETF | [I-D.ietf-jma | The fromAc | 3416 | d | n | | p-core] | countId | 3417 | | | | sections 5.4 | does not | 3418 | | | | and 6.3 | correspond | 3419 | | | | | to a valid | 3420 | | | | | account. | 3421 | fromAccountNotSupp | commo | IETF | [I-D.ietf-jma | The fromAc | 3422 | ortedByMethod | n | | p-core] | countId | 3423 | | | | section 5.4 | given corr | 3424 | | | | | esponds to | 3425 | | | | | a valid | 3426 | | | | | account, | 3427 | | | | | but the | 3428 | | | | | account | 3429 | | | | | does not | 3430 | | | | | support | 3431 | | | | | this data | 3432 | | | | | type. | 3433 | invalidArguments | commo | IETF | [I-D.ietf-jma | One of the | 3434 | | n | | p-core] | arguments | 3435 | | | | section 3.5.2 | is of the | 3436 | | | | | wrong type | 3437 | | | | | or | 3438 | | | | | otherwise | 3439 | | | | | invalid, | 3440 | | | | | or a | 3441 | | | | | required | 3442 | | | | | argument | 3443 | | | | | is | 3444 | | | | | missing. | 3445 | invalidPatch | commo | IETF | [I-D.ietf-jma | The PatchO | 3446 | | n | | p-core] | bject | 3447 | | | | section 5.3 | given to | 3448 | | | | | update the | 3449 | | | | | record was | 3450 | | | | | not a | 3451 | | | | | valid | 3452 | | | | | patch. | 3453 | invalidProperties | commo | IETF | [I-D.ietf-jma | The record | 3454 | | n | | p-core] | given is | 3455 | | | | section 5.3 | invalid. | 3456 | notFound | commo | IETF | [I-D.ietf-jma | The id | 3457 | | n | | p-core] | given | 3458 | | | | section 5.3 | cannot be | 3459 | | | | | found. | 3460 | notJSON | commo | IETF | [I-D.ietf-jma | The | 3461 | | n | | p-core] | content | 3462 | | | | section 3.5.1 | type of | 3463 | | | | | the | 3464 | | | | | request | 3465 | | | | | was not ap | 3466 | | | | | plication/ | 3467 | | | | | json or | 3468 | | | | | the | 3469 | | | | | request | 3470 | | | | | did not | 3471 | | | | | parse as | 3472 | | | | | I-JSON. | 3473 | notRequest | commo | IETF | [I-D.ietf-jma | The | 3474 | | n | | p-core] | request | 3475 | | | | section 3.5.1 | parsed as | 3476 | | | | | JSON but | 3477 | | | | | did not | 3478 | | | | | match the | 3479 | | | | | type | 3480 | | | | | signature | 3481 | | | | | of the | 3482 | | | | | Request | 3483 | | | | | object. | 3484 | overQuota | commo | IETF | [I-D.ietf-jma | The create | 3485 | | n | | p-core] | would | 3486 | | | | section 5.3 | exceed a | 3487 | | | | | server- | 3488 | | | | | defined | 3489 | | | | | limit on | 3490 | | | | | the number | 3491 | | | | | or total | 3492 | | | | | size of | 3493 | | | | | objects of | 3494 | | | | | this type. | 3495 | rateLimit | commo | IETF | [I-D.ietf-jma | Too many | 3496 | | n | | p-core] | objects of | 3497 | | | | section 5.3 | this type | 3498 | | | | | have been | 3499 | | | | | created | 3500 | | | | | recently, | 3501 | | | | | and a | 3502 | | | | | server- | 3503 | | | | | defined | 3504 | | | | | rate limit | 3505 | | | | | has been | 3506 | | | | | reached. | 3507 | | | | | It may | 3508 | | | | | work if | 3509 | | | | | tried | 3510 | | | | | again | 3511 | | | | | later. | 3512 | requestTooLarge | commo | IETF | [I-D.ietf-jma | The total | 3513 | | n | | p-core] | number of | 3514 | | | | sections 5.1 | actions | 3515 | | | | and 5.3 | exceeds | 3516 | | | | | the | 3517 | | | | | maximum | 3518 | | | | | number the | 3519 | | | | | server is | 3520 | | | | | willing to | 3521 | | | | | process in | 3522 | | | | | a single | 3523 | | | | | method | 3524 | | | | | call. | 3525 | invalidResultRefer | commo | IETF | [I-D.ietf-jma | The method | 3526 | ence | n | | p-core] | used a | 3527 | | | | section 3.5.2 | result | 3528 | | | | | reference | 3529 | | | | | for one of | 3530 | | | | | its | 3531 | | | | | arguments, | 3532 | | | | | but this | 3533 | | | | | failed to | 3534 | | | | | resolve. | 3535 | serverFail | commo | IETF | [I-D.ietf-jma | An | 3536 | | n | | p-core] | unexpected | 3537 | | | | section 3.5.2 | or unknown | 3538 | | | | | error | 3539 | | | | | occurred | 3540 | | | | | during the | 3541 | | | | | processing | 3542 | | | | | of the | 3543 | | | | | call. The | 3544 | | | | | method | 3545 | | | | | call made | 3546 | | | | | no changes | 3547 | | | | | to the | 3548 | | | | | server's | 3549 | | | | | state. | 3550 | serverPartialFail | limit | IETF | [I-D.ietf-jma | Some, but | 3551 | | ed | | p-core] | not all | 3552 | | | | section 3.5.2 | expected | 3553 | | | | | changes | 3554 | | | | | described | 3555 | | | | | by the | 3556 | | | | | method | 3557 | | | | | occurred. | 3558 | | | | | The client | 3559 | | | | | MUST re-sy | 3560 | | | | | nchronise | 3561 | | | | | impacted | 3562 | | | | | data to | 3563 | | | | | determine | 3564 | | | | | server | 3565 | | | | | state. Use | 3566 | | | | | of this | 3567 | | | | | error is | 3568 | | | | | strongly d | 3569 | | | | | iscouraged | 3570 | | | | | . | 3571 | serverUnavailable | commo | IETF | [I-D.ietf-jma | Some | 3572 | | n | | p-core] | internal | 3573 | | | | section 3.5.2 | server | 3574 | | | | | resource | 3575 | | | | | was tempor | 3576 | | | | | arily unav | 3577 | | | | | ailable. | 3578 | | | | | Attempting | 3579 | | | | | the same | 3580 | | | | | operation | 3581 | | | | | later | 3582 | | | | | (perhaps | 3583 | | | | | after a | 3584 | | | | | backoff | 3585 | | | | | with a | 3586 | | | | | random | 3587 | | | | | factor) | 3588 | | | | | may | 3589 | | | | | succeed. | 3590 | singleton | commo | IETF | [I-D.ietf-jma | This is a | 3591 | | n | | p-core] | singleton | 3592 | | | | section 5.3 | type, so | 3593 | | | | | you cannot | 3594 | | | | | create | 3595 | | | | | another | 3596 | | | | | one or | 3597 | | | | | destroy | 3598 | | | | | the | 3599 | | | | | existing | 3600 | | | | | one. | 3601 | stateMismatch | commo | IETF | [I-D.ietf-jma | An | 3602 | | n | | p-core] | ifInState | 3603 | | | | section 5.3 | argument | 3604 | | | | | was | 3605 | | | | | supplied | 3606 | | | | | and it | 3607 | | | | | does not | 3608 | | | | | match the | 3609 | | | | | current | 3610 | | | | | state. | 3611 | tooLarge | commo | IETF | [I-D.ietf-jma | The action | 3612 | | n | | p-core] | would | 3613 | | | | section 5.3 | result in | 3614 | | | | | an object | 3615 | | | | | that | 3616 | | | | | exceeds a | 3617 | | | | | server- | 3618 | | | | | defined | 3619 | | | | | limit for | 3620 | | | | | the | 3621 | | | | | maximum | 3622 | | | | | size of a | 3623 | | | | | single | 3624 | | | | | object of | 3625 | | | | | this type. | 3626 | tooManyChanges | commo | IETF | [I-D.ietf-jma | There are | 3627 | | n | | p-core] | more | 3628 | | | | section 5.6 | changes | 3629 | | | | | than the | 3630 | | | | | client's | 3631 | | | | | maxChanges | 3632 | | | | | argument. | 3633 | unknownCapability | commo | IETF | [I-D.ietf-jma | The client | 3634 | | n | | p-core] | included a | 3635 | | | | section 3.5.1 | capability | 3636 | | | | | in the | 3637 | | | | | "using" | 3638 | | | | | property | 3639 | | | | | of the | 3640 | | | | | request | 3641 | | | | | that the | 3642 | | | | | server | 3643 | | | | | does not | 3644 | | | | | support. | 3645 | unknownMethod | commo | IETF | [I-D.ietf-jma | The server | 3646 | | n | | p-core] | does not | 3647 | | | | section 3.5.2 | recognise | 3648 | | | | | this | 3649 | | | | | method | 3650 | | | | | name. | 3651 | unsupportedFilter | commo | IETF | [I-D.ietf-jma | The filter | 3652 | | n | | p-core] | is syntact | 3653 | | | | section 5.5 | ically | 3654 | | | | | valid, but | 3655 | | | | | the server | 3656 | | | | | cannot | 3657 | | | | | process | 3658 | | | | | it. | 3659 | unsupportedSort | commo | IETF | [I-D.ietf-jma | The sort | 3660 | | n | | p-core] | is syntact | 3661 | | | | section 5.5 | ically | 3662 | | | | | valid, but | 3663 | | | | | includes a | 3664 | | | | | property | 3665 | | | | | the server | 3666 | | | | | does not | 3667 | | | | | support | 3668 | | | | | sorting | 3669 | | | | | on, or a | 3670 | | | | | collation | 3671 | | | | | method it | 3672 | | | | | does not | 3673 | | | | | recognise. | 3674 | willDestroy | commo | IETF | [I-D.ietf-jma | The client | 3675 | | n | | p-core] | requested | 3676 | | | | section 5.3 | an object | 3677 | | | | | be both | 3678 | | | | | updated | 3679 | | | | | and | 3680 | | | | | destroyed | 3681 | | | | | in the | 3682 | | | | | same /set | 3683 | | | | | request, | 3684 | | | | | and the | 3685 | | | | | server has | 3686 | | | | | decided to | 3687 | | | | | therefore | 3688 | | | | | ignore the | 3689 | | | | | update. | 3690 +--------------------+-------+---------+---------------+------------+ 3692 10. References 3694 10.1. Normative References 3696 [EventSource] 3697 Hickson, I., "Server-Sent Events", 2015, 3698 . 3700 [I-D.ietf-jmap-core] 3701 Jenkins, N. and C. Newman, "JSON Meta Application 3702 Protocol", draft-ietf-jmap-core-14 (work in progress), 3703 January 2019. 3705 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3706 Requirement Levels", BCP 14, RFC 2119, 3707 DOI 10.17487/RFC2119, March 1997, 3708 . 3710 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 3711 specifying the location of services (DNS SRV)", RFC 2782, 3712 DOI 10.17487/RFC2782, February 2000, 3713 . 3715 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 3716 DOI 10.17487/RFC2818, May 2000, 3717 . 3719 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 3720 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 3721 . 3723 [RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An 3724 IETF URN Sub-namespace for Registered Protocol 3725 Parameters", BCP 73, RFC 3553, DOI 10.17487/RFC3553, June 3726 2003, . 3728 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 3729 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 3730 2003, . 3732 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 3733 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 3734 . 3736 [RFC4790] Newman, C., Duerst, M., and A. Gulbrandsen, "Internet 3737 Application Protocol Collation Registry", RFC 4790, 3738 DOI 10.17487/RFC4790, March 2007, 3739 . 3741 [RFC5051] Crispin, M., "i;unicode-casemap - Simple Unicode Collation 3742 Algorithm", RFC 5051, DOI 10.17487/RFC5051, October 2007, 3743 . 3745 [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, 3746 DOI 10.17487/RFC5322, October 2008, 3747 . 3749 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 3750 Uniform Resource Identifiers (URIs)", RFC 5785, 3751 DOI 10.17487/RFC5785, April 2010, 3752 . 3754 [RFC6186] Daboo, C., "Use of SRV Records for Locating Email 3755 Submission/Access Services", RFC 6186, 3756 DOI 10.17487/RFC6186, March 2011, 3757 . 3759 [RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. 3760 Cheshire, "Internet Assigned Numbers Authority (IANA) 3761 Procedures for the Management of the Service Name and 3762 Transport Protocol Port Number Registry", BCP 165, 3763 RFC 6335, DOI 10.17487/RFC6335, August 2011, 3764 . 3766 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 3767 and D. Orchard, "URI Template", RFC 6570, 3768 DOI 10.17487/RFC6570, March 2012, 3769 . 3771 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 3772 RFC 6749, DOI 10.17487/RFC6749, October 2012, 3773 . 3775 [RFC6764] Daboo, C., "Locating Services for Calendaring Extensions 3776 to WebDAV (CalDAV) and vCard Extensions to WebDAV 3777 (CardDAV)", RFC 6764, DOI 10.17487/RFC6764, February 2013, 3778 . 3780 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 3781 Specifications and Registration Procedures", BCP 13, 3782 RFC 6838, DOI 10.17487/RFC6838, January 2013, 3783 . 3785 [RFC6901] Bryan, P., Ed., Zyp, K., and M. Nottingham, Ed., 3786 "JavaScript Object Notation (JSON) Pointer", RFC 6901, 3787 DOI 10.17487/RFC6901, April 2013, 3788 . 3790 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3791 Protocol (HTTP/1.1): Message Syntax and Routing", 3792 RFC 7230, DOI 10.17487/RFC7230, June 2014, 3793 . 3795 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3796 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 3797 DOI 10.17487/RFC7231, June 2014, 3798 . 3800 [RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, 3801 DOI 10.17487/RFC7493, March 2015, 3802 . 3804 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 3805 "Recommendations for Secure Use of Transport Layer 3806 Security (TLS) and Datagram Transport Layer Security 3807 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 3808 2015, . 3810 [RFC7617] Reschke, J., "The 'Basic' HTTP Authentication Scheme", 3811 RFC 7617, DOI 10.17487/RFC7617, September 2015, 3812 . 3814 [RFC7807] Nottingham, M. and E. Wilde, "Problem Details for HTTP 3815 APIs", RFC 7807, DOI 10.17487/RFC7807, March 2016, 3816 . 3818 [RFC8030] Thomson, M., Damaggio, E., and B. Raymor, Ed., "Generic 3819 Event Delivery Using HTTP Push", RFC 8030, 3820 DOI 10.17487/RFC8030, December 2016, 3821 . 3823 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 3824 Writing an IANA Considerations Section in RFCs", BCP 26, 3825 RFC 8126, DOI 10.17487/RFC8126, June 2017, 3826 . 3828 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3829 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3830 May 2017, . 3832 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3833 Interchange Format", STD 90, RFC 8259, 3834 DOI 10.17487/RFC8259, December 2017, 3835 . 3837 [RFC8264] Saint-Andre, P. and M. Blanchet, "PRECIS Framework: 3838 Preparation, Enforcement, and Comparison of 3839 Internationalized Strings in Application Protocols", 3840 RFC 8264, DOI 10.17487/RFC8264, October 2017, 3841 . 3843 [RFC8291] Thomson, M., "Message Encryption for Web Push", RFC 8291, 3844 DOI 10.17487/RFC8291, November 2017, 3845 . 3847 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 3848 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 3849 . 3851 10.2. Informative References 3853 [RFC8246] McManus, P., "HTTP Immutable Responses", RFC 8246, 3854 DOI 10.17487/RFC8246, September 2017, 3855 . 3857 Authors' Addresses 3859 Neil Jenkins 3860 FastMail 3861 PO Box 234, Collins St West 3862 Melbourne VIC 8007 3863 Australia 3865 Email: neilj@fastmailteam.com 3866 URI: https://www.fastmail.com 3868 Chris Newman 3869 Oracle 3870 440 E. Huntington Dr., Suite 400 3871 Arcadia CA 91006 3872 United States of America 3874 Email: chris.newman@oracle.com