# API schemas



This page is for the person who connects a program to the API.



## AcceptedChangeset

```json
{
  "type": "object",
  "description": "The outcome of one accepted changeset.",
  "additionalProperties": false,
  "required": [
    "mutationId",
    "revisionIds",
    "cursor",
    "revisions",
    "superseded"
  ],
  "properties": {
    "mutationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The mutation identity that the client submitted."
    },
    "revisionIds": {
      "type": "array",
      "readOnly": true,
      "description": "Every revision that this changeset accepted, in submitted order. A retry of the same mutation returns exactly these identifiers again.",
      "minItems": 1,
      "maxItems": 4000,
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "cursor": {
      "type": "string",
      "readOnly": true,
      "description": "The commit ordered position of this change in the workspace. A sync client asks for changes after a cursor it already applied.",
      "minLength": 1,
      "maxLength": 32,
      "pattern": "^[0-9]+$"
    },
    "revisions": {
      "type": "array",
      "readOnly": true,
      "description": "Every accepted revision with the values that the workspace assigned. A client applies these without reading the workspace again, and a retry of the same mutation repeats them.",
      "minItems": 1,
      "maxItems": 4000,
      "items": {
        "$ref": "#/components/schemas/AcceptedRevision"
      }
    },
    "superseded": {
      "type": "array",
      "readOnly": true,
      "description": "Every file whose accepted head this changeset rebased, empty for the normal case. A client shows the person that a save from another device is now only in the history of the file.",
      "maxItems": 4000,
      "items": {
        "$ref": "#/components/schemas/SupersededHead"
      }
    }
  }
}
```

Schemas: [AcceptedRevision](https://docs.tidynotebook.com/api-schemas.md#acceptedrevision), [SupersededHead](https://docs.tidynotebook.com/api-schemas.md#supersededhead), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## AcceptedRevision

```json
{
  "type": "object",
  "description": "One revision as the workspace accepted it. The record carries the values that the workspace assigned, and no note text: the client that wrote the revision already holds its content, and an actor that may write but not read must not receive content through a write answer.",
  "additionalProperties": false,
  "required": [
    "revisionId",
    "fileId",
    "parents",
    "path",
    "deleted",
    "digest",
    "size",
    "actorAccountId",
    "serverTime",
    "message",
    "epoch",
    "acceptedState",
    "merged"
  ],
  "properties": {
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the accepted revision."
    },
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The file that the revision belongs to."
    },
    "parents": {
      "type": "array",
      "readOnly": true,
      "description": "The parents of the revision, in submitted order.",
      "maxItems": 2,
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true,
      "description": "The accepted path, in its normalized form."
    },
    "deleted": {
      "type": "boolean",
      "readOnly": true,
      "description": "True for a tombstone, which is how a deletion is recorded."
    },
    "digest": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ContentDigest"
        }
      ],
      "readOnly": true,
      "description": "Digest of the content of the revision."
    },
    "size": {
      "type": "integer",
      "readOnly": true,
      "description": "Size of the content in bytes.",
      "minimum": 0
    },
    "actorAccountId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The account that the workspace recorded as the author. It comes from the verified request; a client cannot supply it."
    },
    "serverTime": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the workspace accepted the revision.",
      "format": "date-time",
      "maxLength": 64
    },
    "message": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CheckpointMessage"
        }
      ],
      "readOnly": true,
      "description": "The checkpoint name of the revision, or null."
    },
    "epoch": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DocumentEpoch"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The generation of the document that this revision holds, or null for an attachment revision."
    },
    "acceptedState": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DocumentObservedState"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The complete state of the document after acceptance. It states identities and deletions, and it holds no note text, so an actor that may write and not read learns nothing from it. Absent for an attachment revision, where it is null."
    },
    "merged": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when this save joined work that the device had not seen. The device that saved keeps the checkpoint of that save for Review, and every device marks the revision in History."
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [ContentDigest](https://docs.tidynotebook.com/api-schemas.md#contentdigest), [DocumentEpoch](https://docs.tidynotebook.com/api-schemas.md#documentepoch), [DocumentObservedState](https://docs.tidynotebook.com/api-schemas.md#documentobservedstate), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## Account

```json
{
  "type": "object",
  "description": "The signed in account and its settings.",
  "additionalProperties": false,
  "required": [
    "accountId",
    "installationRole",
    "storage",
    "preferences",
    "consentRequired",
    "controls",
    "month",
    "accountPortal"
  ],
  "properties": {
    "accountId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Stable identifier of the account inside this deployment."
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Sign-in address, or null when no address is linked.",
      "maxLength": 320
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Display name, or null when no name is stored.",
      "maxLength": 256
    },
    "installationRole": {
      "allOf": [
        {
          "$ref": "#/components/schemas/InstallationRole"
        }
      ],
      "readOnly": true,
      "description": "The role of the account in the installation."
    },
    "storage": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountStorage"
        }
      ],
      "readOnly": true,
      "description": "The usage and the limit of the account."
    },
    "preferences": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Preferences"
        }
      ],
      "readOnly": true,
      "description": "The stored settings of the account."
    },
    "consentRequired": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the account must accept the current legal documents before the application opens (record 0120)."
    },
    "controls": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountControls"
        }
      ],
      "readOnly": true,
      "description": "The controls of the account (record 0189). A locked account opens one screen, which names the way to unlock it (record 0201)."
    },
    "month": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountMonth"
        }
      ],
      "readOnly": true,
      "description": "The transfer of the current month and each limit that holds the account now (record 0193)."
    },
    "accountPortal": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the installation names an account portal, which openAccountPortal opens (record 0190)."
    }
  }
}
```

Schemas: [AccountControls](https://docs.tidynotebook.com/api-schemas.md#accountcontrols), [AccountMonth](https://docs.tidynotebook.com/api-schemas.md#accountmonth), [AccountStorage](https://docs.tidynotebook.com/api-schemas.md#accountstorage), [InstallationRole](https://docs.tidynotebook.com/api-schemas.md#installationrole), [Preferences](https://docs.tidynotebook.com/api-schemas.md#preferences), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## AccountControls

```json
{
  "type": "object",
  "description": "The controls of one account and their revision (record 0189). With no setting of the operator, an account is active, has every feature, and has no text, transfer or download limit.",
  "additionalProperties": false,
  "required": [
    "revision",
    "standing",
    "removalAt",
    "limitBytes",
    "textLimitBytes",
    "publishedTransferLimitBytes",
    "downloadLimitBytes",
    "features"
  ],
  "properties": {
    "revision": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ControlRevision"
        }
      ],
      "readOnly": true,
      "description": "The revision of these controls."
    },
    "standing": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountStanding"
        }
      ],
      "readOnly": true,
      "description": "Whether the account is active or locked."
    },
    "removalAt": {
      "oneOf": [
        {
          "type": "string",
          "format": "date-time",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The instant after which the daily run removes a locked account, or null. Only a locked account has one (record 0201)."
    },
    "limitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The most bytes that the workspaces of the account can use (record 0112)."
    },
    "textLimitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteLimit"
        }
      ],
      "readOnly": true,
      "description": "The most bytes of text and history that the workspaces of the account can use, inside the storage limit, or null for no limit."
    },
    "publishedTransferLimitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteLimit"
        }
      ],
      "readOnly": true,
      "description": "The most bytes that the published pages of the account send in one calendar month in UTC, or null for no limit (record 0193)."
    },
    "downloadLimitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteLimit"
        }
      ],
      "readOnly": true,
      "description": "The most bytes that the account downloads in one calendar month in UTC, or null for no limit (record 0193)."
    },
    "features": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountFeatures"
        }
      ],
      "readOnly": true,
      "description": "The switch of each switchable feature."
    }
  }
}
```

Schemas: [AccountFeatures](https://docs.tidynotebook.com/api-schemas.md#accountfeatures), [AccountStanding](https://docs.tidynotebook.com/api-schemas.md#accountstanding), [ByteCount](https://docs.tidynotebook.com/api-schemas.md#bytecount), [ByteLimit](https://docs.tidynotebook.com/api-schemas.md#bytelimit), [ControlRevision](https://docs.tidynotebook.com/api-schemas.md#controlrevision).

## AccountControlsInput

```json
{
  "type": "object",
  "description": "A change of the controls of one account (record 0189). The write names the revision that it read, and the server refuses it with 409 and the code controls_changed when the stored revision differs, so nothing changes. A member that is absent keeps its stored value. Setting the standing to active clears the removal time, and only a locked account can have one.",
  "additionalProperties": false,
  "required": [
    "revision"
  ],
  "minProperties": 2,
  "properties": {
    "revision": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ControlRevision"
        }
      ],
      "writeOnly": true,
      "description": "The revision of the controls that the writer read."
    },
    "standing": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountStanding"
        }
      ],
      "writeOnly": true,
      "description": "The new standing."
    },
    "removalAt": {
      "oneOf": [
        {
          "type": "string",
          "format": "date-time",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "writeOnly": true,
      "description": "The new removal time of a locked account, or null for none."
    },
    "limitBytes": {
      "type": "integer",
      "writeOnly": true,
      "description": "The new storage limit, in bytes.",
      "minimum": 1,
      "maximum": 9007199254740991
    },
    "textLimitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteLimit"
        }
      ],
      "writeOnly": true,
      "description": "The new text limit, in bytes, or null for no limit."
    },
    "publishedTransferLimitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteLimit"
        }
      ],
      "writeOnly": true,
      "description": "The new published transfer limit of one month, in bytes, or null for no limit."
    },
    "downloadLimitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteLimit"
        }
      ],
      "writeOnly": true,
      "description": "The new download limit of one month, in bytes, or null for no limit."
    },
    "features": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountFeaturesInput"
        }
      ],
      "writeOnly": true,
      "description": "The feature switches to change."
    }
  }
}
```

Schemas: [AccountFeaturesInput](https://docs.tidynotebook.com/api-schemas.md#accountfeaturesinput), [AccountStanding](https://docs.tidynotebook.com/api-schemas.md#accountstanding), [ByteLimit](https://docs.tidynotebook.com/api-schemas.md#bytelimit), [ControlRevision](https://docs.tidynotebook.com/api-schemas.md#controlrevision).

## AccountEvent

```json
{
  "type": "object",
  "description": "One account event. It names the account and nothing else of it.",
  "additionalProperties": false,
  "required": [
    "cursor",
    "accountId",
    "kind",
    "occurredAt"
  ],
  "properties": {
    "cursor": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountEventCursor"
        }
      ],
      "readOnly": true,
      "description": "The position of the event."
    },
    "accountId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the account."
    },
    "kind": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountEventKind"
        }
      ],
      "readOnly": true,
      "description": "What happened."
    },
    "occurredAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which it happened.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

Schemas: [AccountEventCursor](https://docs.tidynotebook.com/api-schemas.md#accounteventcursor), [AccountEventKind](https://docs.tidynotebook.com/api-schemas.md#accounteventkind), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## AccountEventCursor

```json
{
  "type": "integer",
  "description": "The position of one account event. The positions follow the order in which the events committed, so a reader that continues after the last one that it read misses no event.",
  "minimum": 0,
  "maximum": 9007199254740991
}
```

## AccountEventKind

```json
{
  "type": "string",
  "description": "What happened to an account (record 0190).",
  "enum": [
    "made",
    "verified",
    "removed"
  ]
}
```

## AccountEventList

```json
{
  "type": "object",
  "description": "The account events after a cursor, oldest first, and the cursor to read after next.",
  "additionalProperties": false,
  "required": [
    "events",
    "cursor"
  ],
  "properties": {
    "events": {
      "type": "array",
      "readOnly": true,
      "description": "The events, oldest first.",
      "maxItems": 500,
      "items": {
        "$ref": "#/components/schemas/AccountEvent"
      }
    },
    "cursor": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountEventCursor"
        }
      ],
      "readOnly": true,
      "description": "The position of the last event of the answer, or the position that the request named when the answer holds none."
    }
  }
}
```

Schemas: [AccountEvent](https://docs.tidynotebook.com/api-schemas.md#accountevent), [AccountEventCursor](https://docs.tidynotebook.com/api-schemas.md#accounteventcursor).

## AccountFeatures

```json
{
  "type": "object",
  "description": "The switch of each feature that a later design makes switchable (record 0189). Every switch is on by default, and a self-hosted installation never needs to turn one off.",
  "additionalProperties": false,
  "required": [
    "teams",
    "collaboration"
  ],
  "properties": {
    "teams": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the account can use teams."
    },
    "collaboration": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the account can use collaboration."
    }
  }
}
```

## AccountFeaturesInput

```json
{
  "type": "object",
  "description": "The feature switches that a write changes. A member that is absent keeps its stored value.",
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "teams": {
      "type": "boolean",
      "writeOnly": true,
      "description": "Whether the account can use teams."
    },
    "collaboration": {
      "type": "boolean",
      "writeOnly": true,
      "description": "Whether the account can use collaboration."
    }
  }
}
```

## AccountList

```json
{
  "type": "object",
  "description": "Every account of the installation.",
  "additionalProperties": false,
  "required": [
    "accounts"
  ],
  "properties": {
    "accounts": {
      "type": "array",
      "readOnly": true,
      "description": "The accounts, in the order in which they were made.",
      "maxItems": 10000,
      "items": {
        "$ref": "#/components/schemas/AccountSummary"
      }
    }
  }
}
```

Schemas: [AccountSummary](https://docs.tidynotebook.com/api-schemas.md#accountsummary).

## AccountMonth

```json
{
  "type": "object",
  "description": "What the account sent in the current calendar month in UTC, and each limit of record 0193 that holds it now. A state is true past the limit of the account or past the cap of the installation, and it holds until endsAt.",
  "additionalProperties": false,
  "required": [
    "month",
    "endsAt",
    "publishedTransferBytes",
    "downloadBytes",
    "publishedPagesClosed",
    "downloadsPaused",
    "uploadsPaused",
    "imagesPaused"
  ],
  "properties": {
    "month": {
      "allOf": [
        {
          "$ref": "#/components/schemas/UsageMonth"
        }
      ],
      "readOnly": true,
      "description": "The month of the counts."
    },
    "endsAt": {
      "type": "string",
      "format": "date-time",
      "maxLength": 64,
      "readOnly": true,
      "description": "The first instant of the next month in UTC, when every count starts again from zero."
    },
    "publishedTransferBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The bytes that the published pages of the account sent in the month."
    },
    "downloadBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The bytes that the account downloaded in the month."
    },
    "publishedPagesClosed": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether each published link of the account answers the closed page, past its published transfer limit or the published transfer cap of the installation."
    },
    "downloadsPaused": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether an export, an attachment and a sync snapshot answer download_limit, past the download limit of the account or the download cap of the installation."
    },
    "uploadsPaused": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether an upload and an import answer storage_busy, past the object write cap of the installation."
    },
    "imagesPaused": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether an attachment answers download_limit and a published page shows no image, past the object read cap of the installation."
    }
  }
}
```

Schemas: [ByteCount](https://docs.tidynotebook.com/api-schemas.md#bytecount), [UsageMonth](https://docs.tidynotebook.com/api-schemas.md#usagemonth).

## AccountRemovalInput

```json
{
  "type": "object",
  "description": "The password of the account that removes itself.",
  "additionalProperties": false,
  "required": [
    "password"
  ],
  "properties": {
    "password": {
      "type": "string",
      "description": "The current password of the account.",
      "minLength": 1,
      "maxLength": 512,
      "writeOnly": true
    }
  }
}
```

## AccountSession

```json
{
  "type": "object",
  "description": "One session of the signed in account, on one device. It holds no token, so a read of the list opens no session.",
  "additionalProperties": false,
  "required": [
    "sessionId",
    "current",
    "userAgent",
    "createdAt",
    "lastActiveAt",
    "expiresAt"
  ],
  "properties": {
    "sessionId": {
      "type": "string",
      "readOnly": true,
      "description": "Identifier of the session. It is not the token.",
      "minLength": 1,
      "maxLength": 128
    },
    "current": {
      "type": "boolean",
      "readOnly": true,
      "description": "True for the session of the device that reads the list."
    },
    "userAgent": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "What the browser of the session said it is, or null when it said nothing.",
      "maxLength": 512
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the session started.",
      "format": "date-time",
      "maxLength": 64
    },
    "lastActiveAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the session was last used.",
      "format": "date-time",
      "maxLength": 64
    },
    "expiresAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the session ends if nobody uses it.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

## AccountSessionList

```json
{
  "type": "object",
  "description": "Every session of the signed in account.",
  "additionalProperties": false,
  "required": [
    "sessions"
  ],
  "properties": {
    "sessions": {
      "type": "array",
      "readOnly": true,
      "description": "The sessions, the current one first, then newest first.",
      "maxItems": 1000,
      "items": {
        "$ref": "#/components/schemas/AccountSession"
      }
    }
  }
}
```

Schemas: [AccountSession](https://docs.tidynotebook.com/api-schemas.md#accountsession).

## AccountStanding

```json
{
  "type": "string",
  "description": "The standing of an account (record 0189). An active account uses every operation. A locked account keeps a fixed list of operations, and every other operation answers 423 with the code account_locked (record 0201).",
  "enum": [
    "active",
    "locked"
  ]
}
```

## AccountState

```json
{
  "type": "string",
  "description": "Whether an account can sign in. A disabled account keeps its notes and gets no session.",
  "enum": [
    "enabled",
    "disabled"
  ]
}
```

## AccountStorage

```json
{
  "type": "object",
  "description": "The bytes that the workspaces of one account use, and the limit of that account. The owner of a workspace pays for every byte in it.",
  "additionalProperties": false,
  "required": [
    "usedBytes",
    "limitBytes"
  ],
  "properties": {
    "usedBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The bytes that the workspaces of the account use."
    },
    "limitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The most bytes that the workspaces of the account can use."
    }
  }
}
```

Schemas: [ByteCount](https://docs.tidynotebook.com/api-schemas.md#bytecount).

## AccountSummary

```json
{
  "type": "object",
  "description": "One account as an administrator sees it. It holds no note and no workspace of the account.",
  "additionalProperties": false,
  "required": [
    "accountId",
    "email",
    "name",
    "installationRole",
    "state",
    "createdAt",
    "lastActiveAt",
    "storage",
    "controls",
    "self"
  ],
  "properties": {
    "accountId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the account."
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Sign-in address of the account.",
      "maxLength": 320
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Display name of the account.",
      "maxLength": 256
    },
    "installationRole": {
      "allOf": [
        {
          "$ref": "#/components/schemas/InstallationRole"
        }
      ],
      "readOnly": true,
      "description": "The role of the account in the installation."
    },
    "state": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountState"
        }
      ],
      "readOnly": true,
      "description": "Whether the account can sign in."
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the account was made.",
      "format": "date-time",
      "maxLength": 64
    },
    "lastActiveAt": {
      "oneOf": [
        {
          "type": "string",
          "format": "date-time",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The last instant at which a session of the account was used, or null when the account has no session."
    },
    "storage": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountStorage"
        }
      ],
      "readOnly": true,
      "description": "The usage and the limit of the account."
    },
    "controls": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountControls"
        }
      ],
      "readOnly": true,
      "description": "The controls of the account and their revision (record 0189)."
    },
    "self": {
      "type": "boolean",
      "readOnly": true,
      "description": "True for the account that reads the list."
    }
  }
}
```

Schemas: [AccountControls](https://docs.tidynotebook.com/api-schemas.md#accountcontrols), [AccountState](https://docs.tidynotebook.com/api-schemas.md#accountstate), [AccountStorage](https://docs.tidynotebook.com/api-schemas.md#accountstorage), [InstallationRole](https://docs.tidynotebook.com/api-schemas.md#installationrole), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## AccountUpdateInput

```json
{
  "type": "object",
  "description": "The facts of an account that an administrator changes. A member that is absent keeps its stored value.",
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "installationRole": {
      "allOf": [
        {
          "$ref": "#/components/schemas/InstallationRole"
        }
      ],
      "description": "The new role of the account in the installation."
    },
    "state": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountState"
        }
      ],
      "description": "The new state. A disabled account loses every session and gets no new one."
    },
    "limitBytes": {
      "type": "integer",
      "description": "The new limit of the account, in bytes.",
      "minimum": 1,
      "maximum": 9007199254740991
    },
    "controls": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountControlsInput"
        }
      ],
      "description": "A change of the controls, with the revision that the administrator read (record 0189). It cannot name a storage limit together with limitBytes."
    }
  }
}
```

Schemas: [AccountControlsInput](https://docs.tidynotebook.com/api-schemas.md#accountcontrolsinput), [AccountState](https://docs.tidynotebook.com/api-schemas.md#accountstate), [InstallationRole](https://docs.tidynotebook.com/api-schemas.md#installationrole).

## AccountUsage

```json
{
  "type": "object",
  "description": "What one account uses: the stored bytes, the part of them that is text and history, and the transfer of the current month in UTC (record 0193).",
  "additionalProperties": false,
  "required": [
    "usedBytes",
    "textBytes",
    "month",
    "publishedTransferBytes",
    "downloadBytes"
  ],
  "properties": {
    "usedBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The bytes that the workspaces of the account use."
    },
    "textBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The part of the used bytes that is text and history."
    },
    "month": {
      "allOf": [
        {
          "$ref": "#/components/schemas/UsageMonth"
        }
      ],
      "readOnly": true,
      "description": "The month of the two transfer counts."
    },
    "publishedTransferBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The bytes that the published pages of the account sent in the month."
    },
    "downloadBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The bytes that the account downloaded in the month."
    }
  }
}
```

Schemas: [ByteCount](https://docs.tidynotebook.com/api-schemas.md#bytecount), [UsageMonth](https://docs.tidynotebook.com/api-schemas.md#usagemonth).

## AddressVerificationInput

```json
{
  "type": "object",
  "description": "The token that a verification link carries in its fragment.",
  "additionalProperties": false,
  "required": [
    "token"
  ],
  "properties": {
    "token": {
      "type": "string",
      "description": "The token of the verification link.",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[A-Za-z0-9_.-]+$"
    }
  }
}
```

## AddressVerified

```json
{
  "type": "object",
  "description": "The address that the verification proved. Its account now exists.",
  "additionalProperties": false,
  "required": [
    "email"
  ],
  "properties": {
    "email": {
      "allOf": [
        {
          "$ref": "#/components/schemas/EmailAddress"
        }
      ],
      "readOnly": true,
      "description": "The address of the new account, which signs in now."
    }
  }
}
```

Schemas: [EmailAddress](https://docs.tidynotebook.com/api-schemas.md#emailaddress).

## ApiKey

```json
{
  "type": "object",
  "description": "One key of the account. No secret or digest is included.",
  "additionalProperties": false,
  "required": [
    "keyId",
    "name",
    "createdAt",
    "expiresAt",
    "lastUsedAt"
  ],
  "properties": {
    "keyId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier used to revoke the key. It is not the secret."
    },
    "name": {
      "type": "string",
      "readOnly": true,
      "description": "Name of the program that uses the key.",
      "minLength": 1,
      "maxLength": 80
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Time when the key was made.",
      "format": "date-time",
      "maxLength": 64
    },
    "expiresAt": {
      "type": "string",
      "readOnly": true,
      "description": "Time after which the key is refused.",
      "format": "date-time",
      "maxLength": 64
    },
    "lastUsedAt": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Last use of the key, or null when it has not been used.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## ApiKeyCreateInput

```json
{
  "type": "object",
  "description": "The name and lifetime of a full account key.",
  "additionalProperties": false,
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "writeOnly": true,
      "description": "Name of the program. Use no leading or trailing space.",
      "minLength": 1,
      "maxLength": 80,
      "pattern": "^(?!.*[\\p{Cc}\\p{Cf}\\u2028\\u2029])\\S(?:[\\s\\S]*\\S)?$"
    },
    "expiresInDays": {
      "type": "integer",
      "writeOnly": true,
      "description": "Lifetime in whole days. The default is 90 days.",
      "minimum": 1,
      "maximum": 365,
      "default": 90
    }
  }
}
```

## ApiKeyCreated

```json
{
  "type": "object",
  "description": "A new key. Copy the token now. The server never shows it again.",
  "additionalProperties": false,
  "required": [
    "key",
    "token"
  ],
  "properties": {
    "key": {
      "$ref": "#/components/schemas/ApiKey"
    },
    "token": {
      "type": "string",
      "readOnly": true,
      "description": "The one secret. Send it as a bearer header through HTTPS.",
      "pattern": "^tnk_[A-Za-z0-9_-]{43}$",
      "minLength": 47,
      "maxLength": 47
    }
  }
}
```

Schemas: [ApiKey](https://docs.tidynotebook.com/api-schemas.md#apikey).

## ApiKeyList

```json
{
  "type": "object",
  "description": "The keys of the account, including expired keys. No token is included.",
  "additionalProperties": false,
  "required": [
    "keys"
  ],
  "properties": {
    "keys": {
      "type": "array",
      "readOnly": true,
      "description": "Keys of the account, newest first.",
      "maxItems": 25,
      "items": {
        "$ref": "#/components/schemas/ApiKey"
      }
    }
  }
}
```

Schemas: [ApiKey](https://docs.tidynotebook.com/api-schemas.md#apikey).

## Appearance

```json
{
  "type": "string",
  "description": "Appearance choice. The value system follows the device preference between the light and the dark variant of the chosen theme family.",
  "enum": [
    "system",
    "light",
    "dark"
  ]
}
```

## AttachmentContentInput

```json
{
  "type": "object",
  "description": "The content of one attachment revision. It names a finalized object of the same workspace and the digest of its bytes.",
  "additionalProperties": false,
  "required": [
    "kind",
    "digest",
    "attachmentObjectId"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Names this content form.",
      "enum": [
        "attachment"
      ]
    },
    "digest": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ContentDigest"
        }
      ],
      "description": "Digest of the bytes. The server recomputes it and refuses a revision that declares another value."
    },
    "attachmentObjectId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "The finalized attachment object of this revision."
    }
  }
}
```

Schemas: [ContentDigest](https://docs.tidynotebook.com/api-schemas.md#contentdigest), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## AttachmentUploadResult

```json
{
  "type": "object",
  "description": "The uploaded temporary attachment object and its verified digest.",
  "additionalProperties": false,
  "required": [
    "objectId",
    "digest",
    "size",
    "mediaType",
    "width",
    "height"
  ],
  "properties": {
    "objectId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Unique identifier of the uploaded attachment object."
    },
    "digest": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ContentDigest"
        }
      ],
      "description": "SHA-256 digest of the validated image bytes."
    },
    "size": {
      "type": "integer",
      "minimum": 1,
      "description": "Size of the attachment in bytes."
    },
    "mediaType": {
      "type": "string",
      "description": "Validated MIME type of the uploaded image.",
      "enum": [
        "image/png",
        "image/jpeg",
        "image/gif",
        "image/webp"
      ]
    },
    "width": {
      "type": "integer",
      "minimum": 1,
      "description": "Width of the image in pixels."
    },
    "height": {
      "type": "integer",
      "minimum": 1,
      "description": "Height of the image in pixels."
    }
  }
}
```

Schemas: [ContentDigest](https://docs.tidynotebook.com/api-schemas.md#contentdigest), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## AuthCurrentSession

```json
{
  "type": [
    "object",
    "null"
  ],
  "description": "The current session, or null when there is none.",
  "additionalProperties": true,
  "properties": {
    "user": {
      "$ref": "#/components/schemas/AuthUser"
    },
    "session": {
      "$ref": "#/components/schemas/AuthSessionRecord"
    }
  }
}
```

Schemas: [AuthSessionRecord](https://docs.tidynotebook.com/api-schemas.md#authsessionrecord), [AuthUser](https://docs.tidynotebook.com/api-schemas.md#authuser).

## AuthOutcome

```json
{
  "type": "object",
  "description": "Whether the protocol endpoint completed its work.",
  "additionalProperties": true,
  "required": [
    "status"
  ],
  "properties": {
    "status": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the endpoint completed its work."
    }
  }
}
```

## AuthPasswordReset

```json
{
  "type": "object",
  "description": "The new password and the token from the reset message.",
  "additionalProperties": false,
  "required": [
    "newPassword"
  ],
  "properties": {
    "newPassword": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Password"
        }
      ],
      "description": "New password of the account."
    },
    "token": {
      "type": "string",
      "description": "Token from the reset message.",
      "minLength": 1,
      "maxLength": 512
    }
  }
}
```

Schemas: [Password](https://docs.tidynotebook.com/api-schemas.md#password).

## AuthPasswordResetRequest

```json
{
  "type": "object",
  "description": "The address that asks for a password reset message.",
  "additionalProperties": false,
  "required": [
    "email"
  ],
  "properties": {
    "email": {
      "type": "string",
      "description": "Sign-in address of the account.",
      "format": "email",
      "minLength": 3,
      "maxLength": 320
    }
  }
}
```

## AuthPasswordSignIn

```json
{
  "type": "object",
  "description": "Address and password of a local account.",
  "additionalProperties": false,
  "required": [
    "email",
    "password"
  ],
  "properties": {
    "email": {
      "type": "string",
      "description": "Sign-in address of the account.",
      "format": "email",
      "minLength": 3,
      "maxLength": 320
    },
    "password": {
      "type": "string",
      "description": "Password of the account.",
      "minLength": 1,
      "maxLength": 512
    },
    "rememberMe": {
      "type": "boolean",
      "description": "Whether the session survives a browser restart."
    },
    "callbackURL": {
      "type": "string",
      "description": "Address to open after a completed sign-in.",
      "maxLength": 2048
    }
  }
}
```

## AuthSession

```json
{
  "type": "object",
  "description": "The result of a completed sign-in. It never carries the session token: the browser already holds that value in an HttpOnly cookie, and the protocol adapter removes it from this answer.",
  "additionalProperties": true,
  "required": [
    "redirect"
  ],
  "properties": {
    "redirect": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the caller should follow a redirect."
    },
    "token": {
      "not": {},
      "description": "Never present. The adapter removes the session token from this answer."
    },
    "url": {
      "type": "string",
      "readOnly": true,
      "description": "Address to open, when the answer asks for a redirect.",
      "maxLength": 2048
    },
    "user": {
      "$ref": "#/components/schemas/AuthUser"
    }
  }
}
```

Schemas: [AuthUser](https://docs.tidynotebook.com/api-schemas.md#authuser).

## AuthSessionRecord

```json
{
  "type": "object",
  "description": "The stored session of the signed in user. It never carries the session token: the browser already holds that value in an HttpOnly cookie, and the protocol adapter removes it from this answer.",
  "additionalProperties": true,
  "required": [
    "id",
    "expiresAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true,
      "description": "Identifier of the session record.",
      "minLength": 1,
      "maxLength": 128
    },
    "expiresAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant after which the session is refused.",
      "maxLength": 64
    },
    "token": {
      "not": {},
      "description": "Never present. The adapter removes the session token from this answer."
    }
  }
}
```

## AuthSignOut

```json
{
  "type": "object",
  "description": "Sign-out carries no data. The session cookie names it.",
  "additionalProperties": false,
  "properties": {}
}
```

## AuthSignOutResult

```json
{
  "type": "object",
  "description": "Whether the session was ended.",
  "additionalProperties": true,
  "required": [
    "success"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the session no longer exists."
    }
  }
}
```

## AuthUser

```json
{
  "type": "object",
  "description": "The signed in user as the identity provider reports it.",
  "additionalProperties": true,
  "required": [
    "id",
    "email"
  ],
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true,
      "description": "Identifier of the user inside the identity provider.",
      "minLength": 1,
      "maxLength": 128
    },
    "email": {
      "type": "string",
      "readOnly": true,
      "description": "Sign-in address of the user.",
      "maxLength": 320
    },
    "name": {
      "type": "string",
      "readOnly": true,
      "description": "Display name of the user.",
      "maxLength": 256
    },
    "emailVerified": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the provider reported the address as verified."
    }
  }
}
```

## Backlink

```json
{
  "type": "object",
  "description": "One live note that links to the requested file path.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "path",
    "revisionId"
  ],
  "properties": {
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true
    },
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true
    }
  }
}
```

Schemas: [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## BacklinkList

```json
{
  "type": "object",
  "description": "Live notes that link to one current file path.",
  "additionalProperties": false,
  "required": [
    "backlinks"
  ],
  "properties": {
    "backlinks": {
      "type": "array",
      "readOnly": true,
      "maxItems": 100,
      "items": {
        "$ref": "#/components/schemas/Backlink"
      }
    }
  }
}
```

Schemas: [Backlink](https://docs.tidynotebook.com/api-schemas.md#backlink).

## BlockingReference

```json
{
  "type": "object",
  "description": "A reference that blocks permanent deletion.",
  "additionalProperties": false,
  "required": [
    "kind",
    "targetId",
    "referrerId",
    "description"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "revision"
      ]
    },
    "targetId": {
      "type": "string"
    },
    "referrerId": {
      "type": "string"
    },
    "description": {
      "type": "string"
    }
  }
}
```

## ByteCount

```json
{
  "type": "integer",
  "description": "A number of bytes.",
  "minimum": 0,
  "maximum": 9007199254740991
}
```

## ByteLimit

```json
{
  "type": [
    "integer",
    "null"
  ],
  "description": "A most number of bytes, or null for no limit.",
  "minimum": 1,
  "maximum": 9007199254740991
}
```

## ChangesetInput

```json
{
  "type": "object",
  "description": "One atomic change of one or more files.",
  "additionalProperties": false,
  "required": [
    "mutationId",
    "deviceId",
    "expectedHeads",
    "revisions"
  ],
  "properties": {
    "mutationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identity of this operation. A retry with the same identity and the same body returns the first outcome."
    },
    "deviceId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DeviceId"
        }
      ],
      "description": "The device that submitted the changeset."
    },
    "expectedHeads": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ExpectedHeads"
        }
      ],
      "description": "The precondition of every file that the changeset changes."
    },
    "revisions": {
      "type": "array",
      "description": "The revisions to accept, in submission order. The revisions of one file form one chain, and the last one becomes its head. One changeset may change at most 1000 files, and a file may carry several revisions, so the limit below is above the file limit.",
      "minItems": 1,
      "maxItems": 4000,
      "items": {
        "$ref": "#/components/schemas/RevisionInput"
      }
    }
  }
}
```

Schemas: [DeviceId](https://docs.tidynotebook.com/api-schemas.md#deviceid), [ExpectedHeads](https://docs.tidynotebook.com/api-schemas.md#expectedheads), [RevisionInput](https://docs.tidynotebook.com/api-schemas.md#revisioninput), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## CheckpointMessage

```json
{
  "type": [
    "string",
    "null"
  ],
  "description": "Name of a checkpoint, or null for an ordinary revision. It is written by the author and is not interpreted by the server.",
  "maxLength": 512
}
```

## ConsentInput

```json
{
  "type": "object",
  "description": "The versions of the two legal documents that a person accepts.",
  "additionalProperties": false,
  "required": [
    "termsVersion",
    "privacyVersion"
  ],
  "properties": {
    "termsVersion": {
      "type": "string",
      "description": "The version of the terms that the person read.",
      "minLength": 1,
      "maxLength": 64
    },
    "privacyVersion": {
      "type": "string",
      "description": "The version of the privacy notice that the person read.",
      "minLength": 1,
      "maxLength": 64
    }
  }
}
```

## ConsentRecorded

```json
{
  "type": "object",
  "description": "The account accepted the current legal documents.",
  "additionalProperties": false,
  "required": [
    "accepted"
  ],
  "properties": {
    "accepted": {
      "type": "boolean",
      "const": true,
      "readOnly": true,
      "description": "The consent is stored with its time."
    }
  }
}
```

## ContentDigest

```json
{
  "type": "string",
  "description": "The SHA-256 digest of the content, in lower case hexadecimal. Content is addressed by this value, so it is verified against the bytes before a revision is accepted.",
  "minLength": 64,
  "maxLength": 64,
  "pattern": "^[0-9a-f]{64}$"
}
```

## ContentInput

```json
{
  "description": "The content of one submitted revision. A note carries document work; an attachment names finalized bytes. The kind states which form applies.",
  "oneOf": [
    {
      "$ref": "#/components/schemas/MarkdownContentInput"
    },
    {
      "$ref": "#/components/schemas/AttachmentContentInput"
    }
  ]
}
```

Schemas: [AttachmentContentInput](https://docs.tidynotebook.com/api-schemas.md#attachmentcontentinput), [MarkdownContentInput](https://docs.tidynotebook.com/api-schemas.md#markdowncontentinput).

## ControlRevision

```json
{
  "type": "integer",
  "description": "The revision of the controls of one account. The server raises it on each change of a control, and a write names the revision that it read (record 0189).",
  "minimum": 1,
  "maximum": 9007199254740991
}
```

## CreateFileInput

```json
{
  "type": "object",
  "description": "The identifiers, the path, and the first content of a new file.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "revisionId",
    "mutationId",
    "deviceId",
    "path",
    "document"
  ],
  "properties": {
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identifier of the new file. The client assigns it, so a file that was written offline keeps one identity everywhere."
    },
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identifier of the first revision."
    },
    "mutationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identity of this operation. A retry that repeats it returns the first outcome instead of writing a second time."
    },
    "deviceId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DeviceId"
        }
      ],
      "description": "The device that submitted the change."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "description": "Path of the new note, which must end in .md."
    },
    "document": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DocumentSave"
        }
      ],
      "description": "The document work of the first revision. A new note starts on the device that creates it, so the save carries the whole document."
    },
    "message": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CheckpointMessage"
        }
      ],
      "description": "Name of this checkpoint, or null."
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [DeviceId](https://docs.tidynotebook.com/api-schemas.md#deviceid), [DocumentSave](https://docs.tidynotebook.com/api-schemas.md#documentsave), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## CreatePublishedLinkInput

```json
{
  "type": "object",
  "description": "What to publish, and how a reader reaches it.",
  "additionalProperties": false,
  "required": [
    "scope"
  ],
  "properties": {
    "scope": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PublishedScope"
        }
      ],
      "description": "The one note, or the one folder, that the link opens."
    },
    "password": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Password"
        }
      ],
      "description": "Password that a reader gives before it reads the link. Leave it out for a link that opens without one. The product keeps one password policy, so this bound is the bound of an account password."
    },
    "expiresAt": {
      "type": "string",
      "writeOnly": true,
      "description": "Instant after which the link opens nothing. Leave it out for a link that lasts until the owner revokes it.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

Schemas: [Password](https://docs.tidynotebook.com/api-schemas.md#password), [PublishedScope](https://docs.tidynotebook.com/api-schemas.md#publishedscope).

## DailyNoteSettings

```json
{
  "type": "object",
  "description": "The settings of daily notes that one member keeps in one workspace.",
  "additionalProperties": false,
  "required": [
    "templateFileId",
    "openOnStart",
    "folder",
    "format"
  ],
  "properties": {
    "templateFileId": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The note whose text a new daily note starts with, or null for a daily note that starts empty."
    },
    "openOnStart": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the note of today opens when the application starts."
    },
    "folder": {
      "type": "string",
      "readOnly": true,
      "description": "The folder that holds every daily note, or an empty text for the top of the workspace.",
      "maxLength": 1024
    },
    "format": {
      "type": "string",
      "readOnly": true,
      "description": "The name of a daily note as date tokens, where a slash makes folders, for example YYYY/MM/YYYY-MM-DD dddd.",
      "minLength": 1,
      "maxLength": 255
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## DailyNoteSettingsInput

```json
{
  "type": "object",
  "description": "The settings of daily notes to store for the signed in member.",
  "additionalProperties": false,
  "required": [
    "templateFileId",
    "openOnStart",
    "folder",
    "format"
  ],
  "properties": {
    "templateFileId": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ],
      "description": "A live note of this workspace whose text a new daily note starts with, or null for a daily note that starts empty."
    },
    "openOnStart": {
      "type": "boolean",
      "description": "True to open the note of today when the application starts."
    },
    "folder": {
      "type": "string",
      "description": "The folder that holds every daily note, or an empty text for the top of the workspace.",
      "maxLength": 1024
    },
    "format": {
      "type": "string",
      "description": "The name of a daily note as date tokens, where a slash makes folders, for example YYYY/MM/YYYY-MM-DD dddd.",
      "minLength": 1,
      "maxLength": 255
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## DeleteFileInput

```json
{
  "type": "object",
  "description": "The identifiers of a tombstone revision.",
  "additionalProperties": false,
  "required": [
    "revisionId",
    "mutationId",
    "deviceId",
    "document"
  ],
  "properties": {
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identifier of the tombstone revision."
    },
    "mutationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identity of this operation, which makes a retry safe."
    },
    "deviceId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DeviceId"
        }
      ],
      "description": "The device that submitted the deletion."
    },
    "message": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CheckpointMessage"
        }
      ],
      "description": "Reason for the deletion, or null."
    },
    "document": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DocumentSave"
        }
      ],
      "description": "What the device had seen of the document when it deleted the note. The save carries no update. The workspace refuses the deletion when the state does not cover the text work that the note holds, so a deletion never hides an edit that the device never saw."
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [DeviceId](https://docs.tidynotebook.com/api-schemas.md#deviceid), [DocumentSave](https://docs.tidynotebook.com/api-schemas.md#documentsave), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## DeviceId

```json
{
  "type": "string",
  "description": "The device that submitted the change. It is informational and appears in the history of the workspace.",
  "minLength": 1,
  "maxLength": 128
}
```

## DocumentEpoch

```json
{
  "type": "integer",
  "description": "The generation of the document of one note. Identities of one epoch say nothing about another, so two states are compared inside one epoch only. Routine compaction keeps the epoch; a migration or an explicit repair starts a new one.",
  "minimum": 1
}
```

## DocumentObservedState

```json
{
  "type": "string",
  "description": "The complete observed state of a document, as base64. It holds the state vector and the deletion set, so it states every insertion and every deletion that the device has seen. A state vector alone serves a delta and never decides whether work is unseen.",
  "contentEncoding": "base64",
  "pattern": "^[A-Za-z0-9+/]*={0,2}$",
  "maxLength": 1398104
}
```

## DocumentSave

```json
{
  "type": "object",
  "description": "The text work of one saved note: the update, the generation it belongs to, and the complete state that the device had seen when it saved. The server derives the Markdown and its digest from the accepted document, so a save carries no text.",
  "additionalProperties": false,
  "required": [
    "update",
    "epoch",
    "observed"
  ],
  "properties": {
    "update": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DocumentUpdate"
        },
        {
          "type": "null"
        }
      ],
      "description": "The work of this save, from the last state the device sent, or null when the save carries no text work. A deletion states what the device had seen and nothing else."
    },
    "epoch": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DocumentEpoch"
        }
      ],
      "description": "The generation that this update belongs to."
    },
    "observed": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DocumentObservedState"
        }
      ],
      "description": "The complete state that the device had seen at the save. The workspace reads it to decide whether the save joins unseen work, and whether a deletion would hide an edit that the device never saw."
    }
  }
}
```

Schemas: [DocumentEpoch](https://docs.tidynotebook.com/api-schemas.md#documentepoch), [DocumentObservedState](https://docs.tidynotebook.com/api-schemas.md#documentobservedstate), [DocumentUpdate](https://docs.tidynotebook.com/api-schemas.md#documentupdate).

## DocumentStateVector

```json
{
  "type": "string",
  "description": "The state vector of a document, as base64. A reader sends it to ask for the work that it lacks. It names insertions only, so it never answers whether a deletion is unseen.",
  "contentEncoding": "base64",
  "pattern": "^[A-Za-z0-9+/]*={0,2}$",
  "maxLength": 1398104
}
```

## DocumentUpdate

```json
{
  "type": "string",
  "description": "One document update, as base64. It carries the text work of a note and nothing else. The server applies it to a trial document and refuses it when it is malformed, when it names work that the document lacks, when it writes anything other than the text of the note, or when the result passes a bound.",
  "contentEncoding": "base64",
  "pattern": "^[A-Za-z0-9+/]*={0,2}$",
  "maxLength": 2796204
}
```

## EmailAddress

```json
{
  "type": "string",
  "description": "A sign-in address.",
  "format": "email",
  "minLength": 3,
  "maxLength": 320
}
```

## EntityTagCondition

```json
{
  "type": "string",
  "description": "A conditional request header value: either the literal *, or one or more entity tags separated by commas. A tag is quoted, and a weak tag carries the W/ prefix. A write compares strongly, as RFC 9110 requires, so it accepts a strong tag only.",
  "minLength": 1,
  "maxLength": 1024,
  "pattern": "^(?:\\*|(?:W/)?\"[^\"]*\"(?:[ \\t]*,[ \\t]*(?:W/)?\"[^\"]*\")*)$"
}
```

## ExpectedHeads

```json
{
  "type": "object",
  "description": "The accepted head that the client saw for each file of the changeset, keyed by file identifier. The value null states that the file must not exist in accepted state, which is the precondition of a new file. Every file that the changeset changes needs an entry, and an entry for a file that it does not change is refused. The limit below is a coarse bound that protects the parser; the rule that a changeset may change at most 1000 files is applied by the workspace and answers 422.",
  "maxProperties": 4000,
  "propertyNames": {
    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
  },
  "additionalProperties": {
    "oneOf": [
      {
        "$ref": "#/components/schemas/Uuid"
      },
      {
        "type": "null"
      }
    ]
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## FileChange

```json
{
  "type": "object",
  "description": "The revision that one single file operation accepted.",
  "additionalProperties": false,
  "required": [
    "revision",
    "accepted"
  ],
  "properties": {
    "revision": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AcceptedRevision"
        }
      ],
      "readOnly": true,
      "description": "The accepted revision, as the workspace recorded it. Its identifier is the entity tag of the answer. It carries no text: the request that wrote it already holds the content."
    },
    "accepted": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AcceptedChangeset"
        }
      ],
      "readOnly": true,
      "description": "The outcome of the changeset that carried the revision."
    }
  }
}
```

Schemas: [AcceptedChangeset](https://docs.tidynotebook.com/api-schemas.md#acceptedchangeset), [AcceptedRevision](https://docs.tidynotebook.com/api-schemas.md#acceptedrevision).

## FileKind

```json
{
  "type": "string",
  "description": "Whether a file holds Markdown or an attachment.",
  "enum": [
    "note",
    "attachment"
  ]
}
```

## FilePageToken

```json
{
  "type": "string",
  "description": "Opaque position inside one file listing. It belongs to the sort that produced it and carries no meaning for a client.",
  "minLength": 1,
  "maxLength": 2048,
  "pattern": "^(updated|path)\\.[0-9a-fA-F-]{36}\\.[A-Za-z0-9\\-._~!*'()%]*$"
}
```

## FilePath

```json
{
  "type": "string",
  "description": "Relative POSIX path of the file inside its workspace. A note path ends in .md. The stored path is the Unicode NFC form of this value, and it is compared case sensitively.",
  "minLength": 1,
  "maxLength": 1024
}
```

## FileReadContent

```json
{
  "type": "string",
  "description": "The parts of the head that a file read carries. `text` is the Markdown alone, for a reader that shows the text. `full` is the Markdown and the whole document of the note, for an editor that merges later work.",
  "enum": [
    "text",
    "full"
  ],
  "default": "full"
}
```

## FileRevision

```json
{
  "type": "object",
  "description": "One immutable revision. Its identity, its parents, and its content never change after acceptance.",
  "additionalProperties": false,
  "required": [
    "revisionId",
    "fileId",
    "path",
    "kind",
    "deleted",
    "parents",
    "digest",
    "size",
    "text",
    "document",
    "epoch",
    "merged",
    "attachmentObjectId",
    "message",
    "restoredFrom",
    "clientTime",
    "serverTime"
  ],
  "properties": {
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of this revision."
    },
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The file that this revision belongs to."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true,
      "description": "The path of the file at this revision."
    },
    "kind": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FileKind"
        }
      ],
      "readOnly": true,
      "description": "Whether this revision holds Markdown or an attachment."
    },
    "deleted": {
      "type": "boolean",
      "readOnly": true,
      "description": "True for a tombstone, which is how a deletion is recorded."
    },
    "parents": {
      "type": "array",
      "readOnly": true,
      "description": "The parents of this revision, in submitted order. A first revision has none, a normal revision has one, and an explicit merge has two.",
      "maxItems": 2,
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "digest": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ContentDigest"
        }
      ],
      "readOnly": true,
      "description": "Digest of the content of this revision."
    },
    "size": {
      "type": "integer",
      "readOnly": true,
      "description": "Size of the content in bytes.",
      "minimum": 0
    },
    "text": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/MarkdownText"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The Markdown of this revision, or null for an attachment revision."
    },
    "attachmentObjectId": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The immutable attachment object of this revision, or null for a Markdown revision. Its bytes are transferred separately."
    },
    "message": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CheckpointMessage"
        }
      ],
      "readOnly": true,
      "description": "The checkpoint name of this revision, or null."
    },
    "restoredFrom": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The historic revision that this one restored, or null. A restore never rewinds history; it adds a revision."
    },
    "clientTime": {
      "type": "string",
      "readOnly": true,
      "description": "The clock of the device that wrote the revision. It stays informational, because a device clock cannot be trusted.",
      "format": "date-time",
      "maxLength": 64
    },
    "serverTime": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the workspace accepted the revision.",
      "format": "date-time",
      "maxLength": 64
    },
    "document": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DocumentUpdate"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The whole document of the note at this revision, so a reader can start from it and stay able to merge later work. Null for an attachment revision, and for a file read that asked for the text alone."
    },
    "epoch": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DocumentEpoch"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The generation of that document, or null for an attachment revision."
    },
    "merged": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the save that made this revision joined work that its device had not seen. Every device reads the mark in History, and the device that saved keeps its own checkpoint for Review."
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [ContentDigest](https://docs.tidynotebook.com/api-schemas.md#contentdigest), [DocumentEpoch](https://docs.tidynotebook.com/api-schemas.md#documentepoch), [DocumentUpdate](https://docs.tidynotebook.com/api-schemas.md#documentupdate), [FileKind](https://docs.tidynotebook.com/api-schemas.md#filekind), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [MarkdownText](https://docs.tidynotebook.com/api-schemas.md#markdowntext), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## FileSortOrder

```json
{
  "type": "string",
  "description": "Order of a file listing. `updated` is the newest accepted change first. `path` is the stored path in ascending order.",
  "enum": [
    "updated",
    "path"
  ]
}
```

## FinalizeAttachmentInput

```json
{
  "type": "object",
  "description": "Payload to finalize an attachment and create an immutable revision.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "revisionId",
    "mutationId",
    "deviceId",
    "path",
    "digest"
  ],
  "properties": {
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identifier of the file that holds this attachment revision."
    },
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identifier of the new revision."
    },
    "mutationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identity of this operation, which makes a retry safe."
    },
    "deviceId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DeviceId"
        }
      ],
      "description": "The device that submitted the change."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "description": "Path of the attachment file in the workspace."
    },
    "digest": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ContentDigest"
        }
      ],
      "description": "The verified SHA-256 digest of the attachment object."
    },
    "message": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CheckpointMessage"
        }
      ],
      "description": "Name of this checkpoint, or null."
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [ContentDigest](https://docs.tidynotebook.com/api-schemas.md#contentdigest), [DeviceId](https://docs.tidynotebook.com/api-schemas.md#deviceid), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## HandoffAccount

```json
{
  "type": "object",
  "description": "The account that opened the portal.",
  "additionalProperties": false,
  "required": [
    "accountId",
    "email"
  ],
  "properties": {
    "accountId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the account."
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Sign-in address of the account.",
      "maxLength": 320
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## HandoffRedeemInput

```json
{
  "type": "object",
  "description": "The token of a handoff that the portal received.",
  "additionalProperties": false,
  "required": [
    "token"
  ],
  "properties": {
    "token": {
      "allOf": [
        {
          "$ref": "#/components/schemas/HandoffToken"
        }
      ],
      "writeOnly": true,
      "description": "The token from the query of the portal address."
    }
  }
}
```

Schemas: [HandoffToken](https://docs.tidynotebook.com/api-schemas.md#handofftoken).

## HandoffToken

```json
{
  "type": "string",
  "description": "A single-use token of one portal handoff (record 0190). It works once and for 60 seconds.",
  "minLength": 43,
  "maxLength": 43,
  "pattern": "^[A-Za-z0-9_-]{43}$"
}
```

## HealthReport

```json
{
  "type": "object",
  "description": "Liveness report of the service process.",
  "additionalProperties": false,
  "required": [
    "status"
  ],
  "properties": {
    "status": {
      "type": "string",
      "readOnly": true,
      "description": "Always the literal value ok while the process answers.",
      "enum": [
        "ok"
      ]
    }
  }
}
```

## HistoryPage

```json
{
  "type": "object",
  "description": "One page of file history revisions.",
  "additionalProperties": false,
  "required": [
    "revisions",
    "nextCursor"
  ],
  "properties": {
    "revisions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/HistoryRevisionItem"
      }
    },
    "nextCursor": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
```

Schemas: [HistoryRevisionItem](https://docs.tidynotebook.com/api-schemas.md#historyrevisionitem), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## HistoryRevisionItem

```json
{
  "type": "object",
  "description": "One historic revision of a file.",
  "additionalProperties": false,
  "required": [
    "revisionId",
    "fileId",
    "path",
    "deleted",
    "parents",
    "digest",
    "size",
    "actorAccountId",
    "clientTime",
    "serverTime",
    "message",
    "isCheckpoint",
    "checkpointName",
    "restoredFrom",
    "text",
    "objectId",
    "merged"
  ],
  "properties": {
    "revisionId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "fileId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "path": {
      "$ref": "#/components/schemas/FilePath"
    },
    "deleted": {
      "type": "boolean"
    },
    "parents": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "digest": {
      "$ref": "#/components/schemas/ContentDigest"
    },
    "size": {
      "type": "integer"
    },
    "actorAccountId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "clientTime": {
      "type": "string",
      "format": "date-time"
    },
    "serverTime": {
      "type": "string",
      "format": "date-time"
    },
    "message": {
      "$ref": "#/components/schemas/CheckpointMessage"
    },
    "isCheckpoint": {
      "type": "boolean"
    },
    "checkpointName": {
      "$ref": "#/components/schemas/CheckpointMessage"
    },
    "restoredFrom": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "text": {
      "type": [
        "string",
        "null"
      ]
    },
    "objectId": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "merged": {
      "type": "boolean",
      "description": "True when the save that made this revision joined work that its device had not seen. History marks the revision on every device."
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [ContentDigest](https://docs.tidynotebook.com/api-schemas.md#contentdigest), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## ImportWorkspaceResult

```json
{
  "type": "object",
  "description": "Counts of the files that one import wrote, and of the files of the archive that it left out: the settings of a tool, such as the .obsidian folder, and every file that is neither a note nor an image (record 0172).",
  "additionalProperties": false,
  "required": [
    "notes",
    "attachments",
    "skipped"
  ],
  "properties": {
    "notes": {
      "type": "integer",
      "minimum": 0
    },
    "attachments": {
      "type": "integer",
      "minimum": 0
    },
    "skipped": {
      "type": "object",
      "description": "The files of the archive that the import left out.",
      "additionalProperties": false,
      "required": [
        "files",
        "kinds"
      ],
      "properties": {
        "files": {
          "type": "integer",
          "minimum": 0
        },
        "kinds": {
          "type": "array",
          "description": "The kinds of the files left out, in name order: the file extension in lower case, `settings` for the settings of a tool, and `file` for a file with no extension.",
          "maxItems": 50,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          }
        }
      }
    }
  }
}
```

## ImportedTheme

```json
{
  "type": "object",
  "description": "One theme that the account imported. The client checks its contrast before it offers or paints it, and its family is custom- and the identifier.",
  "additionalProperties": false,
  "required": [
    "themeId",
    "name"
  ],
  "properties": {
    "themeId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the imported theme."
    },
    "name": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ThemeName"
        }
      ],
      "readOnly": true
    },
    "light": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ThemePalette"
        }
      ],
      "readOnly": true
    },
    "dark": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ThemePalette"
        }
      ],
      "readOnly": true
    }
  }
}
```

Schemas: [ThemeName](https://docs.tidynotebook.com/api-schemas.md#themename), [ThemePalette](https://docs.tidynotebook.com/api-schemas.md#themepalette), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## Installation

```json
{
  "type": "object",
  "description": "The settings of the installation that an administrator reads.",
  "additionalProperties": false,
  "required": [
    "registrationPolicy",
    "registrationPolicySource",
    "mailConfigured",
    "invitationLifetimeHours",
    "defaultLimitBytes",
    "mail",
    "legalDocuments"
  ],
  "properties": {
    "registrationPolicy": {
      "allOf": [
        {
          "$ref": "#/components/schemas/RegistrationPolicy"
        }
      ],
      "readOnly": true,
      "description": "Who can make an account."
    },
    "registrationPolicySource": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SettingSource"
        }
      ],
      "readOnly": true,
      "description": "Where the registration policy comes from (record 0206). With environment, the server environment names it and the application cannot change it."
    },
    "mailConfigured": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the installation has a mail transport. Without one, an invitation link appears once for the administrator to copy."
    },
    "invitationLifetimeHours": {
      "type": "integer",
      "readOnly": true,
      "description": "How long a new invitation stays valid, in hours.",
      "minimum": 1,
      "maximum": 8760
    },
    "defaultLimitBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The limit that a new account starts with."
    },
    "mail": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MailSettings"
        }
      ],
      "readOnly": true
    },
    "legalDocuments": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LegalSettings"
        }
      ],
      "readOnly": true
    }
  }
}
```

Schemas: [ByteCount](https://docs.tidynotebook.com/api-schemas.md#bytecount), [LegalSettings](https://docs.tidynotebook.com/api-schemas.md#legalsettings), [MailSettings](https://docs.tidynotebook.com/api-schemas.md#mailsettings), [RegistrationPolicy](https://docs.tidynotebook.com/api-schemas.md#registrationpolicy), [SettingSource](https://docs.tidynotebook.com/api-schemas.md#settingsource).

## InstallationRole

```json
{
  "type": "string",
  "description": "The role of an account in the installation. An administrator manages accounts and invitations. The role grants no access to a workspace of another account.",
  "enum": [
    "administrator",
    "member"
  ]
}
```

## InstallationUpdateInput

```json
{
  "type": "object",
  "description": "The settings of the installation that an administrator changes.",
  "additionalProperties": false,
  "required": [
    "registrationPolicy"
  ],
  "properties": {
    "registrationPolicy": {
      "allOf": [
        {
          "$ref": "#/components/schemas/RegistrationPolicy"
        }
      ],
      "description": "Who can make an account. The server refuses open until the installation has every part that open registration needs."
    }
  }
}
```

Schemas: [RegistrationPolicy](https://docs.tidynotebook.com/api-schemas.md#registrationpolicy).

## Invitation

```json
{
  "type": "object",
  "description": "One invitation that waits. This shape holds no token, so a read of the list cannot open an invitation.",
  "additionalProperties": false,
  "required": [
    "invitationId",
    "email",
    "createdAt",
    "expiresAt",
    "state",
    "mailed"
  ],
  "properties": {
    "invitationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the invitation record. An administrator names it to revoke the invitation. It is not the token."
    },
    "email": {
      "allOf": [
        {
          "$ref": "#/components/schemas/EmailAddress"
        }
      ],
      "readOnly": true,
      "description": "The address that the invitation binds."
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the invitation was made.",
      "format": "date-time",
      "maxLength": 64
    },
    "expiresAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant after which the invitation opens nothing.",
      "format": "date-time",
      "maxLength": 64
    },
    "state": {
      "type": "string",
      "readOnly": true,
      "description": "pending while the invitation can be used, expired after.",
      "enum": [
        "pending",
        "expired"
      ]
    },
    "mailed": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the link went to the address by mail."
    }
  }
}
```

Schemas: [EmailAddress](https://docs.tidynotebook.com/api-schemas.md#emailaddress), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## InvitationAddress

```json
{
  "type": "object",
  "description": "The address that a valid invitation binds.",
  "additionalProperties": false,
  "required": [
    "email"
  ],
  "properties": {
    "email": {
      "allOf": [
        {
          "$ref": "#/components/schemas/EmailAddress"
        }
      ],
      "readOnly": true,
      "description": "The address of the new account."
    }
  }
}
```

Schemas: [EmailAddress](https://docs.tidynotebook.com/api-schemas.md#emailaddress).

## InvitationCreateInput

```json
{
  "type": "object",
  "description": "The address that a new invitation binds.",
  "additionalProperties": false,
  "required": [
    "email"
  ],
  "properties": {
    "email": {
      "allOf": [
        {
          "$ref": "#/components/schemas/EmailAddress"
        }
      ],
      "description": "The address of the invited person. The person cannot change it while they accept."
    }
  }
}
```

Schemas: [EmailAddress](https://docs.tidynotebook.com/api-schemas.md#emailaddress).

## InvitationCreated

```json
{
  "type": "object",
  "description": "A new invitation, and its link when no mail transport sent it. The link appears in this answer only, once.",
  "additionalProperties": false,
  "required": [
    "invitation",
    "link"
  ],
  "properties": {
    "invitation": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Invitation"
        }
      ],
      "readOnly": true,
      "description": "The new invitation."
    },
    "link": {
      "oneOf": [
        {
          "type": "string",
          "format": "uri",
          "maxLength": 2048
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The link that opens the invitation, for the administrator to copy, or null when the link went by mail."
    }
  }
}
```

Schemas: [Invitation](https://docs.tidynotebook.com/api-schemas.md#invitation).

## InvitationList

```json
{
  "type": "object",
  "description": "The invitations that nobody used or revoked.",
  "additionalProperties": false,
  "required": [
    "invitations"
  ],
  "properties": {
    "invitations": {
      "type": "array",
      "readOnly": true,
      "description": "The invitations, newest first.",
      "maxItems": 10000,
      "items": {
        "$ref": "#/components/schemas/Invitation"
      }
    }
  }
}
```

Schemas: [Invitation](https://docs.tidynotebook.com/api-schemas.md#invitation).

## InvitationReadInput

```json
{
  "type": "object",
  "description": "The token of the invitation to read.",
  "additionalProperties": false,
  "required": [
    "invitation"
  ],
  "properties": {
    "invitation": {
      "allOf": [
        {
          "$ref": "#/components/schemas/InvitationToken"
        }
      ],
      "description": "The token from the invitation link."
    }
  }
}
```

Schemas: [InvitationToken](https://docs.tidynotebook.com/api-schemas.md#invitationtoken).

## InvitationToken

```json
{
  "type": "string",
  "description": "The secret of one invitation, as the link carries it. The server keeps only its digest.",
  "minLength": 43,
  "maxLength": 43,
  "pattern": "^[A-Za-z0-9_-]{43}$",
  "writeOnly": true
}
```

## LegalDocument

```json
{
  "type": "object",
  "description": "One legal document of the installation and its current version.",
  "additionalProperties": false,
  "required": [
    "url",
    "version"
  ],
  "properties": {
    "url": {
      "type": "string",
      "readOnly": true,
      "description": "Where a person reads the document.",
      "format": "uri",
      "maxLength": 2048
    },
    "version": {
      "type": "string",
      "readOnly": true,
      "description": "The current version, which a consent names.",
      "minLength": 1,
      "maxLength": 64
    }
  }
}
```

## LegalDocumentInput

```json
{
  "type": "object",
  "description": "One legal document that an administrator sets: a text with the kind text, or an address with the kind address, and its version.",
  "additionalProperties": false,
  "required": [
    "kind",
    "version"
  ],
  "properties": {
    "kind": {
      "$ref": "#/components/schemas/LegalDocumentKind"
    },
    "text": {
      "type": "string",
      "description": "The Markdown text of the document, for the kind text.",
      "minLength": 1,
      "maxLength": 262144
    },
    "url": {
      "type": "string",
      "description": "The address of the document, for the kind address.",
      "format": "uri",
      "maxLength": 2048
    },
    "version": {
      "type": "string",
      "description": "The version of the document. A new version asks every account to accept again.",
      "minLength": 1,
      "maxLength": 64
    }
  }
}
```

Schemas: [LegalDocumentKind](https://docs.tidynotebook.com/api-schemas.md#legaldocumentkind).

## LegalDocumentKind

```json
{
  "type": "string",
  "description": "The source of a legal document. text is Markdown that this server serves, and address is a page on another site.",
  "enum": [
    "text",
    "address"
  ]
}
```

## LegalDocumentSetting

```json
{
  "type": "object",
  "description": "One stored legal document, as the administrator changes it.",
  "additionalProperties": false,
  "required": [
    "kind",
    "text",
    "url",
    "version"
  ],
  "properties": {
    "kind": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LegalDocumentKind"
        }
      ],
      "readOnly": true
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "The Markdown text, for the kind text.",
      "maxLength": 262144
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "The address, for the kind address.",
      "maxLength": 2048
    },
    "version": {
      "type": "string",
      "readOnly": true,
      "minLength": 1,
      "maxLength": 64
    }
  }
}
```

Schemas: [LegalDocumentKind](https://docs.tidynotebook.com/api-schemas.md#legaldocumentkind).

## LegalDocumentSettings

```json
{
  "type": "object",
  "description": "One legal document of the installation and its template, as the administrator changes them.",
  "additionalProperties": false,
  "required": [
    "source",
    "document",
    "template"
  ],
  "properties": {
    "source": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SettingSource"
        }
      ],
      "readOnly": true
    },
    "document": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/LegalDocumentSetting"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The stored document, or null when the application holds none."
    },
    "template": {
      "type": "string",
      "readOnly": true,
      "description": "The template of the document in Markdown. The server fills the facts that it knows, and each other blank is a marker in double braces.",
      "maxLength": 262144
    }
  }
}
```

Schemas: [LegalDocumentSetting](https://docs.tidynotebook.com/api-schemas.md#legaldocumentsetting), [SettingSource](https://docs.tidynotebook.com/api-schemas.md#settingsource).

## LegalDocumentSummary

```json
{
  "type": "object",
  "description": "One legal document that the installation holds.",
  "additionalProperties": false,
  "required": [
    "kind",
    "url",
    "version"
  ],
  "properties": {
    "kind": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LegalDocumentKind"
        }
      ],
      "readOnly": true
    },
    "url": {
      "type": "string",
      "readOnly": true,
      "description": "Where a person reads the document.",
      "format": "uri",
      "maxLength": 2048
    },
    "version": {
      "type": "string",
      "readOnly": true,
      "description": "The current version, which a consent names.",
      "minLength": 1,
      "maxLength": 64
    }
  }
}
```

Schemas: [LegalDocumentKind](https://docs.tidynotebook.com/api-schemas.md#legaldocumentkind).

## LegalDocuments

```json
{
  "type": "object",
  "description": "The terms and the privacy notice of the installation (record 0120). The operator writes both and names their versions.",
  "additionalProperties": false,
  "required": [
    "terms",
    "privacy"
  ],
  "properties": {
    "terms": {
      "$ref": "#/components/schemas/LegalDocument"
    },
    "privacy": {
      "$ref": "#/components/schemas/LegalDocument"
    }
  }
}
```

Schemas: [LegalDocument](https://docs.tidynotebook.com/api-schemas.md#legaldocument).

## LegalPageDocument

```json
{
  "type": "string",
  "description": "One legal document of the installation, as one HTML document. The server builds it from the Markdown file of the operator with the one sanitized renderer, and it holds no script.",
  "maxLength": 8388608
}
```

## LegalSettings

```json
{
  "type": "object",
  "description": "The legal documents that the installation holds. They apply when both exist (record 0148).",
  "additionalProperties": false,
  "required": [
    "source",
    "terms",
    "privacy"
  ],
  "properties": {
    "source": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SettingSource"
        }
      ],
      "readOnly": true
    },
    "terms": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/LegalDocumentSummary"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true
    },
    "privacy": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/LegalDocumentSummary"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true
    }
  }
}
```

Schemas: [LegalDocumentSummary](https://docs.tidynotebook.com/api-schemas.md#legaldocumentsummary), [SettingSource](https://docs.tidynotebook.com/api-schemas.md#settingsource).

## LinkReport

```json
{
  "type": "object",
  "description": "One open report of a published link, as an administrator reads it. It holds no fact of a note and no fact of the workspace.",
  "additionalProperties": false,
  "required": [
    "reportId",
    "publicationId",
    "reason",
    "note",
    "address",
    "linkState",
    "createdAt"
  ],
  "properties": {
    "reportId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the report."
    },
    "publicationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the reported link. Two reports of one link name the same value. It opens nothing."
    },
    "reason": {
      "$ref": "#/components/schemas/ReportReason"
    },
    "note": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "What the reader added, or null."
    },
    "address": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 2048
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The address of the reported link, which the administrator opens as any reader does. It is null when the server cannot open the sealed address, for example after a change of its secret."
    },
    "linkState": {
      "type": "string",
      "readOnly": true,
      "description": "Whether the link opens now, an administrator took it down, or it stopped for another cause.",
      "enum": [
        "live",
        "taken-down",
        "stopped"
      ]
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant of the report.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

Schemas: [ReportReason](https://docs.tidynotebook.com/api-schemas.md#reportreason), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## LinkReportList

```json
{
  "type": "object",
  "description": "The open reports of published links.",
  "additionalProperties": false,
  "required": [
    "reports"
  ],
  "properties": {
    "reports": {
      "type": "array",
      "readOnly": true,
      "description": "The open reports, newest first.",
      "maxItems": 10000,
      "items": {
        "$ref": "#/components/schemas/LinkReport"
      }
    }
  }
}
```

Schemas: [LinkReport](https://docs.tidynotebook.com/api-schemas.md#linkreport).

## MailSecurity

```json
{
  "type": "string",
  "description": "How the connection to the mail server is protected. tls opens a TLS connection at once, starttls upgrades a plain connection, and none sends with no protection.",
  "enum": [
    "tls",
    "starttls",
    "none"
  ]
}
```

## MailSettings

```json
{
  "type": "object",
  "description": "The mail transport that applies now. No member holds a password.",
  "additionalProperties": false,
  "required": [
    "source",
    "host",
    "port",
    "security",
    "username",
    "sender",
    "passwordStored"
  ],
  "properties": {
    "source": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SettingSource"
        }
      ],
      "readOnly": true
    },
    "host": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "The host name of the mail server.",
      "maxLength": 253
    },
    "port": {
      "type": [
        "integer",
        "null"
      ],
      "readOnly": true,
      "description": "The port of the mail server.",
      "minimum": 1,
      "maximum": 65535
    },
    "security": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/MailSecurity"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true
    },
    "username": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "The user name that signs in to the mail server, or null.",
      "maxLength": 320
    },
    "sender": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "The sender of every message.",
      "maxLength": 320
    },
    "passwordStored": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the application holds a password for the mail server."
    }
  }
}
```

Schemas: [MailSecurity](https://docs.tidynotebook.com/api-schemas.md#mailsecurity), [SettingSource](https://docs.tidynotebook.com/api-schemas.md#settingsource).

## MailSettingsInput

```json
{
  "type": "object",
  "description": "The mail transport that an administrator sets.",
  "additionalProperties": false,
  "required": [
    "host",
    "port",
    "security",
    "sender"
  ],
  "properties": {
    "host": {
      "type": "string",
      "description": "The host name of the mail server.",
      "minLength": 1,
      "maxLength": 253
    },
    "port": {
      "type": "integer",
      "description": "The port of the mail server.",
      "minimum": 1,
      "maximum": 65535
    },
    "security": {
      "$ref": "#/components/schemas/MailSecurity"
    },
    "username": {
      "type": "string",
      "description": "The user name that signs in to the mail server. Leave it out for a server that takes mail with no sign-in.",
      "minLength": 1,
      "maxLength": 320
    },
    "password": {
      "type": "string",
      "writeOnly": true,
      "description": "The password of the user name. Leave it out to keep the stored one.",
      "minLength": 1,
      "maxLength": 1024
    },
    "sender": {
      "type": "string",
      "description": "The sender of every message, an address or a name and an address, for example tidy notebook <no-reply@notes.example.com>.",
      "minLength": 3,
      "maxLength": 320
    }
  }
}
```

Schemas: [MailSecurity](https://docs.tidynotebook.com/api-schemas.md#mailsecurity).

## MailTestSent

```json
{
  "type": "object",
  "description": "Where the test message went.",
  "additionalProperties": false,
  "required": [
    "to"
  ],
  "properties": {
    "to": {
      "allOf": [
        {
          "$ref": "#/components/schemas/EmailAddress"
        }
      ],
      "readOnly": true
    }
  }
}
```

Schemas: [EmailAddress](https://docs.tidynotebook.com/api-schemas.md#emailaddress).

## MarkdownContentInput

```json
{
  "type": "object",
  "description": "The content of one saved note. It carries document work, never text: the accepted text is what the workspace derives from the accepted document.",
  "additionalProperties": false,
  "required": [
    "kind",
    "document"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Names this content form.",
      "enum": [
        "markdown"
      ]
    },
    "document": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DocumentSave"
        }
      ],
      "description": "The text work of this save."
    }
  }
}
```

Schemas: [DocumentSave](https://docs.tidynotebook.com/api-schemas.md#documentsave).

## MarkdownText

```json
{
  "type": "string",
  "description": "The Markdown source of one revision. It is stored and returned exactly as it was written, without normalization.",
  "maxLength": 1048576
}
```

## MutationReceipt

```json
{
  "type": "object",
  "description": "What the workspace knows about one mutation identity. A device reads it when it does not know whether a save reached the server, before it transforms work that may already have committed. The answer states the outcome and never the text of a note.",
  "additionalProperties": false,
  "required": [
    "mutationId",
    "status",
    "accepted"
  ],
  "properties": {
    "mutationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The mutation identity that the device asked about."
    },
    "status": {
      "type": "string",
      "readOnly": true,
      "description": "accepted means this workspace committed exactly this request. absent means it holds no receipt for the identity, which is definitive only while no other writer of this account is running. other_request means the identity belongs to a different request, so the device must not send this one under it.",
      "enum": [
        "accepted",
        "absent",
        "other_request"
      ]
    },
    "accepted": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/AcceptedChangeset"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The stored outcome of the accepted request, or null. It repeats what the first answer stated, so a device that lost the answer can settle its queue without sending again."
    }
  }
}
```

Schemas: [AcceptedChangeset](https://docs.tidynotebook.com/api-schemas.md#acceptedchangeset), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## OperatorAccount

```json
{
  "type": "object",
  "description": "One account as a service of the operator reads it (record 0190). It holds no note, no workspace and no published link.",
  "additionalProperties": false,
  "required": [
    "accountId",
    "email",
    "role",
    "state",
    "createdAt",
    "controls",
    "usage"
  ],
  "properties": {
    "accountId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the account."
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Sign-in address of the account.",
      "maxLength": 320
    },
    "role": {
      "allOf": [
        {
          "$ref": "#/components/schemas/InstallationRole"
        }
      ],
      "readOnly": true,
      "description": "The role that decides which account controls can apply."
    },
    "state": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountState"
        }
      ],
      "readOnly": true,
      "description": "Whether the account can sign in."
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the account was made.",
      "format": "date-time",
      "maxLength": 64
    },
    "controls": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountControls"
        }
      ],
      "readOnly": true,
      "description": "The controls of the account and their revision."
    },
    "usage": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AccountUsage"
        }
      ],
      "readOnly": true,
      "description": "What the account uses."
    }
  }
}
```

Schemas: [AccountControls](https://docs.tidynotebook.com/api-schemas.md#accountcontrols), [AccountState](https://docs.tidynotebook.com/api-schemas.md#accountstate), [AccountUsage](https://docs.tidynotebook.com/api-schemas.md#accountusage), [InstallationRole](https://docs.tidynotebook.com/api-schemas.md#installationrole), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## OperatorTotals

```json
{
  "type": "object",
  "description": "The totals of the whole installation for one calendar month in UTC (record 0193).",
  "additionalProperties": false,
  "required": [
    "month",
    "publishedTransferBytes",
    "downloadBytes",
    "objectWrites",
    "objectReads"
  ],
  "properties": {
    "month": {
      "allOf": [
        {
          "$ref": "#/components/schemas/UsageMonth"
        }
      ],
      "readOnly": true,
      "description": "The month of the totals."
    },
    "publishedTransferBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The bytes that every published page sent in the month."
    },
    "downloadBytes": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ByteCount"
        }
      ],
      "readOnly": true,
      "description": "The bytes that every account downloaded in the month."
    },
    "objectWrites": {
      "type": "integer",
      "readOnly": true,
      "description": "The write calls to the object store in the month.",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "objectReads": {
      "type": "integer",
      "readOnly": true,
      "description": "The read calls to the object store in the month.",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  }
}
```

Schemas: [ByteCount](https://docs.tidynotebook.com/api-schemas.md#bytecount), [UsageMonth](https://docs.tidynotebook.com/api-schemas.md#usagemonth).

## Password

```json
{
  "type": "string",
  "description": "A new password. The bounds are the ones of NIST SP 800-63B revision 4 for a password that is the only factor, and passwordBounds of the core states the same bounds. The server also refuses a password that a list of leaked passwords holds.",
  "minLength": 15,
  "maxLength": 512,
  "writeOnly": true
}
```

## PortalAddress

```json
{
  "type": "object",
  "description": "The address that opens the account portal for the signed in account. It carries a single-use token that works for 60 seconds.",
  "additionalProperties": false,
  "required": [
    "url"
  ],
  "properties": {
    "url": {
      "type": "string",
      "readOnly": true,
      "description": "The full address of the portal, with the token in the query.",
      "format": "uri",
      "maxLength": 2400
    }
  }
}
```

## PortalOpenInput

```json
{
  "type": "object",
  "description": "The path on the account portal to open.",
  "additionalProperties": false,
  "required": [
    "path"
  ],
  "properties": {
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PortalPath"
        }
      ],
      "writeOnly": true,
      "description": "The path on the portal."
    }
  }
}
```

Schemas: [PortalPath](https://docs.tidynotebook.com/api-schemas.md#portalpath).

## PortalPath

```json
{
  "type": "string",
  "description": "A path on the account portal of the operator. It starts with a slash, and each part is letters, digits and the marks of an address.",
  "minLength": 1,
  "maxLength": 256,
  "pattern": "^(/[A-Za-z0-9_~-][A-Za-z0-9._~-]*)*/?$"
}
```

## Preferences

```json
{
  "type": "object",
  "description": "Settings that follow one account to every device.",
  "additionalProperties": false,
  "required": [
    "appearance",
    "themeFamily",
    "spellCheck",
    "themes"
  ],
  "properties": {
    "appearance": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Appearance"
        }
      ],
      "readOnly": true,
      "description": "The stored appearance choice of the account."
    },
    "themeFamily": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ThemeFamily"
        }
      ],
      "readOnly": true,
      "description": "The stored theme family of the account."
    },
    "spellCheck": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the editor asks the browser to check the spelling of a note."
    },
    "themes": {
      "type": "array",
      "readOnly": true,
      "description": "The themes that the account imported, oldest first.",
      "maxItems": 20,
      "items": {
        "$ref": "#/components/schemas/ImportedTheme"
      }
    }
  }
}
```

Schemas: [Appearance](https://docs.tidynotebook.com/api-schemas.md#appearance), [ImportedTheme](https://docs.tidynotebook.com/api-schemas.md#importedtheme), [ThemeFamily](https://docs.tidynotebook.com/api-schemas.md#themefamily).

## PreferencesInput

```json
{
  "type": "object",
  "description": "Settings to store for the signed in account. A member that the body leaves out keeps its stored value, so a client changes one setting without the others.",
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "appearance": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Appearance"
        }
      ],
      "description": "The appearance choice to store."
    },
    "themeFamily": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ThemeFamily"
        }
      ],
      "description": "The theme family to store."
    },
    "spellCheck": {
      "type": "boolean",
      "description": "Whether the editor checks the spelling of a note."
    }
  }
}
```

Schemas: [Appearance](https://docs.tidynotebook.com/api-schemas.md#appearance), [ThemeFamily](https://docs.tidynotebook.com/api-schemas.md#themefamily).

## PreviewPurgeInput

```json
{
  "type": "object",
  "description": "Payload to preview permanent deletion of files.",
  "additionalProperties": false,
  "required": [
    "fileIds"
  ],
  "properties": {
    "fileIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1000,
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## ProblemDetails

```json
{
  "type": "object",
  "description": "RFC 9457 problem details. The code field carries the stable application error code that a client can branch on.",
  "additionalProperties": true,
  "required": [
    "type",
    "title",
    "status",
    "code",
    "requestId"
  ],
  "properties": {
    "type": {
      "type": "string",
      "readOnly": true,
      "description": "Stable URI reference that identifies the problem type.",
      "format": "uri-reference",
      "maxLength": 256
    },
    "title": {
      "type": "string",
      "readOnly": true,
      "description": "Short human readable summary of the problem type.",
      "maxLength": 256
    },
    "status": {
      "type": "integer",
      "readOnly": true,
      "description": "HTTP status code of this response.",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string",
      "readOnly": true,
      "description": "Explanation of this occurrence. The field never contains note content, a secret, or a stack trace.",
      "maxLength": 1024
    },
    "instance": {
      "type": "string",
      "readOnly": true,
      "description": "URI reference of the request that produced the problem.",
      "format": "uri-reference",
      "maxLength": 1024
    },
    "code": {
      "type": "string",
      "readOnly": true,
      "description": "Stable application error code.",
      "pattern": "^[a-z][a-z0-9_]*$",
      "maxLength": 64
    },
    "requestId": {
      "type": "string",
      "readOnly": true,
      "description": "Identifier of the request, repeated in the x-request-id header.",
      "minLength": 1,
      "maxLength": 128
    },
    "issues": {
      "type": "array",
      "readOnly": true,
      "description": "Values that a boundary check rejected. Each entry names the value by JSON Pointer and never repeats the value itself.",
      "maxItems": 64,
      "items": {
        "$ref": "#/components/schemas/ValidationIssue"
      }
    },
    "fileIds": {
      "type": "array",
      "readOnly": true,
      "description": "The files that a content failure refers to, for example every file whose accepted head moved on. The list is absent when the failure names no file. It carries identifiers only, never a path or note content.",
      "maxItems": 4000,
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "noteRefusal": {
      "type": "string",
      "readOnly": true,
      "description": "The limit of the Markdown grammar that a refused note is over, on the code unrenderable_note only (record 0182). A client names the cause and the next step in words, and never shows this value.",
      "enum": [
        "note_too_large",
        "note_too_deep",
        "note_too_many_marks",
        "note_too_many_cells"
      ]
    },
    "limit": {
      "allOf": [
        {
          "$ref": "#/components/schemas/UsageLimit"
        }
      ],
      "readOnly": true,
      "description": "The limit of the month that refused the request, on the codes download_limit and storage_busy only (record 0193)."
    }
  }
}
```

Schemas: [UsageLimit](https://docs.tidynotebook.com/api-schemas.md#usagelimit), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid), [ValidationIssue](https://docs.tidynotebook.com/api-schemas.md#validationissue).

## ProfileUpdateInput

```json
{
  "type": "object",
  "description": "The name of the account.",
  "additionalProperties": false,
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "writeOnly": true,
      "description": "Display name of the account.",
      "minLength": 1,
      "maxLength": 256,
      "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
    }
  }
}
```

## ProfileUpdated

```json
{
  "type": "object",
  "description": "The profile name was stored.",
  "additionalProperties": false,
  "required": [
    "status"
  ],
  "properties": {
    "status": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the name was stored.",
      "const": true
    }
  }
}
```

## PublishedDocument

```json
{
  "type": "string",
  "description": "The published page, as one HTML document. The server builds it from the stored Markdown with the one sanitized renderer, and it holds no script. Its only style sheet is the built style sheet of the application.",
  "maxLength": 8388608
}
```

## PublishedFolderScope

```json
{
  "type": "object",
  "description": "A link that opens one folder and every note below it. A folder is a part of a note path, so the scope is a path prefix inside one workspace. A note in the Trash stays outside it.",
  "additionalProperties": false,
  "required": [
    "kind",
    "path"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Names this scope as one folder.",
      "const": "folder"
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "description": "The folder that the link opens. Every note below it is published, now and later."
    }
  }
}
```

Schemas: [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath).

## PublishedLink

```json
{
  "type": "object",
  "description": "One published link of a workspace, as its owner sees it. This shape holds no token, so a read of the list cannot open a link.",
  "additionalProperties": false,
  "required": [
    "publicationId",
    "scope",
    "createdAt",
    "expiresAt",
    "passwordProtected",
    "takenDown"
  ],
  "properties": {
    "publicationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the link record. The owner names it to revoke the link. It is not the token and it opens nothing."
    },
    "scope": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PublishedScope"
        }
      ],
      "readOnly": true,
      "description": "What the link opens."
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the owner made the link.",
      "format": "date-time",
      "maxLength": 64
    },
    "expiresAt": {
      "oneOf": [
        {
          "type": "string",
          "format": "date-time",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "Instant after which the link opens nothing, or null for a link that lasts until the owner revokes it."
    },
    "passwordProtected": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether a reader gives a password before it reads the link."
    },
    "takenDown": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether an administrator took the link down after a report. A taken down link opens nothing, and its owner cannot make it live again. It stays in the list for 30 days."
    }
  }
}
```

Schemas: [PublishedScope](https://docs.tidynotebook.com/api-schemas.md#publishedscope), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## PublishedLinkCreated

```json
{
  "type": "object",
  "description": "The new link and its token. This is the one answer of the whole interface that holds a token. The server keeps only a digest of the token, so it cannot show the value again.",
  "additionalProperties": false,
  "required": [
    "link",
    "token"
  ],
  "properties": {
    "link": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PublishedLink"
        }
      ],
      "readOnly": true,
      "description": "The new link, as the list reports it from now on."
    },
    "token": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PublishedTokenValue"
        }
      ],
      "readOnly": true,
      "description": "The token of the new link. The owner puts it in the address that it shares. No other answer holds it, and no answer holds a part of it."
    }
  }
}
```

Schemas: [PublishedLink](https://docs.tidynotebook.com/api-schemas.md#publishedlink), [PublishedTokenValue](https://docs.tidynotebook.com/api-schemas.md#publishedtokenvalue).

## PublishedLinkList

```json
{
  "type": "object",
  "description": "Every published link of one workspace. No entry holds a token.",
  "additionalProperties": false,
  "required": [
    "links"
  ],
  "properties": {
    "links": {
      "type": "array",
      "readOnly": true,
      "description": "One entry for each link that the workspace holds.",
      "maxItems": 200,
      "items": {
        "$ref": "#/components/schemas/PublishedLink"
      }
    }
  }
}
```

Schemas: [PublishedLink](https://docs.tidynotebook.com/api-schemas.md#publishedlink).

## PublishedNoteReference

```json
{
  "type": "string",
  "description": "Names one note of a folder link. The page of a folder link lists the notes that it opens, and each entry of that list carries this value. Any short text is accepted, because a value that names no note inside the scope of the link answers the same page as a value that names nothing at all.",
  "minLength": 1,
  "maxLength": 200
}
```

## PublishedNoteScope

```json
{
  "type": "object",
  "description": "A link that opens one note.",
  "additionalProperties": false,
  "required": [
    "kind",
    "fileId"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Names this scope as one note.",
      "const": "note"
    },
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "The note that the link opens. A rename keeps the link, because the identifier of a note does not move."
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## PublishedPasswordFormInput

```json
{
  "type": "object",
  "description": "The one field of the password form of a published page. A served page holds no script, so the browser sends the field in the form encoding of HTML and the server reads one name from it.",
  "additionalProperties": false,
  "required": [
    "password"
  ],
  "properties": {
    "password": {
      "type": "string",
      "writeOnly": true,
      "description": "The password that the owner gave the link. Any value is accepted here and a wrong value answers the same page, so the answer states nothing about the link or about the password policy. An empty value is accepted as well, because a form that a person sends empty is a wrong password and answers the same page.",
      "maxLength": 512
    }
  }
}
```

## PublishedRefusal

```json
{
  "type": "object",
  "description": "The one refusal of the reader path. A link that never existed, a revoked link, an expired link and a wrong password all take this body, so the answer states nothing about the link. The shape is closed and every member that could carry a difference is fixed, so a later change cannot add a word that tells the four causes apart. The body names no note, no folder, no account and no identifier of the product.",
  "additionalProperties": false,
  "required": [
    "type",
    "title",
    "status",
    "detail",
    "instance",
    "code",
    "requestId"
  ],
  "properties": {
    "type": {
      "type": "string",
      "readOnly": true,
      "description": "Stable URI reference that identifies the problem type.",
      "const": "https://notesapp.invalid/problems/published_link_unavailable",
      "format": "uri-reference",
      "maxLength": 256
    },
    "title": {
      "type": "string",
      "readOnly": true,
      "description": "The one sentence of this refusal. It repeats the detail, because a difference between the two would be a place to hide a cause.",
      "const": "This link is not available.",
      "maxLength": 256
    },
    "status": {
      "type": "integer",
      "readOnly": true,
      "description": "Always 404, for each of the four causes.",
      "const": 404
    },
    "detail": {
      "type": "string",
      "readOnly": true,
      "description": "The one sentence of this refusal.",
      "const": "This link is not available.",
      "maxLength": 1024
    },
    "instance": {
      "type": "string",
      "readOnly": true,
      "description": "Address of the request, without its query. It repeats what the caller sent and it adds nothing.",
      "format": "uri-reference",
      "maxLength": 1024
    },
    "code": {
      "type": "string",
      "readOnly": true,
      "description": "The one code of every reader refusal.",
      "const": "published_link_unavailable",
      "maxLength": 64
    },
    "requestId": {
      "type": "string",
      "readOnly": true,
      "description": "Identifier of the request, repeated in the x-request-id header.",
      "minLength": 1,
      "maxLength": 128
    }
  }
}
```

## PublishedReportFormInput

```json
{
  "type": "object",
  "description": "The fields of the report form of a published page. The page holds no script, so the browser sends the fields in the form encoding of HTML.",
  "additionalProperties": false,
  "required": [
    "reason"
  ],
  "properties": {
    "reason": {
      "$ref": "#/components/schemas/ReportReason"
    },
    "note": {
      "type": "string",
      "writeOnly": true,
      "description": "What the reader adds for the administrator. An empty value is the same as no note.",
      "maxLength": 2000
    }
  }
}
```

Schemas: [ReportReason](https://docs.tidynotebook.com/api-schemas.md#reportreason).

## PublishedScope

```json
{
  "description": "What one published link opens.",
  "oneOf": [
    {
      "$ref": "#/components/schemas/PublishedNoteScope"
    },
    {
      "$ref": "#/components/schemas/PublishedFolderScope"
    }
  ]
}
```

Schemas: [PublishedFolderScope](https://docs.tidynotebook.com/api-schemas.md#publishedfolderscope), [PublishedNoteScope](https://docs.tidynotebook.com/api-schemas.md#publishednotescope).

## PublishedSecret

```json
{
  "type": "string",
  "description": "One secret of a reader, as it travels in the address of a published link. The token is a path segment and the reading ticket is a query value, and the server compares a digest of what it received with a digest at rest. A value of any other shape therefore opens nothing, exactly as an unknown value opens nothing, so this shape stays wide on purpose: a reader that mistypes an address must read the one answer of the reader path and never a refusal that tells it that the shape was wrong. The shape of the value that the server draws is in PublishedTokenValue. The length is not bounded here, because the server digests the value and never stores it, and the whole address is already bounded by the header byte limit of the deployment. A second bound would answer a long address with a refusal instead of the one page of decision 0047.",
  "minLength": 1,
  "pattern": "^[^/?#]+$"
}
```

## PublishedTokenValue

```json
{
  "type": "string",
  "description": "The opaque value that opens one published link. The server draws it at random, so it names no note, no folder and no account. The server keeps only a digest of it, and it appears once, in the address that the owner copies.",
  "pattern": "^[A-Za-z0-9_-]{22,64}$",
  "minLength": 22,
  "maxLength": 64
}
```

## PurgeFilesInput

```json
{
  "type": "object",
  "description": "Payload to permanently purge files.",
  "additionalProperties": false,
  "required": [
    "mutationId",
    "fileIds"
  ],
  "properties": {
    "mutationId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "fileIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1000,
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## PurgePreview

```json
{
  "type": "object",
  "description": "Summary preview of an intended permanent file purge.",
  "additionalProperties": false,
  "required": [
    "fileIds",
    "revisionIds",
    "contentDigests",
    "attachmentObjectIds",
    "blockingReferences",
    "dependentRevisionCount",
    "reclaimableBytes",
    "canPurge"
  ],
  "properties": {
    "fileIds": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "revisionIds": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "contentDigests": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "attachmentObjectIds": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "blockingReferences": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/BlockingReference"
      }
    },
    "dependentRevisionCount": {
      "type": "integer"
    },
    "reclaimableBytes": {
      "type": "integer"
    },
    "canPurge": {
      "type": "boolean"
    }
  }
}
```

Schemas: [BlockingReference](https://docs.tidynotebook.com/api-schemas.md#blockingreference), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## PurgedFiles

```json
{
  "type": "object",
  "description": "Outcome of executed permanent file purge.",
  "additionalProperties": false,
  "required": [
    "mutationId",
    "purgedFileIds",
    "purgedRevisionIds",
    "reclaimedBytes"
  ],
  "properties": {
    "mutationId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "purgedFileIds": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "purgedRevisionIds": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "reclaimedBytes": {
      "type": "integer"
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## ReadinessCheck

```json
{
  "type": "object",
  "description": "State of one startup requirement.",
  "additionalProperties": false,
  "required": [
    "name",
    "status"
  ],
  "properties": {
    "name": {
      "type": "string",
      "readOnly": true,
      "description": "Stable name of the requirement, for example configuration.",
      "minLength": 1,
      "maxLength": 64
    },
    "status": {
      "type": "string",
      "readOnly": true,
      "description": "State of this requirement.",
      "enum": [
        "ok",
        "degraded"
      ]
    },
    "detail": {
      "type": "string",
      "readOnly": true,
      "description": "Operator readable explanation. The field is absent in a summary report and it never contains note content or a secret.",
      "maxLength": 512
    }
  }
}
```

## ReadinessReport

```json
{
  "type": "object",
  "description": "Readiness report of every startup requirement.",
  "additionalProperties": false,
  "required": [
    "status",
    "checks"
  ],
  "properties": {
    "status": {
      "type": "string",
      "readOnly": true,
      "description": "Overall readiness. The value is degraded when at least one check is degraded.",
      "enum": [
        "ok",
        "degraded"
      ]
    },
    "checks": {
      "type": "array",
      "readOnly": true,
      "description": "One entry for every startup requirement that was checked.",
      "minItems": 1,
      "maxItems": 32,
      "items": {
        "$ref": "#/components/schemas/ReadinessCheck"
      }
    }
  }
}
```

Schemas: [ReadinessCheck](https://docs.tidynotebook.com/api-schemas.md#readinesscheck).

## ReadingTicketGrant

```json
{
  "type": "object",
  "description": "The reading ticket of one link. The reader carries it in the address of every later call to that link. No cookie is set.",
  "additionalProperties": false,
  "required": [
    "ticket",
    "expiresAt"
  ],
  "properties": {
    "ticket": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ReadingTicketValue"
        }
      ],
      "readOnly": true,
      "description": "The ticket. It opens this one link and nothing else."
    },
    "expiresAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the ticket stops. A read does not move it, so a reader that returns later gives the password again.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

Schemas: [ReadingTicketValue](https://docs.tidynotebook.com/api-schemas.md#readingticketvalue).

## ReadingTicketValue

```json
{
  "type": "string",
  "description": "The value that a reader carries after it gives the password of a link. It is bound to that one link, it lives 12 hours, and a read does not move its expiry. The server keeps only a digest of it.",
  "pattern": "^[A-Za-z0-9_-]{22,64}$",
  "minLength": 22,
  "maxLength": 64
}
```

## Registered

```json
{
  "type": "object",
  "description": "Confirmation that the account exists and that its session started.",
  "additionalProperties": false,
  "required": [
    "registered"
  ],
  "properties": {
    "registered": {
      "type": "boolean",
      "readOnly": true,
      "description": "Always true."
    }
  }
}
```

## RegistrationInput

```json
{
  "type": "object",
  "description": "What a person gives to make an account. The address comes from the invitation.",
  "additionalProperties": false,
  "required": [
    "invitation",
    "password"
  ],
  "properties": {
    "invitation": {
      "allOf": [
        {
          "$ref": "#/components/schemas/InvitationToken"
        }
      ],
      "description": "The token from the invitation link."
    },
    "password": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Password"
        }
      ],
      "description": "The password of the new account."
    },
    "name": {
      "type": "string",
      "description": "The display name of the new account.",
      "minLength": 1,
      "maxLength": 256
    },
    "consent": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ConsentInput"
        }
      ],
      "description": "The versions of the terms and of the privacy notice that the person accepted. It is required when the installation names both documents (record 0120)."
    }
  }
}
```

Schemas: [ConsentInput](https://docs.tidynotebook.com/api-schemas.md#consentinput), [InvitationToken](https://docs.tidynotebook.com/api-schemas.md#invitationtoken), [Password](https://docs.tidynotebook.com/api-schemas.md#password).

## RegistrationPolicy

```json
{
  "type": "string",
  "description": "Who can make an account. With invitation, only a person with a valid invitation can. With open, a person who proves their address can.",
  "enum": [
    "invitation",
    "open"
  ]
}
```

## Removed

```json
{
  "type": "object",
  "description": "Confirmation that the named record no longer exists.",
  "additionalProperties": false,
  "required": [
    "removed"
  ],
  "properties": {
    "removed": {
      "type": "boolean",
      "readOnly": true,
      "description": "Always true. The record no longer exists."
    }
  }
}
```

## ReportReason

```json
{
  "type": "string",
  "description": "Why a reader reports a published link. The list is fixed, so an administrator can sort the reports.",
  "enum": [
    "phishing",
    "malware",
    "illegal",
    "harassment",
    "spam",
    "other"
  ]
}
```

## RestoreFileInput

```json
{
  "type": "object",
  "description": "Payload to bring one deleted file back into the file tree.",
  "additionalProperties": false,
  "required": [
    "mutationId",
    "deviceId",
    "clientTime",
    "revisionId"
  ],
  "properties": {
    "mutationId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "deviceId": {
      "$ref": "#/components/schemas/DeviceId"
    },
    "clientTime": {
      "type": "string",
      "format": "date-time",
      "minLength": 20,
      "maxLength": 64
    },
    "revisionId": {
      "$ref": "#/components/schemas/Uuid"
    }
  }
}
```

Schemas: [DeviceId](https://docs.tidynotebook.com/api-schemas.md#deviceid), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## RestoreRevisionInput

```json
{
  "type": "object",
  "description": "Payload to restore a file to an earlier historic revision.",
  "additionalProperties": false,
  "required": [
    "mutationId",
    "deviceId",
    "clientTime",
    "targetRevisionId",
    "revisionId"
  ],
  "properties": {
    "mutationId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "deviceId": {
      "$ref": "#/components/schemas/DeviceId"
    },
    "clientTime": {
      "type": "string",
      "format": "date-time",
      "minLength": 20,
      "maxLength": 64
    },
    "targetRevisionId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "expectedHead": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "revisionId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "path": {
      "$ref": "#/components/schemas/FilePath"
    },
    "message": {
      "$ref": "#/components/schemas/CheckpointMessage"
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [DeviceId](https://docs.tidynotebook.com/api-schemas.md#deviceid), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## RevisionInput

```json
{
  "type": "object",
  "description": "One revision that a client submits inside a changeset.",
  "additionalProperties": false,
  "required": [
    "revisionId",
    "fileId",
    "parents",
    "path",
    "deleted",
    "content",
    "clientTime"
  ],
  "properties": {
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identifier that the client assigned to this revision."
    },
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "The file that this revision belongs to."
    },
    "parents": {
      "type": "array",
      "description": "The parents of this revision. A parent is either an earlier revision of the same file in this submission or an accepted revision of that file.",
      "maxItems": 2,
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "description": "The path that the file has after this revision."
    },
    "deleted": {
      "type": "boolean",
      "description": "True for a tombstone, which records a deletion."
    },
    "content": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ContentInput"
        }
      ],
      "description": "The content of this revision."
    },
    "clientTime": {
      "type": "string",
      "description": "The device clock at the moment of the change.",
      "format": "date-time",
      "minLength": 20,
      "maxLength": 64
    },
    "message": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CheckpointMessage"
        }
      ],
      "description": "Name of this checkpoint, or null."
    },
    "restoredFrom": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ],
      "description": "The historic revision that this one restores, or null."
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [ContentInput](https://docs.tidynotebook.com/api-schemas.md#contentinput), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## Role

```json
{
  "type": "string",
  "description": "The role of an account in one workspace. Every workspace has one member, its owner, so the only role is owner. The installation role of an account is a separate fact and grants no workspace access.",
  "enum": [
    "owner"
  ]
}
```

## SearchExcerptPart

```json
{
  "type": "object",
  "description": "One part of a search excerpt. A part with `marked` true is a word that the query matched. The excerpt quotes the text that a reader sees, with no Markdown mark and no link address, and it carries no markup, so a reader renders every part as text and decides itself how a marked part looks.",
  "additionalProperties": false,
  "required": [
    "text",
    "marked"
  ],
  "properties": {
    "text": {
      "type": "string",
      "readOnly": true,
      "maxLength": 1024
    },
    "marked": {
      "type": "boolean",
      "readOnly": true
    }
  }
}
```

## SearchHit

```json
{
  "type": "object",
  "description": "One accepted live note that matched a search.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "path",
    "revisionId",
    "excerpt"
  ],
  "properties": {
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true
    },
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true
    },
    "excerpt": {
      "type": "array",
      "readOnly": true,
      "description": "The matching part of the note, in reading order, as the plain text that a reader sees: no Markdown mark and no link address.",
      "maxItems": 128,
      "items": {
        "$ref": "#/components/schemas/SearchExcerptPart"
      }
    }
  }
}
```

Schemas: [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [SearchExcerptPart](https://docs.tidynotebook.com/api-schemas.md#searchexcerptpart), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SearchResults

```json
{
  "type": "object",
  "description": "Search results from current accepted note revisions.",
  "additionalProperties": false,
  "required": [
    "hits"
  ],
  "properties": {
    "hits": {
      "type": "array",
      "readOnly": true,
      "maxItems": 100,
      "items": {
        "$ref": "#/components/schemas/SearchHit"
      }
    }
  }
}
```

Schemas: [SearchHit](https://docs.tidynotebook.com/api-schemas.md#searchhit).

## SessionsRevoked

```json
{
  "type": "object",
  "description": "How many sessions ended.",
  "additionalProperties": false,
  "required": [
    "revoked"
  ],
  "properties": {
    "revoked": {
      "type": "integer",
      "readOnly": true,
      "description": "The number of sessions that ended.",
      "minimum": 0
    }
  }
}
```

## SettingSource

```json
{
  "type": "string",
  "description": "Where a group of settings comes from (record 0148). environment is the server environment, which wins and cannot change in the application. application is what an administrator set. none is no setting.",
  "enum": [
    "environment",
    "application",
    "none"
  ]
}
```

## SignUpAccepted

```json
{
  "type": "object",
  "description": "The one answer of a sign-up. It is the same for every address, so it states nothing about the address.",
  "additionalProperties": false,
  "required": [
    "accepted"
  ],
  "properties": {
    "accepted": {
      "type": "boolean",
      "const": true,
      "readOnly": true,
      "description": "The server took the request and sent a message if it could."
    }
  }
}
```

## SignUpChallenge

```json
{
  "type": "object",
  "description": "A challenge of the proof of work of a sign-up. The digest of the value, a colon and the solution must start with `difficulty` zero bits.",
  "additionalProperties": false,
  "required": [
    "challenge",
    "value",
    "difficulty",
    "expiresAt"
  ],
  "properties": {
    "challenge": {
      "type": "string",
      "readOnly": true,
      "description": "The signed challenge, which the sign-up sends back unchanged.",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[A-Za-z0-9_.-]+$"
    },
    "value": {
      "type": "string",
      "readOnly": true,
      "description": "The random value whose digest a solution reduces.",
      "minLength": 1,
      "maxLength": 128
    },
    "difficulty": {
      "type": "integer",
      "readOnly": true,
      "description": "How many leading zero bits the digest of a solution needs.",
      "minimum": 8,
      "maximum": 28
    },
    "expiresAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant after which the challenge counts for nothing.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

## SignUpInput

```json
{
  "type": "object",
  "description": "What a person gives to ask for an account under open registration.",
  "additionalProperties": false,
  "required": [
    "email",
    "password",
    "proof"
  ],
  "properties": {
    "email": {
      "allOf": [
        {
          "$ref": "#/components/schemas/EmailAddress"
        }
      ],
      "description": "The address of the new account. A link goes to it."
    },
    "password": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Password"
        }
      ],
      "description": "The password of the new account."
    },
    "name": {
      "type": "string",
      "description": "The display name of the new account.",
      "minLength": 1,
      "maxLength": 256
    },
    "proof": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SignUpProof"
        }
      ],
      "description": "The proof of work of this sign-up (record 0115)."
    },
    "consent": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ConsentInput"
        }
      ],
      "description": "The versions of the legal documents that the person accepts. It is required when the installation names its documents (record 0120)."
    }
  }
}
```

Schemas: [ConsentInput](https://docs.tidynotebook.com/api-schemas.md#consentinput), [EmailAddress](https://docs.tidynotebook.com/api-schemas.md#emailaddress), [Password](https://docs.tidynotebook.com/api-schemas.md#password), [SignUpProof](https://docs.tidynotebook.com/api-schemas.md#signupproof).

## SignUpProof

```json
{
  "type": "object",
  "description": "The solution of one challenge of the proof of work.",
  "additionalProperties": false,
  "required": [
    "challenge",
    "solution"
  ],
  "properties": {
    "challenge": {
      "type": "string",
      "description": "The signed challenge, as the server answered it.",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[A-Za-z0-9_.-]+$"
    },
    "solution": {
      "type": "string",
      "description": "The solution that the browser found.",
      "minLength": 1,
      "maxLength": 32,
      "pattern": "^[0-9a-z]+$"
    }
  }
}
```

## SnapshotItem

```json
{
  "type": "object",
  "description": "One pinned file of a snapshot. The revision identifier is immutable, so a later commit cannot change what a page shows.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "revisionId",
    "path",
    "kind",
    "deleted"
  ],
  "properties": {
    "fileId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "revisionId": {
      "$ref": "#/components/schemas/Uuid"
    },
    "path": {
      "$ref": "#/components/schemas/FilePath"
    },
    "kind": {
      "type": "string",
      "readOnly": true,
      "description": "Whether the file holds Markdown or an attachment.",
      "enum": [
        "note",
        "attachment"
      ]
    },
    "deleted": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the file was deleted when captured. Always false."
    }
  }
}
```

Schemas: [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SnapshotPage

```json
{
  "type": "object",
  "description": "One page of the items that a snapshot captured.",
  "additionalProperties": false,
  "required": [
    "token",
    "cursor",
    "expiresAt",
    "position",
    "nextPosition",
    "totalItems",
    "items"
  ],
  "properties": {
    "token": {
      "type": "string",
      "readOnly": true,
      "description": "The token of the snapshot, echoed for the client.",
      "minLength": 43,
      "maxLength": 43,
      "pattern": "^[A-Za-z0-9_-]{43}$"
    },
    "cursor": {
      "type": "string",
      "readOnly": true,
      "description": "The captured high-water cursor.",
      "minLength": 1,
      "maxLength": 32,
      "pattern": "^[0-9]+$"
    },
    "expiresAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the snapshot expires.",
      "format": "date-time"
    },
    "position": {
      "type": "integer",
      "readOnly": true,
      "description": "Ordinal of the first item of this page.",
      "minimum": 0
    },
    "nextPosition": {
      "oneOf": [
        {
          "type": "integer",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "Ordinal of the next page, or null on the last page."
    },
    "totalItems": {
      "type": "integer",
      "readOnly": true,
      "description": "How many items the snapshot holds now.",
      "minimum": 0
    },
    "items": {
      "type": "array",
      "readOnly": true,
      "description": "The captured items of this page, ordered by file.",
      "maxItems": 500,
      "items": {
        "$ref": "#/components/schemas/SnapshotItem"
      }
    }
  }
}
```

Schemas: [SnapshotItem](https://docs.tidynotebook.com/api-schemas.md#snapshotitem).

## SnapshotStarted

```json
{
  "type": "object",
  "description": "The captured snapshot and its opaque page token.",
  "additionalProperties": false,
  "required": [
    "token",
    "expiresAt",
    "cursor",
    "itemCount",
    "pageSize"
  ],
  "properties": {
    "token": {
      "type": "string",
      "readOnly": true,
      "description": "Opaque token that addresses the materialized pages for 15 minutes.",
      "minLength": 43,
      "maxLength": 43,
      "pattern": "^[A-Za-z0-9_-]{43}$"
    },
    "expiresAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the snapshot expires.",
      "format": "date-time"
    },
    "cursor": {
      "type": "string",
      "readOnly": true,
      "description": "The captured high-water cursor. A sync client asks for changes after this position.",
      "minLength": 1,
      "maxLength": 32,
      "pattern": "^[0-9]+$"
    },
    "itemCount": {
      "type": "integer",
      "readOnly": true,
      "description": "How many items the snapshot captured.",
      "minimum": 0
    },
    "pageSize": {
      "type": "integer",
      "readOnly": true,
      "description": "The page size stored with the snapshot.",
      "minimum": 1,
      "maximum": 500
    }
  }
}
```

## StartSnapshotInput

```json
{
  "type": "object",
  "description": "Snapshot start payload.",
  "additionalProperties": false,
  "required": [
    "syncVersion"
  ],
  "properties": {
    "syncVersion": {
      "type": "integer",
      "description": "Sync protocol version of the client. Only version 1 is served; any other value is rejected without changing data.",
      "enum": [
        1
      ]
    },
    "pageSize": {
      "type": "integer",
      "description": "Largest number of snapshot items in one page. The server uses 100 when the value is absent and never stores more than 500.",
      "minimum": 1,
      "maximum": 500
    }
  }
}
```

## StartWorkspaceImportInput

```json
{
  "type": "object",
  "description": "The size of the zip archive that one import sends.",
  "additionalProperties": false,
  "required": [
    "size"
  ],
  "properties": {
    "size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991,
      "description": "The bytes of the whole archive. An archive above the bound of one import answers payload_too_large before a part is sent."
    }
  }
}
```

## SupersededHead

```json
{
  "type": "object",
  "description": "One file whose accepted head moved between the read of the client and this changeset. The workspace rebased the save on the current head, so the later save still wins and the head that it passed stays in history. The record carries no text and no path: the accepted revision of the same answer already names the path.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "previousHeadRevisionId",
    "acceptedRevisionId"
  ],
  "properties": {
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The file whose accepted head moved."
    },
    "previousHeadRevisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The accepted head that the client did not see. It is now a history entry of the file, and its text is not lost."
    },
    "acceptedRevisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The revision of this changeset that became the new accepted head of the file."
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SyncChanges

```json
{
  "type": "object",
  "description": "Ordered incremental changes after a cursor.",
  "additionalProperties": false,
  "required": [
    "changes",
    "nextCursor"
  ],
  "properties": {
    "changes": {
      "type": "array",
      "readOnly": true,
      "description": "Ordered changes after the requested cursor, oldest first. The page holds whole commits only. One commit larger than the requested limit comes as one whole page, and a commit holds at most 1000 records.",
      "maxItems": 1000,
      "items": {
        "$ref": "#/components/schemas/SyncRecord"
      }
    },
    "nextCursor": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SyncCursorValue"
        }
      ],
      "readOnly": true,
      "description": "The cursor the client sends to continue."
    }
  }
}
```

Schemas: [SyncCursorValue](https://docs.tidynotebook.com/api-schemas.md#synccursorvalue), [SyncRecord](https://docs.tidynotebook.com/api-schemas.md#syncrecord).

## SyncCursorValue

```json
{
  "type": "string",
  "description": "One commit ordered position in the feed of a workspace. It is the decimal text of the position, and a reader sends the last one it applied to continue.",
  "minLength": 1,
  "maxLength": 32,
  "pattern": "^[0-9]+$"
}
```

## SyncDocumentRecord

```json
{
  "type": "object",
  "description": "One whole document of a note. The feed emits it when the generation of the note changes, because identities of one generation say nothing about another, and a reader cannot join the two by an update.",
  "additionalProperties": false,
  "required": [
    "kind",
    "cursor",
    "fileId",
    "revisionId",
    "path",
    "deleted",
    "digest",
    "epoch",
    "document"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Names this record form.",
      "enum": [
        "document"
      ]
    },
    "cursor": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SyncCursorValue"
        }
      ],
      "readOnly": true,
      "description": "The position of this record in the ordered feed."
    },
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The note that this record states."
    },
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The accepted revision that this document holds."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true,
      "description": "The accepted path of the note at this record."
    },
    "deleted": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the note is in Trash at this record."
    },
    "digest": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ContentDigest"
        }
      ],
      "readOnly": true,
      "description": "Digest of the text that this document derives."
    },
    "epoch": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DocumentEpoch"
        }
      ],
      "readOnly": true,
      "description": "The generation that this document starts for the reader."
    },
    "document": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DocumentUpdate"
        }
      ],
      "readOnly": true,
      "description": "The whole document of the note at this record."
    }
  }
}
```

Schemas: [ContentDigest](https://docs.tidynotebook.com/api-schemas.md#contentdigest), [DocumentEpoch](https://docs.tidynotebook.com/api-schemas.md#documentepoch), [DocumentUpdate](https://docs.tidynotebook.com/api-schemas.md#documentupdate), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [SyncCursorValue](https://docs.tidynotebook.com/api-schemas.md#synccursorvalue), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SyncMembershipRecord

```json
{
  "type": "object",
  "description": "One change of the membership of the workspace. A reader reads its own access again when it meets one.",
  "additionalProperties": false,
  "required": [
    "kind",
    "cursor",
    "accountId",
    "removed"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Names this record form.",
      "enum": [
        "membership"
      ]
    },
    "cursor": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SyncCursorValue"
        }
      ],
      "readOnly": true,
      "description": "The position of this record in the ordered feed."
    },
    "accountId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The account whose membership changed."
    },
    "removed": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the account no longer belongs to the workspace."
    }
  }
}
```

Schemas: [SyncCursorValue](https://docs.tidynotebook.com/api-schemas.md#synccursorvalue), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SyncNoticeAccount

```json
{
  "type": "object",
  "description": "The state or the controls of the account of the stream changed, for example it was locked or unlocked (records 0189 and 0201). The client reads the account again. The message names nothing of the change.",
  "additionalProperties": false,
  "required": [
    "kind"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "account"
    }
  }
}
```

## SyncNoticeChanged

```json
{
  "type": "object",
  "description": "A commit changed the feed of one subscribed workspace. The client reads the feed of that workspace through the HTTP operations. The notice carries no cursor and no content, and only an applied feed page moves the stored cursor. A missed or repeated notice changes no result.",
  "additionalProperties": false,
  "required": [
    "kind",
    "generation",
    "workspaceId"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "changed"
    },
    "generation": {
      "$ref": "#/components/schemas/SyncNoticeGeneration"
    },
    "workspaceId": {
      "$ref": "#/components/schemas/Uuid"
    }
  }
}
```

Schemas: [SyncNoticeGeneration](https://docs.tidynotebook.com/api-schemas.md#syncnoticegeneration), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SyncNoticeGeneration

```json
{
  "type": "integer",
  "description": "The number of one subscription set on one connection. The client raises it for each new set, starting at 1. The server echoes it on every answer and notice for that set, so a late message of an older set cannot act on a newer one.",
  "minimum": 1,
  "maximum": 9007199254740991
}
```

## SyncNoticeProtocol

```json
{
  "type": "string",
  "description": "The WebSocket subprotocol of the sync notice stream. The browser names it when it opens the stream, and the server accepts no other value. A later version gets a new name, so an old client and a new server never read each other's messages.",
  "const": "notesapp.sync.1"
}
```

## SyncNoticeReady

```json
{
  "type": "object",
  "description": "The first message of the server on a new connection. It names the account of the session that opened the stream. The connection holds no subscription until the client sends a set.",
  "additionalProperties": false,
  "required": [
    "kind",
    "accountId"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "ready"
    },
    "accountId": {
      "$ref": "#/components/schemas/Uuid"
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SyncNoticeReconcile

```json
{
  "type": "object",
  "description": "The server could have missed a commit, for example after its database listener reconnected. The client reads the feed of every workspace of the set.",
  "additionalProperties": false,
  "required": [
    "kind",
    "generation"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "reconcile"
    },
    "generation": {
      "$ref": "#/components/schemas/SyncNoticeGeneration"
    }
  }
}
```

Schemas: [SyncNoticeGeneration](https://docs.tidynotebook.com/api-schemas.md#syncnoticegeneration).

## SyncNoticeRefused

```json
{
  "type": "object",
  "description": "The server refused a subscription set as a whole. The set before it stays in force. `forbidden` means that the account cannot read one workspace of the set, so the client asks the HTTP operations which access it holds. `stale_generation` means that the generation is not above the last one.",
  "additionalProperties": false,
  "required": [
    "kind",
    "generation",
    "reason"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "refused"
    },
    "generation": {
      "$ref": "#/components/schemas/SyncNoticeGeneration"
    },
    "reason": {
      "type": "string",
      "enum": [
        "forbidden",
        "stale_generation"
      ]
    }
  }
}
```

Schemas: [SyncNoticeGeneration](https://docs.tidynotebook.com/api-schemas.md#syncnoticegeneration).

## SyncNoticeStop

```json
{
  "type": "object",
  "description": "The last message before the server closes the stream. The client keeps its local work in every case. `session_ended` means that the session or the account is no longer valid, so the client checks the session through the HTTP operations and does not reconnect. `malformed` means that the client sent a message outside this contract, so it does not reconnect with the same build. `draining` and `overloaded` ask the client to reconnect after a delay. `unavailable` means that the server cannot send notices now, so the client reads the feed on its own schedule and tries the stream again later.",
  "additionalProperties": false,
  "required": [
    "kind",
    "reason"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "stop"
    },
    "reason": {
      "type": "string",
      "enum": [
        "session_ended",
        "malformed",
        "draining",
        "overloaded",
        "unavailable"
      ]
    }
  }
}
```

## SyncNoticeSubscribe

```json
{
  "type": "object",
  "description": "The complete set of workspaces that the client wants notices for. It replaces the set before it as a whole. The server checks the access of the account to every workspace before it accepts the set, and refuses the whole set when one check fails. An empty set stops every notice.",
  "additionalProperties": false,
  "required": [
    "kind",
    "generation",
    "workspaceIds"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "subscribe"
    },
    "generation": {
      "$ref": "#/components/schemas/SyncNoticeGeneration"
    },
    "workspaceIds": {
      "type": "array",
      "description": "Every workspace of the set, at most as many as one workspace list holds.",
      "maxItems": 1000,
      "uniqueItems": true,
      "items": {
        "$ref": "#/components/schemas/Uuid"
      }
    }
  }
}
```

Schemas: [SyncNoticeGeneration](https://docs.tidynotebook.com/api-schemas.md#syncnoticegeneration), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SyncNoticeSubscribed

```json
{
  "type": "object",
  "description": "The server accepted a subscription set and registered it. A commit after this message sends a notice. The client reads each workspace of the set from its stored cursor after this message, so a commit before it is not lost.",
  "additionalProperties": false,
  "required": [
    "kind",
    "generation"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "const": "subscribed"
    },
    "generation": {
      "$ref": "#/components/schemas/SyncNoticeGeneration"
    }
  }
}
```

Schemas: [SyncNoticeGeneration](https://docs.tidynotebook.com/api-schemas.md#syncnoticegeneration).

## SyncProtocolReport

```json
{
  "type": "object",
  "description": "The sync protocol versions that push and pull accept.",
  "additionalProperties": false,
  "required": [
    "versions"
  ],
  "properties": {
    "versions": {
      "type": "array",
      "readOnly": true,
      "description": "Every served sync protocol version, oldest first. The list is never empty.",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "integer",
        "minimum": 1
      }
    },
    "notificationProtocols": {
      "type": "array",
      "readOnly": true,
      "description": "The notice stream subprotocols that this deployment opens now. The list is empty while this process cannot send notices. A server that omits the member predates the notice stream, so the client reads the feed on its own schedule.",
      "maxItems": 1,
      "uniqueItems": true,
      "items": {
        "$ref": "#/components/schemas/SyncNoticeProtocol"
      }
    }
  }
}
```

Schemas: [SyncNoticeProtocol](https://docs.tidynotebook.com/api-schemas.md#syncnoticeprotocol).

## SyncPurgeRecord

```json
{
  "type": "object",
  "description": "One note that the workspace removed for good. Its revisions no longer exist, so the record names the note itself and carries no revision.",
  "additionalProperties": false,
  "required": [
    "kind",
    "cursor",
    "fileId"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Names this record form.",
      "enum": [
        "purge"
      ]
    },
    "cursor": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SyncCursorValue"
        }
      ],
      "readOnly": true,
      "description": "The position of this record in the ordered feed."
    },
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The note that the workspace removed for good."
    }
  }
}
```

Schemas: [SyncCursorValue](https://docs.tidynotebook.com/api-schemas.md#synccursorvalue), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## SyncRecord

```json
{
  "description": "One record of the ordered feed. The kind states which form applies: the work of one save, a whole document at a new generation, a note that the workspace removed for good, or a change of the membership.",
  "oneOf": [
    {
      "$ref": "#/components/schemas/SyncUpdateRecord"
    },
    {
      "$ref": "#/components/schemas/SyncDocumentRecord"
    },
    {
      "$ref": "#/components/schemas/SyncPurgeRecord"
    },
    {
      "$ref": "#/components/schemas/SyncMembershipRecord"
    }
  ]
}
```

Schemas: [SyncDocumentRecord](https://docs.tidynotebook.com/api-schemas.md#syncdocumentrecord), [SyncMembershipRecord](https://docs.tidynotebook.com/api-schemas.md#syncmembershiprecord), [SyncPurgeRecord](https://docs.tidynotebook.com/api-schemas.md#syncpurgerecord), [SyncUpdateRecord](https://docs.tidynotebook.com/api-schemas.md#syncupdaterecord).

## SyncUpdateRecord

```json
{
  "type": "object",
  "description": "One accepted change of a note, as the work that follows the state the reader already holds. The record binds the update, the derived text digest, the revision, and the generation to one committed state.",
  "additionalProperties": false,
  "required": [
    "kind",
    "cursor",
    "fileId",
    "revisionId",
    "path",
    "deleted",
    "digest",
    "kindOfFile",
    "epoch",
    "update",
    "stateVector"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "description": "Names this record form.",
      "enum": [
        "update"
      ]
    },
    "cursor": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SyncCursorValue"
        }
      ],
      "readOnly": true,
      "description": "The position of this record in the ordered feed."
    },
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The note that this record changes."
    },
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The accepted revision that this record carries."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true,
      "description": "The accepted path of the note after this record."
    },
    "deleted": {
      "type": "boolean",
      "readOnly": true,
      "description": "True when the note is in Trash after this record."
    },
    "kindOfFile": {
      "type": "string",
      "readOnly": true,
      "description": "Whether the record states a note or an attachment.",
      "enum": [
        "note",
        "attachment"
      ]
    },
    "digest": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ContentDigest"
        }
      ],
      "readOnly": true,
      "description": "Digest of the text that the accepted document derives, or of the bytes of an attachment."
    },
    "epoch": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DocumentEpoch"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The generation that this update belongs to, or null for an attachment revision, which holds no document."
    },
    "update": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DocumentUpdate"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The work that this record adds to the document, or null for an attachment revision."
    },
    "stateVector": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/DocumentStateVector"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The state vector of the document at this revision, so a reader can ask for exactly the work that it lacks. Null for an attachment."
    }
  }
}
```

Schemas: [ContentDigest](https://docs.tidynotebook.com/api-schemas.md#contentdigest), [DocumentEpoch](https://docs.tidynotebook.com/api-schemas.md#documentepoch), [DocumentStateVector](https://docs.tidynotebook.com/api-schemas.md#documentstatevector), [DocumentUpdate](https://docs.tidynotebook.com/api-schemas.md#documentupdate), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [SyncCursorValue](https://docs.tidynotebook.com/api-schemas.md#synccursorvalue), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## TemplateSettings

```json
{
  "type": "object",
  "description": "The template settings that one member keeps in one workspace.",
  "additionalProperties": false,
  "required": [
    "folder"
  ],
  "properties": {
    "folder": {
      "type": "string",
      "readOnly": true,
      "description": "The folder whose notes are the templates, for example Templates or Work/Templates. A note in a subfolder is a template as well.",
      "minLength": 1,
      "maxLength": 1024
    }
  }
}
```

## TemplateSettingsInput

```json
{
  "type": "object",
  "description": "The template settings to store for the signed in member.",
  "additionalProperties": false,
  "required": [
    "folder"
  ],
  "properties": {
    "folder": {
      "type": "string",
      "description": "The folder whose notes are the templates, as a folder path with no slash at either end.",
      "minLength": 1,
      "maxLength": 1024
    }
  }
}
```

## ThemeColour

```json
{
  "type": "string",
  "description": "One colour of an imported theme, as a hash and six hexadecimal digits.",
  "minLength": 7,
  "maxLength": 7,
  "pattern": "^#[0-9a-fA-F]{6}$"
}
```

## ThemeFamily

```json
{
  "type": "string",
  "description": "Identifier of a theme family in the client theme registry, for example tokyo-night, or custom- and the identifier of a theme that the account imported. An identifier that the client does not know falls back to the default family, so a stored value never stops the page painting.",
  "minLength": 1,
  "maxLength": 64,
  "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
}
```

## ThemeImportInput

```json
{
  "type": "object",
  "description": "A theme to keep for the signed in account: a name and a light palette, a dark palette or both.",
  "additionalProperties": false,
  "required": [
    "name"
  ],
  "minProperties": 2,
  "properties": {
    "name": {
      "$ref": "#/components/schemas/ThemeName"
    },
    "light": {
      "$ref": "#/components/schemas/ThemePalette"
    },
    "dark": {
      "$ref": "#/components/schemas/ThemePalette"
    }
  }
}
```

Schemas: [ThemeName](https://docs.tidynotebook.com/api-schemas.md#themename), [ThemePalette](https://docs.tidynotebook.com/api-schemas.md#themepalette).

## ThemeName

```json
{
  "type": "string",
  "description": "The name of an imported theme, as a person reads it.",
  "minLength": 1,
  "maxLength": 60
}
```

## ThemePalette

```json
{
  "type": "object",
  "description": "The light or the dark palette of one imported theme.",
  "additionalProperties": false,
  "required": [
    "tokens",
    "syntax"
  ],
  "properties": {
    "tokens": {
      "$ref": "#/components/schemas/ThemePaletteTokens"
    },
    "syntax": {
      "$ref": "#/components/schemas/ThemePaletteSyntax"
    }
  }
}
```

Schemas: [ThemePaletteSyntax](https://docs.tidynotebook.com/api-schemas.md#themepalettesyntax), [ThemePaletteTokens](https://docs.tidynotebook.com/api-schemas.md#themepalettetokens).

## ThemePaletteSyntax

```json
{
  "type": "object",
  "description": "The colours of code inside a fenced block of one palette.",
  "additionalProperties": false,
  "required": [
    "keyword",
    "string",
    "comment",
    "number",
    "tag",
    "attribute",
    "heading",
    "link",
    "punctuation"
  ],
  "properties": {
    "keyword": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "string": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "comment": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "number": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "tag": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "attribute": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "heading": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "link": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "punctuation": {
      "$ref": "#/components/schemas/ThemeColour"
    }
  }
}
```

Schemas: [ThemeColour](https://docs.tidynotebook.com/api-schemas.md#themecolour).

## ThemePaletteTokens

```json
{
  "type": "object",
  "description": "The interface colours of one palette. Each member is a token of the theme registry of the client.",
  "additionalProperties": false,
  "required": [
    "background",
    "surface",
    "surfaceCard",
    "surfaceHover",
    "surfaceActive",
    "text",
    "textStrong",
    "textMuted",
    "accentText",
    "accentFill",
    "accentOnFill",
    "successText",
    "dangerText",
    "dangerFill",
    "onDanger",
    "border",
    "borderSubtle",
    "focus",
    "scrim"
  ],
  "properties": {
    "background": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "surface": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "surfaceCard": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "surfaceHover": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "surfaceActive": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "text": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "textStrong": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "textMuted": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "accentText": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "accentFill": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "accentOnFill": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "successText": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "dangerText": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "dangerFill": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "onDanger": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "border": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "borderSubtle": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "focus": {
      "$ref": "#/components/schemas/ThemeColour"
    },
    "scrim": {
      "$ref": "#/components/schemas/ThemeColour"
    }
  }
}
```

Schemas: [ThemeColour](https://docs.tidynotebook.com/api-schemas.md#themecolour).

## UnlockPublishedLinkInput

```json
{
  "type": "object",
  "description": "The password of one published link.",
  "additionalProperties": false,
  "required": [
    "password"
  ],
  "properties": {
    "password": {
      "type": "string",
      "writeOnly": true,
      "description": "The password that the owner gave the link. Any value is accepted here and a wrong value takes the one refusal, so the answer states nothing about the link or about the password policy.",
      "minLength": 1,
      "maxLength": 512
    }
  }
}
```

## UpdateFileInput

```json
{
  "type": "object",
  "description": "The identifiers and the new content or path of a file.",
  "additionalProperties": false,
  "required": [
    "revisionId",
    "mutationId",
    "deviceId"
  ],
  "properties": {
    "revisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identifier of the new revision."
    },
    "mutationId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "Identity of this operation, which makes a retry safe."
    },
    "deviceId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DeviceId"
        }
      ],
      "description": "The device that submitted the change."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "description": "New path of the file. The path of the expected head is kept when this member is absent."
    },
    "document": {
      "allOf": [
        {
          "$ref": "#/components/schemas/DocumentSave"
        }
      ],
      "description": "The document work of this save. The text of the expected head is kept when this member is absent, which is how a plain rename is written."
    },
    "message": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CheckpointMessage"
        }
      ],
      "description": "Name of this checkpoint, or null."
    }
  }
}
```

Schemas: [CheckpointMessage](https://docs.tidynotebook.com/api-schemas.md#checkpointmessage), [DeviceId](https://docs.tidynotebook.com/api-schemas.md#deviceid), [DocumentSave](https://docs.tidynotebook.com/api-schemas.md#documentsave), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## UploadAttachmentInput

```json
{
  "type": "object",
  "description": "Multipart form upload payload that contains the binary attachment file.",
  "additionalProperties": false,
  "required": [
    "file"
  ],
  "properties": {
    "file": {
      "type": "string",
      "format": "binary",
      "description": "Binary bytes of the image attachment."
    }
  }
}
```

## UsageLimit

```json
{
  "type": "string",
  "description": "The limit of the month that refused a request (record 0193), on the codes download_limit and storage_busy only. downloads is the download limit of the account or the download cap of the installation, object_reads the object read cap and object_writes the object write cap of the installation. A client names the cause from it, and never shows the value.",
  "enum": [
    "downloads",
    "object_reads",
    "object_writes"
  ]
}
```

## UsageMonth

```json
{
  "type": "string",
  "description": "One calendar month in UTC, as the year and the month.",
  "minLength": 7,
  "maxLength": 7,
  "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
}
```

## Uuid

```json
{
  "type": "string",
  "description": "A UUID that names one record.",
  "format": "uuid",
  "minLength": 36,
  "maxLength": 36,
  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
```

## ValidationIssue

```json
{
  "type": "object",
  "description": "One value that a boundary check rejected.",
  "additionalProperties": false,
  "required": [
    "path",
    "message"
  ],
  "properties": {
    "path": {
      "type": "string",
      "readOnly": true,
      "description": "JSON Pointer of the rejected value inside its request slot.",
      "maxLength": 256
    },
    "message": {
      "type": "string",
      "readOnly": true,
      "description": "Reason the value was rejected. It never repeats the value.",
      "maxLength": 256
    }
  }
}
```

## Workspace

```json
{
  "type": "object",
  "description": "One workspace as its member sees it.",
  "additionalProperties": false,
  "required": [
    "workspaceId",
    "name",
    "role",
    "personal"
  ],
  "properties": {
    "workspaceId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Identifier of the workspace."
    },
    "name": {
      "type": "string",
      "readOnly": true,
      "description": "Name of the workspace.",
      "minLength": 1,
      "maxLength": 200
    },
    "role": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Role"
        }
      ],
      "readOnly": true,
      "description": "The role of the reading account in this workspace."
    },
    "personal": {
      "type": "boolean",
      "readOnly": true,
      "description": "True for the workspace that was created with the account."
    }
  }
}
```

Schemas: [Role](https://docs.tidynotebook.com/api-schemas.md#role), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## WorkspaceDeletedFileList

```json
{
  "type": "object",
  "description": "One page of the deleted files of a workspace.",
  "additionalProperties": false,
  "required": [
    "files",
    "nextCursor"
  ],
  "properties": {
    "files": {
      "type": "array",
      "readOnly": true,
      "description": "The deleted files of this page, in the requested order.",
      "maxItems": 500,
      "items": {
        "$ref": "#/components/schemas/WorkspaceDeletedFileSummary"
      }
    },
    "nextCursor": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/FilePageToken"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "Cursor of the next page, or null when this page is the last one. It continues the sort that produced it."
    }
  }
}
```

Schemas: [FilePageToken](https://docs.tidynotebook.com/api-schemas.md#filepagetoken), [WorkspaceDeletedFileSummary](https://docs.tidynotebook.com/api-schemas.md#workspacedeletedfilesummary).

## WorkspaceDeletedFileSummary

```json
{
  "type": "object",
  "description": "One deleted file of a workspace, without its content.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "path",
    "kind",
    "headRevisionId",
    "createdAt",
    "deletedAt"
  ],
  "properties": {
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Stable identifier of the file. A rename never changes it."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true,
      "description": "The path that the file held when it was deleted."
    },
    "kind": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FileKind"
        }
      ],
      "readOnly": true,
      "description": "Whether the file holds Markdown or an attachment."
    },
    "headRevisionId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "The tombstone revision that deleted the file, which is its accepted head and its entity tag. A restore states it as the expected head."
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the file was created.",
      "format": "date-time",
      "maxLength": 64
    },
    "deletedAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the workspace accepted the deletion.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

Schemas: [FileKind](https://docs.tidynotebook.com/api-schemas.md#filekind), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## WorkspaceFile

```json
{
  "type": "object",
  "description": "One live file and the content of its accepted head.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "path",
    "kind",
    "headRevisionId",
    "createdAt",
    "updatedAt",
    "head"
  ],
  "properties": {
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Stable identifier of the file."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true,
      "description": "The accepted path of the file."
    },
    "kind": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FileKind"
        }
      ],
      "readOnly": true,
      "description": "Whether the file holds Markdown or an attachment."
    },
    "headRevisionId": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The accepted head, which is also the entity tag."
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the file was created.",
      "format": "date-time",
      "maxLength": 64
    },
    "updatedAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the workspace accepted the last change.",
      "format": "date-time",
      "maxLength": 64
    },
    "head": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/FileRevision"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The head revision with its content, or null for a file that has no accepted revision yet."
    }
  }
}
```

Schemas: [FileKind](https://docs.tidynotebook.com/api-schemas.md#filekind), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [FileRevision](https://docs.tidynotebook.com/api-schemas.md#filerevision), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## WorkspaceFileList

```json
{
  "type": "object",
  "description": "One page of the live files of a workspace.",
  "additionalProperties": false,
  "required": [
    "files",
    "nextCursor"
  ],
  "properties": {
    "files": {
      "type": "array",
      "readOnly": true,
      "description": "The files of this page, in the requested order.",
      "maxItems": 500,
      "items": {
        "$ref": "#/components/schemas/WorkspaceFileSummary"
      }
    },
    "nextCursor": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/FilePageToken"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "Cursor of the next page, or null when this page is the last one. It continues the sort that produced it."
    }
  }
}
```

Schemas: [FilePageToken](https://docs.tidynotebook.com/api-schemas.md#filepagetoken), [WorkspaceFileSummary](https://docs.tidynotebook.com/api-schemas.md#workspacefilesummary).

## WorkspaceFileSummary

```json
{
  "type": "object",
  "description": "One live file of a workspace, without its content.",
  "additionalProperties": false,
  "required": [
    "fileId",
    "path",
    "kind",
    "headRevisionId",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "fileId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "readOnly": true,
      "description": "Stable identifier of the file. A rename never changes it."
    },
    "path": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FilePath"
        }
      ],
      "readOnly": true,
      "description": "The accepted path of the file."
    },
    "kind": {
      "allOf": [
        {
          "$ref": "#/components/schemas/FileKind"
        }
      ],
      "readOnly": true,
      "description": "Whether the file holds Markdown or an attachment."
    },
    "headRevisionId": {
      "oneOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true,
      "description": "The accepted head of the file, which is also its entity tag, or null for a file that has no accepted revision yet."
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the file was created.",
      "format": "date-time",
      "maxLength": 64
    },
    "updatedAt": {
      "type": "string",
      "readOnly": true,
      "description": "Instant at which the workspace accepted the last change.",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
```

Schemas: [FileKind](https://docs.tidynotebook.com/api-schemas.md#filekind), [FilePath](https://docs.tidynotebook.com/api-schemas.md#filepath), [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## WorkspaceImportPart

```json
{
  "type": "string",
  "format": "binary",
  "description": "The bytes of one part of a portable workspace zip archive."
}
```

## WorkspaceImportPartReceived

```json
{
  "type": "object",
  "description": "One part of an import that the server stored.",
  "additionalProperties": false,
  "required": [
    "partNumber",
    "size"
  ],
  "properties": {
    "partNumber": {
      "type": "integer",
      "minimum": 1,
      "description": "The place of the part in the archive, from 1."
    },
    "size": {
      "type": "integer",
      "minimum": 1,
      "description": "The bytes of the part that the server stored."
    }
  }
}
```

## WorkspaceImportStarted

```json
{
  "type": "object",
  "description": "An import upload that waits for its parts.",
  "additionalProperties": false,
  "required": [
    "importId",
    "partBytes"
  ],
  "properties": {
    "importId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Uuid"
        }
      ],
      "description": "The identifier that each part and the completion name."
    },
    "partBytes": {
      "type": "integer",
      "minimum": 1,
      "description": "The bytes of each part but the last. The last part holds the rest of the archive."
    }
  }
}
```

Schemas: [Uuid](https://docs.tidynotebook.com/api-schemas.md#uuid).

## WorkspaceList

```json
{
  "type": "object",
  "description": "Every workspace of the signed in account.",
  "additionalProperties": false,
  "required": [
    "workspaces"
  ],
  "properties": {
    "workspaces": {
      "type": "array",
      "readOnly": true,
      "description": "One entry for each workspace the account belongs to.",
      "maxItems": 1000,
      "items": {
        "$ref": "#/components/schemas/Workspace"
      }
    }
  }
}
```

Schemas: [Workspace](https://docs.tidynotebook.com/api-schemas.md#workspace).

## WorkspaceNameInput

```json
{
  "type": "object",
  "description": "The name to give a workspace.",
  "additionalProperties": false,
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the workspace.",
      "minLength": 1,
      "maxLength": 200
    }
  }
}
```

