{
  "openapi": "3.1.0",
  "info": {
    "title": "Lichkey",
    "version": "1",
    "description": "A global key-value store: data lives where it's written, reads are served nearby. Every call is POST with a JSON body. Keys are tuples (JSON lists) whose first part is the group. Data calls take a store token: Authorization: Bearer lk1.…"
  },
  "servers": [
    {
      "url": "https://lichkey.com"
    }
  ],
  "paths": {
    "/api/v1/get": {
      "post": {
        "operationId": "get",
        "summary": "Read a key.",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "consistency": {
                    "$ref": "#/components/schemas/Consistency"
                  },
                  "cache": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Milliseconds."
                      },
                      {
                        "type": "string",
                        "pattern": "^\\d+(ms|s|m|h|d)$",
                        "description": "Like \"30s\", \"10m\", \"1d\"."
                      }
                    ],
                    "description": "Serve from the edge cache, up to this old."
                  },
                  "since": {
                    "$ref": "#/components/schemas/Version",
                    "description": "Only accept this version or newer (read-your-writes)."
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entry"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/many": {
      "post": {
        "operationId": "many",
        "summary": "Read up to 100 keys, in order. Each meets its own guarantee; not a snapshot.",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "keys": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Key"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  },
                  "consistency": {
                    "$ref": "#/components/schemas/Consistency"
                  },
                  "cache": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Milliseconds."
                      },
                      {
                        "type": "string",
                        "pattern": "^\\d+(ms|s|m|h|d)$",
                        "description": "Like \"30s\", \"10m\", \"1d\"."
                      }
                    ],
                    "description": "Serve from the edge cache, up to this old."
                  },
                  "since": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/Version"
                      },
                      {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/Version"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    ],
                    "description": "A version for all keys, or one (or null) per key."
                  }
                },
                "required": [
                  "keys"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Entry"
                      }
                    }
                  },
                  "required": [
                    "entries"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/set": {
      "post": {
        "operationId": "set",
        "summary": "Write a key. Without if, the last write wins.",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Idempotency"
            },
            "description": "Same as idempotency in the body."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "value": {
                    "$ref": "#/components/schemas/Value"
                  },
                  "if": {
                    "$ref": "#/components/schemas/Condition"
                  },
                  "ttl": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Milliseconds."
                      },
                      {
                        "type": "string",
                        "pattern": "^\\d+(ms|s|m|h|d)$",
                        "description": "Like \"30s\", \"10m\", \"1d\"."
                      }
                    ],
                    "description": "Expire after this long."
                  },
                  "wait": {
                    "type": "boolean",
                    "description": "false: reply before the write commits (no version, no condition outcome)."
                  },
                  "idempotency": {
                    "$ref": "#/components/schemas/Idempotency"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/create": {
      "post": {
        "operationId": "create",
        "summary": "Write a key only if it doesn't exist: ok false if it does.",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Idempotency"
            },
            "description": "Same as idempotency in the body."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "value": {
                    "$ref": "#/components/schemas/Value"
                  },
                  "ttl": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Milliseconds."
                      },
                      {
                        "type": "string",
                        "pattern": "^\\d+(ms|s|m|h|d)$",
                        "description": "Like \"30s\", \"10m\", \"1d\"."
                      }
                    ],
                    "description": "Expire after this long."
                  },
                  "wait": {
                    "type": "boolean",
                    "description": "false: reply before the write commits (no version, no condition outcome)."
                  },
                  "idempotency": {
                    "$ref": "#/components/schemas/Idempotency"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/update": {
      "post": {
        "operationId": "update",
        "summary": "Change fields of a document (created if missing), atomically at the owner. Returns the new document.",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Idempotency"
            },
            "description": "Same as idempotency in the body."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "value": {
                    "$ref": "#/components/schemas/Changes"
                  },
                  "if": {
                    "$ref": "#/components/schemas/Condition"
                  },
                  "ttl": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Milliseconds."
                      },
                      {
                        "type": "string",
                        "pattern": "^\\d+(ms|s|m|h|d)$",
                        "description": "Like \"30s\", \"10m\", \"1d\"."
                      }
                    ],
                    "description": "Expire after this long."
                  },
                  "wait": {
                    "type": "boolean",
                    "description": "false: reply before the write commits (no version, no condition outcome)."
                  },
                  "idempotency": {
                    "$ref": "#/components/schemas/Idempotency"
                  }
                },
                "required": [
                  "key",
                  "value"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/add": {
      "post": {
        "operationId": "add",
        "summary": "Add to a number atomically (a missing key counts as 0). Returns the new value; ok false when max or min refused it. ttl is set on creation and kept (fixed windows).",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Idempotency"
            },
            "description": "Same as idempotency in the body."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "value": {
                    "type": "number",
                    "default": 1
                  },
                  "max": {
                    "type": "number"
                  },
                  "min": {
                    "type": "number"
                  },
                  "ttl": {
                    "oneOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Milliseconds."
                      },
                      {
                        "type": "string",
                        "pattern": "^\\d+(ms|s|m|h|d)$",
                        "description": "Like \"30s\", \"10m\", \"1d\"."
                      }
                    ],
                    "description": "Expire after this long."
                  },
                  "wait": {
                    "type": "boolean",
                    "description": "false: reply before the write commits (no version, no condition outcome)."
                  },
                  "idempotency": {
                    "$ref": "#/components/schemas/Idempotency"
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/delete": {
      "post": {
        "operationId": "delete",
        "summary": "Delete a key. ok false if the condition failed.",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Idempotency"
            },
            "description": "Same as idempotency in the body."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "if": {
                    "$ref": "#/components/schemas/Condition"
                  },
                  "wait": {
                    "type": "boolean",
                    "description": "false: reply before the write commits (no version, no condition outcome)."
                  },
                  "idempotency": {
                    "$ref": "#/components/schemas/Idempotency"
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/list": {
      "post": {
        "operationId": "list",
        "summary": "Entries in one group, in key order, a page at a time. prefix lists the keys under it; start is inclusive, end exclusive. The first part of each is the group.",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prefix": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "start": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "end": {
                    "$ref": "#/components/schemas/Key"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "description": "Page size; default 1,000."
                  },
                  "reverse": {
                    "type": "boolean"
                  },
                  "consistency": {
                    "$ref": "#/components/schemas/Consistency"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "From the previous page; only valid for the same store and range."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Entry"
                      }
                    },
                    "cursor": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "entries"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/commit": {
      "post": {
        "operationId": "commit",
        "summary": "Checks, writes and messages in one group, all or nothing. Messages are sent only if it commits.",
        "tags": [
          "data"
        ],
        "security": [
          {
            "storeToken": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Idempotency"
            },
            "description": "Same as idempotency in the body."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "checks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "$ref": "#/components/schemas/Key"
                        },
                        "version": {
                          "oneOf": [
                            {
                              "$ref": "#/components/schemas/Version"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "key",
                        "version"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Versions read: each key must still be at this version (null: still missing)."
                  },
                  "writes": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Write"
                    }
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Json"
                    },
                    "description": "Each at most 127 KB of JSON."
                  },
                  "idempotency": {
                    "$ref": "#/components/schemas/Idempotency"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "version": {
                      "$ref": "#/components/schemas/Version"
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Key"
                      },
                      "description": "The keys whose check or condition failed."
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/create": {
      "post": {
        "operationId": "workspacesCreate",
        "summary": "Create a workspace; you become its owner. Ids are never reused. Up to 10 owned workspaces per person, your own included.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "workspace"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "$ref": "#/components/schemas/Workspace"
                    }
                  },
                  "required": [
                    "workspace"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/get": {
      "post": {
        "operationId": "workspacesGet",
        "summary": "Read a workspace you belong to.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/Workspace"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "workspace"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/list": {
      "post": {
        "operationId": "workspacesList",
        "summary": "The workspaces you belong to, with your role.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Workspace"
                      }
                    }
                  },
                  "required": [
                    "workspaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/delete": {
      "post": {
        "operationId": "workspacesDelete",
        "summary": "Delete a workspace (owners): its stores and tokens stop working at once.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/members/list": {
      "post": {
        "operationId": "membersList",
        "summary": "A workspace's members (any member can list).",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Member"
                      }
                    }
                  },
                  "required": [
                    "members"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/members/remove": {
      "post": {
        "operationId": "membersRemove",
        "summary": "Remove a member (owners), or yourself (leave). The last owner can't. Their access stops within about 10 s, and store tokens they made in the workspace are revoked.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "member": {
                    "type": "string",
                    "description": "Their account subject. Yours to leave."
                  }
                },
                "required": [
                  "workspace",
                  "member"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "const": true
                    },
                    "revokedTokens": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "removed",
                    "revokedTokens"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/invites/create": {
      "post": {
        "operationId": "invitesCreate",
        "summary": "Invite someone (owners) by verified email, account id, or both. They join when they next sign in with that email or account, or by opening the link. Expires in 7 days; up to 50 pending per workspace.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 254
                  },
                  "sub": {
                    "type": "string",
                    "description": "Their account subject."
                  }
                },
                "required": [
                  "workspace"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invite": {
                      "$ref": "#/components/schemas/Invite"
                    },
                    "code": {
                      "type": "string",
                      "description": "lki1.…, shown once."
                    },
                    "link": {
                      "type": "string",
                      "description": "Open to sign in and join."
                    }
                  },
                  "required": [
                    "invite",
                    "code",
                    "link"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/invites/list": {
      "post": {
        "operationId": "invitesList",
        "summary": "With workspace: its pending invites (owners). Without: pending invites addressed to you.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invites": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Invite"
                      }
                    }
                  },
                  "required": [
                    "invites"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/invites/revoke": {
      "post": {
        "operationId": "invitesRevoke",
        "summary": "Revoke a pending invite (owners).",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "invite": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspace",
                  "invite"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/invites/accept": {
      "post": {
        "operationId": "invitesAccept",
        "summary": "Accept an invite addressed to you: by its code (from a link), or by workspace and invite id (from invites/list). Used once.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "invite": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "string"
                    },
                    "role": {
                      "enum": [
                        "owner",
                        "member"
                      ]
                    }
                  },
                  "required": [
                    "workspace",
                    "role"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/stores/create": {
      "post": {
        "operationId": "storesCreate",
        "summary": "Create a store.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "store": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace",
                  "store"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "store": {
                      "$ref": "#/components/schemas/Store"
                    }
                  },
                  "required": [
                    "store"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/stores/get": {
      "post": {
        "operationId": "storesGet",
        "summary": "Read a store.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "store": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace",
                  "store"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "store": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/Store"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "store"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/stores/list": {
      "post": {
        "operationId": "storesList",
        "summary": "A workspace's stores.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stores": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Store"
                      }
                    }
                  },
                  "required": [
                    "stores"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/stores/delete": {
      "post": {
        "operationId": "storesDelete",
        "summary": "Delete a store: its tokens stop working at once.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "store": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace",
                  "store"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/stores/usage": {
      "post": {
        "operationId": "storesUsage",
        "summary": "Hourly usage of a store (UTC hours, approximate).",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "store": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace",
                  "store"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hours": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hour": {
                            "type": "string"
                          },
                          "requests": {
                            "type": "integer"
                          },
                          "reads": {
                            "type": "integer"
                          },
                          "writes": {
                            "type": "integer"
                          },
                          "limited": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "hour",
                          "requests",
                          "reads",
                          "writes",
                          "limited"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "hours"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/tokens/create": {
      "post": {
        "operationId": "tokensCreate",
        "summary": "Create a store token. The token is returned once; only its hash is kept.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "store": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "access": {
                    "enum": [
                      "read",
                      "write"
                    ],
                    "default": "read"
                  },
                  "prefix": {
                    "$ref": "#/components/schemas/Key",
                    "description": "Only keys under this key."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "expiresAt": {
                    "type": "integer",
                    "description": "Milliseconds since the epoch."
                  }
                },
                "required": [
                  "workspace",
                  "store"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "record": {
                      "$ref": "#/components/schemas/Token"
                    }
                  },
                  "required": [
                    "token",
                    "record"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/tokens/list": {
      "post": {
        "operationId": "tokensList",
        "summary": "A workspace's or store's tokens, without secrets.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "store": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  }
                },
                "required": [
                  "workspace"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tokens": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Token"
                      }
                    }
                  },
                  "required": [
                    "tokens"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    },
    "/api/v1/tokens/revoke": {
      "post": {
        "operationId": "tokensRevoke",
        "summary": "Revoke a token.",
        "tags": [
          "control"
        ],
        "security": [
          {
            "user": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "store": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
                  },
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspace",
                  "store",
                  "token"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. A failed condition is a result ({ok: false}), not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The credential doesn't allow this (read-only, or outside its key prefix).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such workspace, store, token, member or invite.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Exists already, too many, the last owner, or an idempotency key reused with a different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 8 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "The store is over its rate limit. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "A temporary failure. Retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "KeyPart": {
        "description": "A string, number, boolean, bytes or bigint.",
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "$ref": "#/components/schemas/Bytes"
          },
          {
            "type": "object",
            "properties": {
              "$bigint": {
                "type": "string",
                "pattern": "^-?\\d+$"
              }
            },
            "required": [
              "$bigint"
            ],
            "additionalProperties": false,
            "description": "A bigint, as decimal digits."
          }
        ]
      },
      "Key": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/KeyPart"
        },
        "minItems": 1,
        "maxItems": 32,
        "description": "A tuple: [\"acct_123\", \"grant\", 9]. The first part is the group: the unit of ownership, list and commit. Ordered like Deno KV; at most 512 bytes encoded."
      },
      "Version": {
        "type": "string",
        "pattern": "^[0-9a-f]{16}[a-z0-9_]{4}$",
        "description": "Opaque, ordered per key."
      },
      "Bytes": {
        "type": "object",
        "properties": {
          "$bytes": {
            "type": "string",
            "contentEncoding": "base64"
          }
        },
        "required": [
          "$bytes"
        ],
        "additionalProperties": false,
        "description": "Bytes, base64."
      },
      "Set": {
        "type": "object",
        "properties": {
          "$set": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            },
            "minItems": 1
          }
        },
        "required": [
          "$set"
        ],
        "additionalProperties": false,
        "description": "A set of strings or of numbers."
      },
      "Doc": {
        "description": "A document: an object of fields. One whose only field starts with $ is sent as {\"$doc\": {...}}.",
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Value"
            },
            "not": {
              "minProperties": 1,
              "maxProperties": 1,
              "propertyNames": {
                "pattern": "^\\$"
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "$doc": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Value"
                }
              }
            },
            "required": [
              "$doc"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Value": {
        "description": "A string, number, boolean, bytes, set, list or document. At most 350,000 bytes.",
        "oneOf": [
          {
            "type": "null"
          },
          {
            "type": "boolean"
          },
          {
            "type": "number"
          },
          {
            "type": "string"
          },
          {
            "$ref": "#/components/schemas/Bytes"
          },
          {
            "$ref": "#/components/schemas/Set"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Value"
            }
          },
          {
            "$ref": "#/components/schemas/Doc"
          }
        ]
      },
      "Json": {
        "description": "Plain JSON (no tags)."
      },
      "Entry": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "value": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Value"
              }
            ],
            "description": "null when the key doesn't exist."
          },
          "version": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Version"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires": {
            "type": "integer",
            "description": "Milliseconds since the epoch."
          }
        },
        "required": [
          "key",
          "value",
          "version"
        ],
        "additionalProperties": false
      },
      "Duration": {
        "oneOf": [
          {
            "type": "integer",
            "minimum": 1,
            "description": "Milliseconds."
          },
          {
            "type": "string",
            "pattern": "^\\d+(ms|s|m|h|d)$",
            "description": "Like \"30s\", \"10m\", \"1d\"."
          }
        ],
        "description": "A duration."
      },
      "Consistency": {
        "enum": [
          "eventual",
          "strong"
        ],
        "description": "eventual (default): served nearby, ~100 ms behind other regions' writes. strong: the latest committed value, at the owner."
      },
      "Condition": {
        "description": "Compare-and-set: {\"version\": \"<version>\"} (null: the key must not exist). Or a condition on document fields, checked at the owner: {\"eq\": [\"plan\", \"pro\"]}; also ne, lt, lte, gt, gte, {\"between\": [field, low, high]}, {\"within\": [field, [values]]}, {\"exists\": field}, {\"missing\": field}, {\"contains\": [field, value]}, {\"starts\": [field, \"prefix\"]}, {\"and\": [...]}, {\"or\": [...]}, {\"not\": {...}}. Fields are dotted names (\"address.city\"); an operand can be {\"size\": field}. A comparison on a missing field is false.",
        "type": "object",
        "minProperties": 1,
        "maxProperties": 1
      },
      "Changes": {
        "type": "object",
        "minProperties": 1,
        "maxProperties": 100,
        "description": "Dotted field names to new values: {\"name\": \"dax\", \"address.city\": \"Paris\"}. A plain object replaces the field. Ops: {\"$add\": 1} adds to a number (or {\"$add\": \"x\"} / {\"$add\": [\"x\", \"y\"]} inserts into a set), {\"$remove\": \"x\"}, {\"$append\": [values]}, {\"$unset\": true}. Missing parents are created."
      },
      "Idempotency": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "description": "A retry with the same value returns the first result for 24 hours; a different payload is refused. Same as the Idempotency-Key header."
      },
      "WriteResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "version": {
            "$ref": "#/components/schemas/Version"
          },
          "value": {
            "$ref": "#/components/schemas/Value"
          },
          "current": {
            "$ref": "#/components/schemas/Entry"
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": false,
        "description": "ok false: the condition failed (current is the entry as it is; for add, the bound was reached). version and value are absent for wait: false."
      },
      "Write": {
        "description": "One write of a commit.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "set"
              },
              "key": {
                "$ref": "#/components/schemas/Key"
              },
              "value": {
                "$ref": "#/components/schemas/Value"
              },
              "ttl": {
                "$ref": "#/components/schemas/Duration"
              },
              "if": {
                "$ref": "#/components/schemas/Condition"
              }
            },
            "required": [
              "type",
              "key",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "create"
              },
              "key": {
                "$ref": "#/components/schemas/Key"
              },
              "value": {
                "$ref": "#/components/schemas/Value"
              },
              "ttl": {
                "$ref": "#/components/schemas/Duration"
              }
            },
            "required": [
              "type",
              "key",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "update"
              },
              "key": {
                "$ref": "#/components/schemas/Key"
              },
              "value": {
                "$ref": "#/components/schemas/Changes"
              },
              "ttl": {
                "$ref": "#/components/schemas/Duration"
              },
              "if": {
                "$ref": "#/components/schemas/Condition"
              }
            },
            "required": [
              "type",
              "key",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "add"
              },
              "key": {
                "$ref": "#/components/schemas/Key"
              },
              "value": {
                "type": "number",
                "default": 1
              },
              "ttl": {
                "$ref": "#/components/schemas/Duration"
              },
              "max": {
                "type": "number"
              },
              "min": {
                "type": "number"
              }
            },
            "required": [
              "type",
              "key"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "delete"
              },
              "key": {
                "$ref": "#/components/schemas/Key"
              },
              "if": {
                "$ref": "#/components/schemas/Condition"
              }
            },
            "required": [
              "type",
              "key"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Workspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "owner": {
            "type": "string",
            "description": "The account subject of the person who created it."
          },
          "shared": {
            "type": "boolean",
            "description": "The team's shared workspace."
          },
          "role": {
            "enum": [
              "owner",
              "member"
            ],
            "description": "Your role in it (in workspaces/list)."
          },
          "createdAt": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "Member": {
        "type": "object",
        "properties": {
          "sub": {
            "type": "string",
            "description": "Their account subject."
          },
          "role": {
            "enum": [
              "owner",
              "member"
            ],
            "description": "Owners manage members, invites and the workspace; members use its stores and tokens."
          },
          "email": {
            "type": "string",
            "description": "Their verified email, when known."
          },
          "addedAt": {
            "type": "integer"
          },
          "invitedBy": {
            "type": "string"
          }
        },
        "required": [
          "sub",
          "role",
          "addedAt"
        ],
        "additionalProperties": false
      },
      "Invite": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The workspace's name (in invites addressed to you)."
          },
          "email": {
            "type": "string",
            "description": "Whose verified email it's for."
          },
          "sub": {
            "type": "string",
            "description": "Whose account it's for."
          },
          "invitedBy": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer"
          },
          "expiresAt": {
            "type": "integer",
            "description": "Milliseconds since the epoch; seven days after it was made."
          }
        },
        "required": [
          "id",
          "workspace",
          "invitedBy",
          "createdAt",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "Limits": {
        "type": "object",
        "properties": {
          "requests": {
            "type": "integer"
          },
          "writes": {
            "type": "integer"
          }
        },
        "required": [
          "requests",
          "writes"
        ],
        "additionalProperties": false,
        "description": "Safety limits per second, set by operators."
      },
      "Store": {
        "type": "object",
        "properties": {
          "workspace": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer"
          },
          "limits": {
            "$ref": "#/components/schemas/Limits"
          }
        },
        "required": [
          "workspace",
          "id",
          "createdAt",
          "limits"
        ],
        "additionalProperties": false
      },
      "Token": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "store": {
            "type": "string"
          },
          "access": {
            "enum": [
              "read",
              "write"
            ]
          },
          "prefix": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer"
          },
          "createdBy": {
            "type": "string",
            "description": "Who made it. Removing them from the workspace revokes it."
          },
          "expiresAt": {
            "type": "integer"
          },
          "revokedAt": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "workspace",
          "store",
          "access",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable: invalid, unauthorized, forbidden, not_found, exists, too_many, last_owner, idempotency_mismatch, cross_group, too_large, unsupported, rate_limited, unavailable, contended, moved, behind, conflict, internal."
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "storeToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "A store token, lk1.<workspace>.<store>.<id>.<secret>."
      },
      "user": {
        "type": "http",
        "scheme": "bearer",
        "description": "A signed-in user's credential."
      }
    }
  }
}