{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hjarni-com/json-schema/hjarni-com-trashed-note-schema.json",
  "title": "TrashedNote",
  "description": "A note in the Trash, as GET /notes/trash returns it.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hjarni-com-openapi.json#/components/schemas/TrashedNote",
  "allOf": [
    {
      "$ref": "#/$defs/NoteSummary"
    },
    {
      "type": "object",
      "required": [
        "body",
        "deleted_at",
        "purge_after",
        "deleted_by"
      ],
      "properties": {
        "body": {
          "type": [
            "string",
            "null"
          ],
          "description": "Always present on a trashed note."
        },
        "deleted_at": {
          "type": "string",
          "format": "date-time"
        },
        "purge_after": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When it is permanently removed, 30 days after deletion."
        },
        "deleted_by": {
          "type": [
            "string",
            "null"
          ],
          "description": "Email address of whoever deleted it."
        }
      }
    }
  ],
  "$defs": {
    "ContainerRef": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "NoteAttachment": {
      "type": "object",
      "description": "A file attached to a note.",
      "required": [
        "id",
        "description",
        "filename",
        "content_type",
        "byte_size",
        "url",
        "url_expires_at"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "filename": {
          "type": "string"
        },
        "content_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "byte_size": {
          "type": "integer"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Signed download link that works without a token until `url_expires_at` (15 minutes). Treat it as a credential and do not store it; fetch the note again for a fresh one."
        },
        "url_expires_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "NoteSummary": {
      "type": "object",
      "description": "A note as list endpoints return it. `body` is left out when the request sets `exclude_body=true`; `last_edited_by` and `last_edited_by_agent` appear only once someone has edited the note; `team` appears only on team notes.",
      "required": [
        "id",
        "title",
        "summary",
        "summary_stale",
        "source_url",
        "archived",
        "favorited",
        "position",
        "lock_version",
        "created_at",
        "updated_at",
        "tag_list",
        "tags",
        "container",
        "files"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "title": {
          "type": "string"
        },
        "body": {
          "type": [
            "string",
            "null"
          ],
          "description": "Markdown. `[[id:Title]]` is a wiki-link to another note."
        },
        "summary": {
          "type": [
            "string",
            "null"
          ],
          "description": "A short summary for scanning."
        },
        "summary_stale": {
          "type": "boolean",
          "description": "True when the body changed after the summary was written."
        },
        "source_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "archived": {
          "type": "boolean"
        },
        "favorited": {
          "type": "boolean"
        },
        "position": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Sort position among its siblings; null when unpositioned."
        },
        "lock_version": {
          "type": "integer",
          "description": "Increases on every save. Send it back as expected_lock_version to guard a write."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "last_edited_by": {
          "type": [
            "string",
            "null"
          ],
          "description": "Email address of whoever saved the note last."
        },
        "last_edited_by_agent": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the agent or token that saved last, if one did."
        },
        "tag_list": {
          "type": "string",
          "description": "Tag names joined by a comma and a space, e.g. \"planning, review\"."
        },
        "tags": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TagRef"
          }
        },
        "container": {
          "description": "The folder the note is filed in; null for the inbox.",
          "oneOf": [
            {
              "$ref": "#/$defs/ContainerRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "team": {
          "$ref": "#/$defs/TeamRef"
        },
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NoteAttachment"
          }
        }
      }
    },
    "TagRef": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "TeamRef": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}