diff --git a/astro.config.mjs b/astro.config.mjs
index bb35822..6761ae2 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -5,6 +5,8 @@ import react from "@astrojs/react";
import starlightOpenAPIPlugin, {
openAPISidebarGroups,
} from "starlight-openapi";
+import starlightSidebarTopics from "starlight-sidebar-topics";
+import { pele } from "astro-pele";
// https://astro.build/config
export default defineConfig({
@@ -32,6 +34,9 @@ export default defineConfig({
editLink: {
baseUrl: "https://github.com/pulsate-dev/docs/edit/main/",
},
+ components: {
+ Sidebar: "./src/content/components/organisms/Sidebar.astro",
+ },
social: [
{
icon: "discord",
@@ -54,18 +59,105 @@ export default defineConfig({
"https://unpkg.com/@pulsate-dev/api-schema@latest/schema.json",
},
]),
- ],
- sidebar: [
- {
- label: "スタートガイド",
- translations: {
- en: "Start Guide",
+ starlightSidebarTopics(
+ [
+ {
+ id: "pulsate",
+ label: "Pulsate",
+ link: "/pulsate/beginner/what-is-pulsate",
+ icon: "open-book",
+ items: [
+ {
+ label: "スタートガイド",
+ translations: {
+ en: "Start Guide",
+ },
+ items: [
+ "pulsate/beginner/what-is-pulsate",
+ "pulsate/beginner/getting-started",
+ ],
+ },
+ ...openAPISidebarGroups,
+ ],
+ },
+ {
+ id: "caramel",
+ label: "Caramel",
+ link: "/caramel",
+ icon: "laptop",
+ items: [{ label: "Caramel", items: ["caramel"] }],
+ },
+ {
+ id: "spec",
+ label: "Specification",
+ link: "/spec",
+ icon: "document",
+ items: [
+ {
+ label: "プロジェクト",
+ items: [
+ { slug: "spec", label: "Introduction" },
+ "spec/project",
+ "spec/user-story",
+ ],
+ },
+ {
+ label: "モデルリファレンス",
+ items: [
+ { slug: "spec/model", label: "概要" },
+ "spec/model/account",
+ "spec/model/note",
+ "spec/model/drive",
+ "spec/model/list",
+ "spec/model/notification",
+ "spec/model/event",
+ ],
+ },
+ {
+ label: "API エンドポイント",
+ items: [
+ { slug: "spec/endpoint", label: "概要" },
+ "spec/endpoint/account",
+ "spec/endpoint/drive",
+ "spec/endpoint/list",
+ "spec/endpoint/notes",
+ "spec/endpoint/notification",
+ "spec/endpoint/search",
+ "spec/endpoint/timeline",
+ ],
+ },
+ {
+ label: "設計",
+ items: ["spec/module", "spec/authorization"],
+ },
+ ],
+ },
+ ],
+ {
+ // The index page is a splash landing page that belongs to no topic
+ exclude: ["/", "/en"],
+ // Pages absent from `items` (hidden or plugin-generated by starlight-openapi) need an explicit topic
+ topics: {
+ pulsate: [
+ "/api-reference/**",
+ "/en/api-reference/**",
+ "/pulsate/user/**",
+ "/en/pulsate/user/**",
+ ],
+ },
},
- items: ["beginner/what-is-pulsate", "beginner/getting-started"],
- },
- ...openAPISidebarGroups,
+ ),
],
}),
react(),
+ pele(),
+ {
+ name: "pele-lightbox",
+ hooks: {
+ "astro:config:setup": ({ injectScript }) => {
+ injectScript("page", 'import "/src/content/scripts/pele-lightbox.ts";');
+ },
+ },
+ },
],
});
diff --git a/mise.toml b/mise.toml
index cf10f3a..3566ef7 100644
--- a/mise.toml
+++ b/mise.toml
@@ -3,3 +3,4 @@ idiomatic_version_file_enable_tools = ["node"]
[tools]
node = "26"
+pnpm = "12.17.0"
diff --git a/package.json b/package.json
index e837f06..9b67222 100644
--- a/package.json
+++ b/package.json
@@ -25,10 +25,14 @@
"@astrojs/starlight": "0.43.1",
"@scalar/api-reference-react": "^0.9.0",
"astro": "^7.0.0",
+ "astro-pele": "^0.1.3",
+ "pele": "^1.13.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sharp": "^0.35.0",
- "starlight-openapi": "^0.27.0"
+ "starlight-openapi": "^0.27.0",
+ "starlight-sidebar-topics": "^0.9.0",
+ "starlight-sidebar-topics-dropdown": "^0.7.1"
},
"devDependencies": {
"@biomejs/biome": "^2.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2797bab..1daa0a3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -200,6 +200,12 @@ importers:
astro:
specifier: ^7.0.0
version: 7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1)
+ astro-pele:
+ specifier: ^0.1.3
+ version: 0.1.3(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(pele@1.13.0)
+ pele:
+ specifier: ^1.13.0
+ version: 1.13.0
react:
specifier: ^19.0.0
version: 19.3.1
@@ -212,6 +218,12 @@ importers:
starlight-openapi:
specifier: ^0.27.0
version: 0.27.1(@astrojs/markdown-satteri@0.4.10)(@astrojs/starlight@0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3))(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(openapi-types@12.1.3)
+ starlight-sidebar-topics:
+ specifier: ^0.9.0
+ version: 0.9.0(@astrojs/starlight@0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3))(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))
+ starlight-sidebar-topics-dropdown:
+ specifier: ^0.7.1
+ version: 0.7.1(@astrojs/starlight@0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3))(starlight-sidebar-topics@0.9.0(@astrojs/starlight@0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3))(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1)))
devDependencies:
'@biomejs/biome':
specifier: ^2.0.0
@@ -2110,6 +2122,13 @@ packages:
peerDependencies:
astro: ^4.0.0-beta || ^5.0.0-beta || ^3.3.0 || ^6.0.0-beta || ^7.0.0
+ astro-pele@0.1.3:
+ resolution: {integrity: sha512-6HiErC9ru6U6GSPL2mcUFIXHcUXowAk4QxoZTL798H3yG8NMuo4usQHx/XcDksCE5z1jKrm5YTzoBzPV0U8rcA==}
+ engines: {node: '>=22.23.4'}
+ peerDependencies:
+ astro: ^7.2.0
+ pele: ^1.10.0
+
astro@7.4.13:
resolution: {integrity: sha512-tcpMXEB9jypYzbnzT/g6yxL0jRkFlj3WsvxcWgsxRjPBUE6r81qLo/7kN5GMWz6hC7spzrg6fvCeL2HG0Bl68g==}
engines: {node: '>=22.23.4', npm: '>=9.6.5', pnpm: '>=7.1.0'}
@@ -2887,6 +2906,10 @@ packages:
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
engines: {node: '>= 0.4'}
+ mdast-pele@0.1.3:
+ resolution: {integrity: sha512-sSfsnpM3bdZswev5Ms9aVKQmymngbgMtMkNdVOYdFEArYQKk9X3HMTZ1Ies5LUsGyo1uiwCkDdjh7o2WKRIWyA==}
+ engines: {node: '>=20'}
+
mdast-util-directive@3.1.0:
resolution: {integrity: sha512-I3fNFt+DHmpWCYAT7quoM6lHf9wuqtI+oCOfvILnoicNIqjh5E3dEJWiXuYME2gNe8vl1iMQwyUHa7bgFmak6Q==}
@@ -3157,6 +3180,10 @@ packages:
pause-stream@0.0.11:
resolution: {integrity: sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==}
+ pele@1.13.0:
+ resolution: {integrity: sha512-Ie8UKY9x00MsuR3jO6AzUwzK2Z6MIV3Tf4EDdITiuk8Uaz8K7g0R082WqsqNaSU8DdgkrRvZThzhit83mi/uiw==}
+ engines: {node: '>=20'}
+
piccolore@0.1.3:
resolution: {integrity: sha512-o8bTeDWjE086iwKrROaDf31K0qC/BENdm15/uH9usSC/uZjJOKb2YGiVHfLY4GhwsERiPI1jmwI2XrA7ACOxVw==}
@@ -3403,6 +3430,20 @@ packages:
'@astrojs/starlight': '>=0.41.0'
astro: '>=7.0.2'
+ starlight-sidebar-topics-dropdown@0.7.1:
+ resolution: {integrity: sha512-08/Jg6z2+tklXt7+M30dHQgwNFbepZ3R6O/Fd37Horq4O8zyoei7p/tUKIs7iE+E5GvVcUucPgUj/TAITCffxg==}
+ engines: {node: '>=22.12.0'}
+ peerDependencies:
+ '@astrojs/starlight': '>=0.42.0'
+ starlight-sidebar-topics: '>=0.9.0'
+
+ starlight-sidebar-topics@0.9.0:
+ resolution: {integrity: sha512-xFwMAAtTVyqsO5DZ8Ldk0vN+2QoPdtjtDi8fbrzvQATIJvIvfaBLL9JzfXAjNHI9vMkj35VMWMd8tTICeO6RIA==}
+ engines: {node: '>=22.12.0'}
+ peerDependencies:
+ '@astrojs/starlight': '>=0.42.0'
+ astro: ^7.2.10
+
std-env@4.3.0:
resolution: {integrity: sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==}
@@ -3574,9 +3615,15 @@ packages:
unist-util-visit-parents@6.0.2:
resolution: {integrity: sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==}
+ unist-util-visit-parents@6.1.0:
+ resolution: {integrity: sha512-vKXxz6O38sKDj1mtx/k2cWvkkFBuYGx6uGrlzBkVeWCRF/F8sdI0j3Wbkz/5rVNRRuVc8UrgRdbCxNhmYXgP3w==}
+
unist-util-visit@5.1.0:
resolution: {integrity: sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==}
+ unist-util-visit@5.2.0:
+ resolution: {integrity: sha512-fpsYs/VVoZxfGY9/j3FQpZmN8wdLJaV1Pt38AaJNZu9uKIHcFU3halCdBveEq1HGKO1OEfJY65w1zvoFV1b3qQ==}
+
unplugin@3.5.0:
resolution: {integrity: sha512-s9qc6Y8ChhQE9RZ9Se+znEtZA0oK31LmEBO9y97ixR3ErA8UwlzA4XNybg/41od8rQ8EKScVQM857NWnI+EWkQ==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -6139,6 +6186,12 @@ snapshots:
rehype-expressive-code: 0.44.1
url-extras: 0.1.0
+ astro-pele@0.1.3(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(pele@1.13.0):
+ dependencies:
+ astro: 7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1)
+ mdast-pele: 0.1.3
+ pele: 1.13.0
+
astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1):
dependencies:
'@astrojs/compiler-rs': 0.5.3
@@ -7017,6 +7070,13 @@ snapshots:
math-intrinsics@1.1.0: {}
+ mdast-pele@0.1.3:
+ dependencies:
+ '@types/mdast': 4.0.4
+ '@types/unist': 3.0.3
+ pele: 1.13.0
+ unist-util-visit: 5.2.0
+
mdast-util-directive@3.1.0(supports-color@7.2.0):
dependencies:
'@types/mdast': 4.0.4
@@ -7460,6 +7520,8 @@ snapshots:
dependencies:
through: 2.3.8
+ pele@1.13.0: {}
+
piccolore@0.1.3: {}
picocolors@1.1.1: {}
@@ -7855,6 +7917,17 @@ snapshots:
transitivePeerDependencies:
- openapi-types
+ starlight-sidebar-topics-dropdown@0.7.1(@astrojs/starlight@0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3))(starlight-sidebar-topics@0.9.0(@astrojs/starlight@0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3))(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))):
+ dependencies:
+ '@astrojs/starlight': 0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3)
+ starlight-sidebar-topics: 0.9.0(@astrojs/starlight@0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3))(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))
+
+ starlight-sidebar-topics@0.9.0(@astrojs/starlight@0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3))(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1)):
+ dependencies:
+ '@astrojs/starlight': 0.43.1(astro@7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1))(supports-color@7.2.0)(typescript@6.0.3)
+ astro: 7.4.13(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1)
+ picomatch: 4.0.7
+
std-env@4.3.0: {}
stream-combiner@0.2.2:
@@ -8039,12 +8112,23 @@ snapshots:
'@types/unist': 3.0.3
unist-util-is: 6.0.1
+ unist-util-visit-parents@6.1.0:
+ dependencies:
+ '@types/unist': 3.0.3
+ unist-util-is: 6.0.1
+
unist-util-visit@5.1.0:
dependencies:
'@types/unist': 3.0.3
unist-util-is: 6.0.1
unist-util-visit-parents: 6.0.2
+ unist-util-visit@5.2.0:
+ dependencies:
+ '@types/unist': 3.0.3
+ unist-util-is: 6.0.1
+ unist-util-visit-parents: 6.1.0
+
unplugin@3.5.0(esbuild@0.28.2)(rolldown@1.3.4)(vite@8.4.0(@types/node@26.6.11)(esbuild@0.28.2)(yaml@2.9.1)):
dependencies:
'@jridgewell/remapping': 2.3.5
diff --git a/src/content/components/organisms/Sidebar.astro b/src/content/components/organisms/Sidebar.astro
new file mode 100644
index 0000000..704695f
--- /dev/null
+++ b/src/content/components/organisms/Sidebar.astro
@@ -0,0 +1,10 @@
+---
+import Default from "@astrojs/starlight/components/Sidebar.astro";
+import { TopicsDropdown } from "starlight-sidebar-topics-dropdown";
+
+const { hasSidebar } = Astro.locals.starlightRoute;
+const { isPageWithTopic } = Astro.locals.starlightSidebarTopics;
+---
+
+{hasSidebar && isPageWithTopic && }
+
diff --git a/src/content/docs/caramel/index.mdx b/src/content/docs/caramel/index.mdx
new file mode 100644
index 0000000..df011c5
--- /dev/null
+++ b/src/content/docs/caramel/index.mdx
@@ -0,0 +1,8 @@
+---
+title: Caramel
+description: Caramel は Pulsate の Minimal クライアントです。
+---
+
+Caramel は Pulsate のための Minimal なクライアントです。
+
+このセクションのドキュメントは準備中です。
diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx
index f8bcc32..888a950 100644
--- a/src/content/docs/index.mdx
+++ b/src/content/docs/index.mdx
@@ -10,7 +10,7 @@ hero:
actions:
- text: はじめる
icon: right-arrow
- link: /beginner/what-is-pulsate
+ link: /pulsate/beginner/what-is-pulsate
- text: GitHub
icon: external
variant: minimal
diff --git a/src/content/docs/beginner/getting-started.mdx b/src/content/docs/pulsate/beginner/getting-started.mdx
similarity index 100%
rename from src/content/docs/beginner/getting-started.mdx
rename to src/content/docs/pulsate/beginner/getting-started.mdx
diff --git a/src/content/docs/beginner/what-is-pulsate.mdx b/src/content/docs/pulsate/beginner/what-is-pulsate.mdx
similarity index 100%
rename from src/content/docs/beginner/what-is-pulsate.mdx
rename to src/content/docs/pulsate/beginner/what-is-pulsate.mdx
diff --git a/src/content/docs/roadmap.mdx b/src/content/docs/pulsate/roadmap.mdx
similarity index 100%
rename from src/content/docs/roadmap.mdx
rename to src/content/docs/pulsate/roadmap.mdx
diff --git a/src/content/docs/user/post.mdx b/src/content/docs/pulsate/user/post.mdx
similarity index 100%
rename from src/content/docs/user/post.mdx
rename to src/content/docs/pulsate/user/post.mdx
diff --git a/src/content/docs/spec/authorization.md b/src/content/docs/spec/authorization.md
new file mode 100644
index 0000000..67227b6
--- /dev/null
+++ b/src/content/docs/spec/authorization.md
@@ -0,0 +1,72 @@
+---
+title: "認可制御"
+---
+
+このドキュメントでは,Pulsate API(v0) における認可制御について記述する.
+
+## 用語
+
+- `Actor`: アクションを実行する主体.`Account`が該当する.
+- `Action`: リソースに対して行う何らかの操作のこと.
+ - `read`: 読み取り
+ - `write`: 書き込み,更新(リソースが更新可能な場合),リソースの削除
+- `Resource`: `Action`の対象となるもの.
+- `Target`:
+ 操作が許可されたときに使用する,操作を行うまたは操作後のリソースを保存するもの.
+- `Policy`: `Actor`が`Action`を実行するための条件.
+
+## 全体像
+
+- Pulsate API での認可制御は Policy を接尾辞にもつクラス群によって定義される.
+- この Policy クラス群の各クラスは `withCheck` static メソッドを持ち,actor,
+ action, resource, targetの3値,および関数 `fn` を要求する.
+ - `withCheck` メソッドはジェネリクス `` を受け取る.`Target` は
+ target の型,`Res` は `fn` の返値である.
+
+```ts
+interface PolicyArgs {
+ actor: Actor;
+ action: Action;
+ resource: Resource;
+}
+
+type NotePolicyArgs = PolicyArgs;
+
+class NotePolicy {
+ static withCheck(
+ target: Target,
+ ): (
+ args: NotePolicyArgs,
+ fn: (target: Target) => Promise>,
+ ) => Promise> {
+ return async (
+ args: AccountPolicyArgs,
+ fn: (target: Target) => Promise>,
+ ): Promise> => {
+ if (!args.actor) return Result.err(Error("ログインしないと使えません"));
+ // 条件を満たしたときだけ実行する
+ return await fn(target);
+ };
+ }
+}
+```
+
+### PolicyAction
+
+Action は識別子 PolicyAction を用いて識別する.
+
+- PolicyAction は3つの要素からなる文字列である.
+- 要素は以下の通り.
+ - 1: ポリシー名
+ - 2: モデル名 (例: `account`, `note`)
+ - モデルではないものも含む (例: `follow` ).
+ - タイムラインの場合はタイムライン種別名とする (例: `home`, `conversation`)
+ - 3: アクション名
+- これらは以下で示す型で表現できる形式に従って結合される.
+
+```ts
+type PolicyAction = `${PolicyName}.${ModelName}:${ActionName}`;
+```
+
+- `withCheck` メソッドは,PolicyAction
+ のポリシー名が自分が管理するものでない場合,エラーを返す.
diff --git a/src/content/docs/spec/endpoint.md b/src/content/docs/spec/endpoint.md
new file mode 100644
index 0000000..4e0fa05
--- /dev/null
+++ b/src/content/docs/spec/endpoint.md
@@ -0,0 +1,177 @@
+---
+title: "APIについて"
+---
+
+`main` ブランチの最新 API リファレンスは
+[api.pulsate.dev/reference](https://api.pulsate.dev/reference) で閲覧可能.
+
+## APIのバージョニング
+
+APIの規定パス(Base Path)は `/api/v0` である.
+
+APIのバージョンは以下の通り.
+
+| バージョン | ステータス |
+| ---------- | ---------- |
+| v0 | 策定途中 |
+
+## 資格情報が必要なエンドポイントの実行方法
+
+Pulsate v0 APIでは殆どのエンドポイントで資格情報が必要である.
+
+資格情報が必要なエンドポイントへアクセスするためには,
+以下の方法でエンドポイントにアクセスする必要がある.
+
+エンドポイントへアクセスするときの`Authorization` HTTPヘッダーに
+
+```text
+Bearer
+```
+
+の形式で [認証トークン](/spec/model/#認証トークン) をつけて送信する必要がある.
+
+例:
+
+```text
+Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
+```
+
+**資格情報が必要ないエンドポイントについて** Pulsate v0
+APIでは、資格情報が必要なエンドポイントであっても、資格情報がない場合にアクセス可能なエンドポイントが存在する。\
+例えば、あるアカウントのタイムラインを取得するエンドポイントの場合:
+
+- 有効な資格情報がある場合
+ - フォローしている場合は FOLLOWER 公開範囲の投稿も返す
+ - フォローしていない場合は資格情報がない場合と変わらない
+- **資格情報が無効な場合**
+ - 認証トークンが期限切れや改ざんされている場合
+ - 認証エラーを返す
+- 資格情報がない場合
+ - `Authorization`ヘッダーが空の場合
+ - PUBLIC/HOME 公開範囲の投稿を返す
+
+## “文字数”の扱い
+
+特に明記しない限り、文字数は **以下のコードを実行して計算できる文字数** とする.
+
+```ts
+const count = (s: string) => {
+ const segmenter = new Intl.Segmenter("ja-JP", { granularity: "grapheme" });
+ return [...segmenter.segment(s)].length;
+};
+```
+
+このAPIを実装する実行環境のリストはMDNを参照せよ.
+
+[Intl.Segmenter - JavaScript | MDN](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#ブラウザーの互換性)
+
+## “時刻/時間”の扱い
+
+特に明記しない限り、システム上の時刻の扱いは以下の通りである.
+
+- 日時は例外なくタイムゾーンをUTCとして扱う
+- 時刻のフォーマットは ISO 8601 とする.
+ - `"yyyy-MM-DDTHH:mm:ss.SSSZ"`形式
+ - タイムゾーン指定されていた場合は指定したタイムゾーンの日時をUTCに変換する.
+ - 例:
+ - `2023-11-21T09:00:00.000+09:00` : 日本時間(JST, UTC+9)
+ 2023年11月21日09:00:00.000 → `2023-11-21T00:00:00.000Z` :
+ 世界協定時(UTC) 2023年11月21日00:00:00.000
+ - 以上の形式に合致しない形で日時の表現がされた場合はエラー終了するものとする.
+
+## 絵文字の扱い
+
+絵文字とは, Unicodeによって定義される絵文字とカスタム絵文字のことである.
+
+その他の記号や環境依存文字は絵文字ではないとする.
+
+### Unicode絵文字
+
+Unicode絵文字とは,Unicodeによって定義される絵文字である.
+
+APIとやり取りするテキストデータでは特殊な記法を用いずUnicodeで表現する.
+
+例:
+
+```json
+{
+ "content": "🎉"
+}
+```
+
+### カスタム絵文字
+
+カスタム絵文字を文字列内に埋め込むための形式は以下の通りである.
+
+以下の形式に沿わない場合は単なる文字列であると解釈する.
+
+- 全体を`<>` で囲む
+ - カスタム絵文字のエイリアスは`::`で囲む
+ - カスタム絵文字に関する詳細な定義はここでは行わない. (ToDo)
+- エイリアスのあとに(絵文字があるインスタンスではなく,APIを提供するインスタンスでの)カスタム絵文字のIDを表記する.
+
+例:
+
+```md
+<:alias:2949583895994> <:ii_hanashi:284745363>
+```
+
+## 特殊なテキスト埋め込みオブジェクト
+
+投稿本文, CW注釈, アカウントbio のテキスト内にカスタム絵文字やメンションなど,
+Unicodeで規定された文字以外のデータを表現するときの記法
+
+カスタム絵文字は [カスタム絵文字](#カスタム絵文字) を参照せよ.
+
+### メンション
+
+表記法は以下の通り
+
+- メンションは`<>`で囲む
+- 囲んだ中にアカウント名を入れる
+ - [RFC 7565で規定される形式](https://datatracker.ietf.org/doc/htmlrfc7565#:~:text=labels%0A%20%20%20%20%20%20%5BRFC5890%5D.-,7,-%20%20IANA%20Considerations%0A%0A%20%20%20In)
+ のスキームである`acct:`を取り除き, `@`に置き換えたもの
+ - 例: アカウント名が `@john@example.com`である場合
+
+```text
+<@john@example.com>
+```
+
+- 宛先のホスト名(FQDN)は **省略不可**
+
+```text
+<@john@example.com> <@la@mi.growthers.dev> <@gargon@mastodon.social>
+```
+
+### 基本エラーオブジェクト
+
+APIにおいて何らかのエラーが発生した際には以下のようなエラーオブジェクトを返却する.
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+errorの中には`エラーコード` が入る.
+エラーコードはエラーを返却するAPIのエンドポイントでどのようなコードを返すか指定するものとする.
+
+エラーオブジェクトはエラーコードのみをメンバーとして含むオブジェクトである.
+
+エラーコード以外の情報をエラーオブジェクトとして返却することは許容されない.
+
+## NSFWフラグ
+
+言葉の意味:
+
+> **NSFW**とは、英語圏で用いられるインターネットスラングで、「職場では見ない方がいい」(職場での閲覧は危険)という意味の略語である。日本語の「閲覧注意」におおむね相当する。
+>
+> NSFWは画像がメインの掲示板や、掲示板中の画像へのリンクなどに付けて用いられやすい。たいていは卑猥(エロ画像)・残酷(グロ画像)といった要素の強い、不用意な閲覧ははばかられる類のコンテンツが掲載されている。
+
+- NSFWフラグとは,画像/音声/動画の内容がNSFWであることを示すためのフラグである.
+- 大抵の場合画像/音声/動画にぼかし(ブラー)がかけられたり,閲覧注意の文言が(システムのUI上で)表示される.
+
+## ContentsWarning/CWフラグ
+
+- CWフラグとは,投稿本文に何らかのコンテンツ警告があることを示すフラグである.
+- 大抵の場合,投稿の注釈(投稿本文より短い,本文の内容を端的に表した文)のみが表示され,本文は[続きを読む]といったボタンを押さないと見ることができない
diff --git a/src/content/docs/spec/endpoint/account.md b/src/content/docs/spec/endpoint/account.md
new file mode 100644
index 0000000..9f2a74c
--- /dev/null
+++ b/src/content/docs/spec/endpoint/account.md
@@ -0,0 +1,793 @@
+---
+title: "アカウントAPI"
+---
+
+## `POST /accounts`
+
+新規アカウントを作成する
+正確には登録中の状態のアカウントを作成し,アカウント登録スキームを開始するものである.
+
+### 入力
+
+body: `application/json`
+
+| 項目名 | 型 | 制約/説明 | 文字数制約 | 例 |
+| ------------- | -------- | ----------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------- |
+| name | `string` | 文字は `A-Z` `a-z` `0-9` `-` `.` `_`である必要がある. 先頭,及び最後の文字は `A-Z a-z 0-9` のみとする. | 1 ≤ N ≤ 64 [文字] | `john` ※登録される情報は`@john@example.com` |
+| email | `string` | メールアドレスとして正しい形式 (メールアドレスを受信可能であるかは問わない) | 7≤N≤319[文字] | `johndoe@example.com` |
+| passphrase | `string` | スペース,タブ,全角スペース,改行,ヌルを除くUTF-8文字列 | 8≤N≤512[文字] | `じゃすた・いぐざんぽぅ`, `just~@_examp1e!` |
+| captcha_token | `string` | [Cloudflare Turnstile](https://www.cloudflare.com/products/turnstile/) などの手動操作検証のトークン | | |
+
+### 入力例
+
+```json
+{
+ "name": "example",
+ "email": "foo@example.com",
+ "passphrase": "じゃすた・いぐざんぽぅ",
+ "captcha_token": "hogehogehgoe"
+}
+```
+
+### 出力
+
+**`200 OK`**
+
+```json
+{
+ "id": "38477395",
+ "name": "example",
+ "email": "foo@example.com"
+}
+```
+
+body: `application/json`
+
+| 項目名 | 型 | 説明 | 文字数 | 例 |
+| ------ | ----------- | --------------------------------------------------------------------------- | ------------- | ---------------------- |
+| id | `snowflake` | アカウントのID | - | `30848577730000` |
+| name | `string` | ユーザー名 | 8≤N≤512[文字] | `@johndoe@example.com` |
+| email | `string` | メールアドレスとして正しい形式 (メールアドレスを受信可能であるかは問わない) | 7≤N≤319[文字] | `john@example.com` |
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `INVALID_ACCOUNT_NAME`:
+ 使用できない文字が含まれている,文字の使用制限に違反している
+- `TOO_LONG_ACCOUNT_NAME`: アカウント名が長すぎる
+- `EMAIL_IN_USE`: メールアドレスが既に使用されている
+- `YOU_ARE_BOT`: captcha_token の検証に失敗した
+
+**`409 Conflict`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NAME_IN_USE`: アカウント名が既に使用されている
+- `EMAIL_IN_USE` : メールアドレスが既に使用されている
+
+## `PATCH /accounts/{account_name}`
+
+アカウント情報を指定のパラメータで編集するエンドポイント.
+
+入力の body から次の情報のいずれか 1
+つ以上を受け付け、それらを同時に適用できるかを検証し,反映する.
+
+競合を防ぐために「更新前のニックネームと更新前のメールアドレスを結合した文字列」のハッシュを
+[ETag (Entity Tag)](https://developer.mozilla.org/ja/docs/Web/HTTP/Headers/ETag)
+として用いる.
+
+これをMD5でハッシュするものとする.
+
+メールアドレスを更新した場合はそのメールアドレスの確認スキームが開始される.
+
+そしてそのメールアドレスが確認されるまで,メールアドレスの更新処理は遅延される.
+
+ニックネームも同時に更新した場合,ニックネームの更新は先に反映される.
+
+:::caution
+ETag が一致しないときは 412 Precondition Failed のエラーとなる. 結合方法は
+`更新前のニックネーム:更新前のメールアドレス`である
+:::
+
+### 入力
+
+- body: `application/json`
+
+| 項目名 | 型 | 制約/説明 | 文字数制約 | 例 |
+| ------------- | -------- | ----------------------------------------------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------- |
+| name | `string` | 文字は `A-Z` `a-z` `0-9` `-` `.` `_`である必要がある. 先頭,及び最後の文字は `A-Z a-z 0-9` のみとする. | 1 ≤ N ≤ 64 [文字] | `john` ※登録される情報は`@john@example.com` |
+| email | `string` | メールアドレスとして正しい形式 (メールアドレスを受信可能であるかは問わない) | 7≤N≤319[文字] | `johndoe@example.com` |
+| passphrase | `string` | スペース,タブ,全角スペース,改行,ヌルを除くUTF-8文字列 | 8≤N≤512[文字] | `じゃすた・いぐざんぽぅ`, `just~@_examp1e!` |
+| captcha_token | `string` | [Cloudflare Turnstile](https://www.cloudflare.com/products/turnstile/) などの手動操作検証のトークン | | |
+| bio | `string` | 自己紹介文. 0文字である場合は`null`や`undefined`ではなく空の文字列`""`である必要がある. | 0≤N≤1024 | `""` (空文字列), `いい感じの自己紹介🆓`, `This is bio hello^~ <:javascript:358409384>` |
+
+### 入力例
+
+```json
+{
+ "nickname": "example",
+ "email": "foo@example.com",
+ "passphrase": "じゃすた・いぐざんぽぅ",
+ "bio": "テストユーザーなのぜ"
+}
+```
+
+### 出力
+
+**`200 OK`**
+
+編集に成功しました.
+
+```json
+{
+ "id": "38477395",
+ "name": "@john@example.com",
+ "nickname": "John Doe",
+ "bio": "テストユーザーなのぜ",
+ "email": "foo@example.com"
+}
+```
+
+| 項目名 | 型 | 説明 | 文字数 | 例 |
+| ---------------- | ----------- | --------------------------------------------------------------------------- | ------------- | ----------------------------- |
+| id | `snowflake` | アカウントのID | - | `30848577730000` |
+| name | `string` | ユーザー名 | 8≤N≤512[文字] | `@johndoe@example.com` |
+| email | `string` | メールアドレスとして正しい形式 (メールアドレスを受信可能であるかは問わない) | 7≤N≤319[文字] | `john@example.com` |
+| nickname | `string` | 表示名,アカウントの表示に用いる短い文字列 | 1≤N≤256 | `JohnDoe<:json:299384730049>` |
+| `ジョン・ドゥ🚉` | | | | |
+
+**`202 Accepted`**
+
+メールアドレスが更新された場合
+
+```json
+{
+ "id": "38477395",
+ "name": "@john@example.com",
+ "nickname": "John Doe",
+ "bio": "テストユーザーなのぜ",
+ "email": "foo@example.com"
+}
+```
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `INVALID_SEQUENCE`: パラメータ内に使用不可能な文字種を含んでいる
+- `VULNERABLE_PASSPHRASE`:
+ 新しいパスフレーズがパスフレーズとしての要件を満たしていない
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: 名前が `account_name` のアカウントが見つからない
+
+**`412 Precondition Failed`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `INVALID_ETAG`: ETagが不正である
+
+## `PUT /accounts/{account_name}/freeze`
+
+アカウントを凍結するエンドポイント.
+
+モデレータ以上の権限を持つアカウント認証情報が必要である.
+
+凍結されると以下のような挙動になる.
+
+- ログインできなくなる.
+ - ログインしようとするとエラー終了する.
+- 投稿できなくなる.
+- (公開APIを除く)いかなるAPIへの操作も受け付けなくなる.
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - アカウント名
+- body: `application/json`
+ - 空のオブジェクトを送信せよ.
+ - 空でない場合のメンバーは無視される.
+
+### 入力例
+
+```json
+{}
+```
+
+### 出力
+
+**`204 No Content`**
+
+凍結が完了した.
+
+※レスポンスボディは空になる.
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ALREADY_FROZEN`: すでに凍結済みである.
+
+**`403 Forbidden`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `NO_PERMISSION`: アカウントを凍結できる権限がない.
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: アカウントが見つからない.
+
+## `DELETE /accounts/{account_name}/freeze`
+
+アカウントを凍結解除する(解凍と表記することもある).
+
+モデレータ以上の権限の持つアカウント認証情報が必要.
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - アカウント名
+- body: `application/json`
+ - 空のオブジェクトを送信せよ.
+ - 空でない場合のメンバは無視される.
+
+### 入力例
+
+```json
+{}
+```
+
+### 出力
+
+**`204 No Content`**
+
+凍結解除した.
+
+※レスポンスボディは空になる.
+
+**`403 Forbidden`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `NO_PERMISSION`: アカウントを凍結解除できる権限がない.
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: アカウントが見つからない.
+
+## `POST /accounts/{account_name}/resend_verify_email`
+
+メールアドレスの検証コードを再送
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - アカウント名
+
+body: `application/json`
+
+| 項目名 | 型 | 制約/説明 | 文字数 | 例 |
+| ------------- | -------- | -------------------------------------- | ------ | -- |
+| captcha_token | `string` | Cloudflare Trunstileなどの検証トークン | | |
+
+### 入力例
+
+```json
+{
+ "captcha_token": "hogehogehgoe"
+}
+```
+
+### 出力
+
+**`204 No Content`**
+
+再送した
+
+※レスポンスボディは空になる.
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_ALREADY_VERIFIED`: アカウントのメールアドレスはすでに検証されている.
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: アカウントが見つからない
+
+## `POST /accounts/{account_name}/verify_email`
+
+メールアドレス認証が終了していないアカウントに対して,
+
+メールアドレスに送信された認証トークンを検証することでメールアドレス認証を行う.
+
+処理が完了すると,検証済みアカウントになりログインなどの各種操作が行えるようになる(ToDo
+行うことのできる操作の一覧へのリンク
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - アカウント名
+- body: `application/json`
+
+| 項目名 | 型 | 制約/説明 | 文字数 | 例 |
+| ------ | -------- | ------------------------------------------ | ------ | -- |
+| token | `string` | 認証トークン: [モデル](/spec/model/) を参照 | | |
+
+### 入力例
+
+```json
+{
+ "token": "vq34rvyanho10q9hbc98ydbvaervna43r0varhj"
+}
+```
+
+### 出力
+
+**`204 No Content`**
+
+検証に成功
+
+※ レスポンスボディは空になります
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `INVALID_TOKEN`: トークンの検証に失敗.
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: 指定した名前のアカウントは存在しない.
+
+## `POST /login`
+
+ログインして認証/更新トークンを作成します.
+
+:::caution
+認証トークンの有効期限は15分(900秒),
+更新トークンの有効期限は30日(2,592,000秒)である.
+どちらのトークンも,APIサーバーが再起動されると無効になり,その場合は再度ログインする必要がある.
+:::
+
+### 入力
+
+- body: `application/json`
+
+| 項目名 | 型 | 制約/説明 | 文字数 | 例 |
+| ------------- | -------- | -------------------------------------- | ------------- | ------------------------------------------- |
+| name | `string` | アカウント名 | 8≤N≤512[文字] | `@johndoe@example.com` |
+| passphrase | `string` | パスフレーズ | 8≤N≤512 | `じゃすた・いぐざんぽぅ`, `just~@_examp1e!` |
+| captcha_token | `string` | Cloudflare Trunstileなどの検証トークン | | |
+
+### 入力例
+
+```json
+{
+ "name": "@john@example.com",
+ "passphrase": "じゃすた・いぐざんぽぅ",
+ "captcha_token": "hogehogehoge"
+}
+```
+
+### 出力
+
+**`200 OK`**
+
+ログインしました
+
+```json
+{
+ "authorization_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJzdWIiOiIzZTE2NDQ4MzMwMDAwMDIiLCJpYXQiOjE2NDA5OTUyMDEsInJlZnJlc2hfdG9rZW4iOiJleUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKemRXSWlPaUl6WlRFMk5EUTR Nek13TURBd01ESWlMQ0pwWVhRaU9qRTJOREE1T1RVeU1ERjkud2Q4cWJVcWowWGtCU1hud0FxM0lRYU1nQS1RTFd2MHVKU1NLX3BIVTZCYyJ9.mRUfLIYOGlLuC9D72zBriVvrHYrQgVHW7ntQ-bp5SHs",
+ "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJzdWIiOiIzZTE2NDQ4MzMwMDAwMDIiLCJpYXQiOjE2NDA5OTUyMDEsInJlZnJlc2hfdG9rZW4iOiJleUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKemRXSWlPaUl6WlRFMk5EUTR Nek13TURBd01ESWlMQ0pwWVhRaU9qRTJOREE1T1RVeU1ERjkud2Q4cWJVcWowWGtCU1hud0FxM0lRYU1nQS1RTFd2MHVKU1NLX3BIVTZCYyJ9.mRUfLIYOGlLuC9D72zBriVvrHYrQgVHW7ntQ-bp5SHs",
+ "expires_in": 1672498800
+}
+```
+
+| 項目名 | 型 | 制約/説明 | 文字数 | 例 |
+| ------------------- | -------- | ------------------------------------------------------------------- | ------ | -- |
+| authorization_token | `string` | 認証トークン | | |
+| refresh_token | `string` | 更新トークン | | |
+| expires_in | `number` | 有効期限. Pulsate Epochからの秒数: [モデル](/spec/model/#id) を参照. | | |
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `FAILED_TO_LOGIN`: パスフレーズかアカウント名が間違っている
+- `YOU_ARE_BOT`: captchaトークンの検証に失敗
+
+**`403 Forbidden`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `YOU_ARE_FROZEN`: ログインしようとしたアカウントは凍結されている
+
+## `POST /refresh`
+
+更新トークンで認証トークンを再発行
+
+### 入力
+
+- body: `application/json`
+ - `refresh_token`: `string`
+ - 更新トークン
+
+| 項目名 | 型 | 制約/説明 | 文字数 | 例 |
+| ------------- | -------- | -------------------------------- | ------ | -- |
+| refresh_token | `string` | 更新トークン [参照](/spec/model/) | | |
+
+### 入力例
+
+```json
+{
+ "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIzZTE2NDQ4MzMwMDAwMDIiLCJpYXQiOjE2NDA5OTUyMDEsInJlZnJlc2hfdG9rZW4iOiJleUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKemRXSWlPaUl6WlRFMk5EUTRNek13TURBd01ESWlMQ0pwWVhRaU9qRTJOREE1T1RVeU1ERjkud2Q4cWJVcWowWGtCU1hud0FxM0lRYU1nQS1RTFd2MHVKU1NLX3BIVTZCYyJ9.mRUfLIYOGlLuC9D72zBriVvrHYrQgVHW7ntQ-bp5SHs"
+}
+```
+
+### 出力
+
+**`200 OK`**
+
+ログインに成功した
+
+```json
+{
+ "authorization_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIzZTE2NDQ4MzMwMDAwMDIiLCJpYXQiOjE2NDA5OTUyMDEsInJlZnJlc2hfdG9rZW4iOiJleUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKemRXSWlPaUl6WlRFMk5EUTRNek13TURBd01ESWlMQ0pwWVhRaU9qRTJOREE1T1RVeU1ERjkud2Q4cWJVcWowWGtCU1hud0FxM0lRYU1nQS1RTFd2MHVKU1NLX3BIVTZCYyJ9.mRUfLIYOGlLuC9D72zBriVvrHYrQgVHW7ntQ-bp5SHs"
+}
+```
+
+| 項目名 | 型 | 制約/説明 | 文字数 | 例 |
+| -------------------------- | -------- | ------------ | ------ | -- |
+| autorization_token | `string` | 認証トークン | | |
+| [共通](/spec/model/) を参照 | | | | |
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `INVALID_TOKEN`: 更新トークンが不正
+- `EXPIRED_TOKEN`: トークンの有効期限切れ
+
+## `GET /accounts/{account_name}`
+
+アカウント情報を取得
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - アカウント名
+
+### 出力
+
+**`200 OK`**
+
+取得に成功
+
+```json
+{
+ "id": "2874987398",
+ "name": "@john@example.com",
+ "nickname": "John Doe",
+ "bio": "I am Test User.",
+ "avatar": "https://example.com/images/avatar.png",
+ "header": "https://example.com/images/header.png",
+ "followed_count": 200,
+ "following_count": 10,
+ "note_count": 20000
+}
+```
+
+| 項目名 | 型 | 制約/説明 | 文字数 | 例 |
+| --------------- | ----------- | --------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------- |
+| id | `snowflake` | アカウントID | | `2934002842` |
+| name | `string` | アカウント名 | 8≤N≤512[文字] | `@johndoe@example.com` |
+| nickname | `string` | 表示名,アカウントの表示に用いる短い文字列 | 1≤N≤256 | `JohnDoe<:json:299384730049>`, `ジョン・ドゥ🚉` |
+| bio | `string` | 自己紹介文. 0文字である場合はnullやundefinedではなくからの文字列である必要がある. | 0≤N≤1024 | `""` (空文字列), `いい感じの自己紹介🆓`,`This is bio hello^~ <:javascript:358409384>` |
+| avatar | `string` | アカウントのアイコン画像のURL | | |
+| header | `string` | アカウントのヘッダー画像のURL | | |
+| followed_count | `number` | そのアカウントをフォローしている人数 | | |
+| following_count | `number` | そのアカウントがフォローしている人数 | | |
+| note_count | `number` | そのアカウントの投稿数 | | |
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: 指定した名前のアカウントは存在しない
+
+## `PUT /accounts/{account_name}/silence`
+
+アカウントをサイレンスする.モデレータ以上の権限を持つアカウント認証情報が必要.
+
+サイレンスされると以下のような挙動になる.
+
+- 公開投稿(投稿範囲が`public`になる投稿)ができなくなる
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - アカウント名
+- body: `application/json`
+ - ボディは空オブジェクトである必要がある.
+ - 空でない場合,メンバは無視される.
+
+### 入力例
+
+```json
+{}
+```
+
+### 出力
+
+**`204 No Content`**
+
+凍結に成功
+
+※レスポンスボディは空になる.
+
+**`403 Forbidden`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `NO_PERMISSION`: アカウントをサイレンスできる権限がない.
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: 指定した名前のアカウントは存在しない.
+
+## `DELETE /accounts/{account_name}/silence`
+
+アカウントをサイレンス解除
+
+モデレータ以上の権限の持つアカウント認証情報が必要.
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - アカウント名
+- body: `application/json`
+ - オブジェクトは空である必要がある.
+ - 空でない場合,メンバは無視される.
+
+### 入力例
+
+```json
+{}
+```
+
+### 出力
+
+**`204 No Content`**
+
+サイレンスを解除
+
+※レスポンスボディは空になる.
+
+**`403 Forbidden`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `NO_PERMISSION`: アカウントをサイレンス解除できる権限がない
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: 指定した名前のアカウントは存在しない
+
+## `POST /accounts/{account_name}/follow`
+
+指定したアカウントをフォロー
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - フォローしたいアカウント名
+- body: `application/json`
+ - 空オブジェクトを送信せよ
+ - 空でない場合のメンバは無視される
+
+### 入力例
+
+```json
+{}
+```
+
+### 出力
+
+**`201 Accepted`**
+
+フォローを受け付けた
+
+```json
+{
+ "pending": true
+}
+```
+
+- フォローする相手がフォローを手動承認制にしている場合はpendingがtrueになる.
+ - フォローする相手がフォローを手動承認制にしていない場合もある.
+ - この場合はpendingは必ず`false`になる.
+- v2以降の予定:
+ フォローする相手が同じインスタンスに所属していない場合はすべての場合でpendingがtrueになる.
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ALREADY_FOLLOWING`: アカウントをすでにフォローしている
+- `YOU_ARE_BLOCKED`: 相手にブロックされている
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: 指定した名前のアカウントは存在しない.
+
+## `DELETE /accounts/{account_name}/follow`
+
+フォローを解除します
+
+### 入力
+
+- パスパラメータ
+ - `account_name`: `string`
+ - フォロー解除したいアカウント名
+- body: `application/json`
+ - リクエストボディは空オブジェクトを送信せよ.
+ - 空でない場合のメンバは無視される.
+
+### 入力例
+
+```json
+{}
+```
+
+### 出力
+
+**`204 No Content`**
+
+フォローを解除した.
+
+※レスポンスボディは空になる.
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `YOU_`ARE_NOT`_FOLLOW_ACCOUNT`: 指定したアカウントをフォローしていない
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: 指定した名前のアカウントは存在しない
diff --git a/src/content/docs/spec/endpoint/drive.md b/src/content/docs/spec/endpoint/drive.md
new file mode 100644
index 0000000..189aa00
--- /dev/null
+++ b/src/content/docs/spec/endpoint/drive.md
@@ -0,0 +1,286 @@
+---
+title: "ドライブAPI"
+---
+
+## `GET /drive`
+
+自分がアップロードした画像のリストを取得します
+
+### 入力
+
+なし
+
+### 出力
+
+#### **`200 OK`**
+
+```json
+[
+ {
+ "id": "2938492384",
+ "name": "image.jpeg",
+ "author_id": "384880009940302",
+ "hash": "nf9:e;g711*c@drgj55",
+ "mime": "image/jpeg",
+ "nsfw": false,
+ "url": "https://images.example.com/image.jpeg",
+ "thumbnail": "https://images.example.com/thumb-image.jpeg"
+ }
+]
+```
+
+| 項目名 | 型 | 説明 | 制約 | 例 |
+| --------- | --------------------- | ------------------------------------------- | ------------- | -- |
+| id | `snowflake` | ファイルのID | | |
+| name | `string` | ファイル名 | 1≤N≤256[文字] | |
+| author_id | `snowflake` | アップロードしたアカウントのID | | |
+| hash | `string` | 画像のblurhash | | |
+| mime | `string` | mimeタイプ | | |
+| nsfw | `boolean` | [NSFWフラグ](/spec/endpoint/#nsfwフラグ) | | |
+| url | `string` | 画像へのリンク | | |
+| thumbnail | `string`, `undefined` | (利用可能な場合のみ) 縮小版のサムネイル画像 | | |
+
+#### **`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `FILE_NOT_FOUND`: ファイルが存在しません
+
+## `POST /drive/`
+
+添付ファイルをアップロードします
+
+### 入力
+
+- body: `multipart/form-data`
+
+| 項目名 | 型 | 説明 | 制約 | 例 |
+| ------ | ------------------------------ | -------------------------------------------------------------- | ------------- | -------------------------- |
+| name | `string` | ファイル名拡張子が必須 | 1≤N≤256[文字] | `neko.png`, `箱根駅伝.mp3` |
+| file | (ファイルの実体) | アップロードするファイル. アップロード可能なファイル種類は後述 | 1≤100 [MB] | |
+| nsfw | `string` ( `"true", "false"` ) | [NSFWフラグ](/spec/endpoint/#nsfwフラグ) | | |
+
+
+アップロード可能なファイル種類(mimeタイプ) mimeタイプについて詳しくは [https://www.iana.org/assignments/media-types/media-types.xhtml](https://www.iana.org/assignments/media-types/media-types.xhtml) を参照
+
+画像:
+
+- `image/apng`
+- `image/avif`
+- `image/gif`
+- `image/jpeg`
+- `image/png`
+- `image/webp`
+
+音声、動画:
+
+- `audio/wave` , `audio/wav`
+- `audio/webm`
+- `audio/mpeg`
+- `video/mpeg`
+- `video/webm`
+- `audio/ogg`
+
+
+
+### 出力
+
+**`200 OK`**
+
+アップロードが完了しました.
+
+```json
+{
+ "id": "2938492384",
+ "name": "image.jpeg",
+ "author_id": "493094050",
+ "hash": "nf9:e;g711*c@drgj55",
+ "mime": "image/jpeg",
+ "nsfw": false,
+ "url": "https://images.example.com/image.jpeg",
+ "thumbnail": "https://images.example.com/thumb-image.jpeg"
+}
+```
+
+| 項目名 | 型 | 説明 | 制約 | 例 |
+| --------- | --------------------- | ------------------------------------------- | ------------- | -- |
+| id | `snowflake` | ファイルのID | | |
+| name | `string` | ファイル名 | 1≤N≤256[文字] | |
+| author_id | `snowflake` | アップロードしたアカウントのID | | |
+| hash | `string` | 画像のblurhash | | |
+| mime | `string` | mimeタイプ | | |
+| nsfw | `boolean` | [NSFWフラグ](/spec/endpoint/#nsfwフラグ) | | |
+| url | `string` | 画像へのリンク | | |
+| thumbnail | `string`, `undefined` | (利用可能な場合のみ) 縮小版のサムネイル画像 | | |
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `FILE_SIZE_TOO_BIG`: ファイルサイズが大きすぎます
+- `FILE_NAME_TOO_LONG`: ファイル名が長すぎます
+
+## `DELETE /drive/{file_id}`
+
+指定したファイルを削除します
+
+:::caution
+ファイルを削除すると,紐付けられているすべてのノートに影響します.
+:::
+
+### 入力
+
+- パスパラメータ
+ - `file_id`: `snowflake`
+ - ファイルのID
+
+### 出力
+
+**`204 No Content`**
+
+削除しました.
+
+※レスポンスボディは空になります.
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `FILE_NOT_FOUND`: ファイルが存在しません
+
+## `GET /drive/{file_id}`
+
+ファイルのメタ情報を取得します
+
+### 入力
+
+- パスパラメータ
+ - `file_id`: `snowflake`
+ - ファイルのID
+
+### 出力
+
+**`200 OK`**
+
+```json
+{
+ "id": "2938492384",
+ "name": "image.jpeg",
+ "author_id": "384880009940302",
+ "hash": "nf9:e;g711*c@drgj55",
+ "mime": "image/jpeg",
+ "nsfw": false,
+ "url": "https://images.example.com/image.jpeg",
+ "thumbnail": "https://images.example.com/thumb-image.jpeg"
+}
+```
+
+| 項目名 | 型 | 説明 | 制約 | 例 |
+| --------- | --------------------- | ------------------------------------------- | ------------- | -- |
+| id | `snowflake` | ファイルのID | | |
+| name | `string` | ファイル名 | 1≤N≤256[文字] | |
+| author_id | `snowflake` | アップロードしたアカウントのID | | |
+| hash | `string` | 画像のblurhash | | |
+| mime | `string` | mimeタイプ | | |
+| nsfw | `boolean` | [NSFWフラグ](/spec/endpoint/#nsfwフラグ) | | |
+| url | `string` | 画像へのリンク | | |
+| thumbnail | `string`, `undefined` | (利用可能な場合のみ) 縮小版のサムネイル画像 | | |
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `FILE_NOT_FOUND`: ファイルが存在しません
+
+## `PUT /drive/{file_id}`
+
+ファイルの情報を変更します
+
+:::caution
+情報を変更すると、そのファイルが紐付けられているすべてのノートに影響します
+:::
+
+### 入力
+
+- パスパラメータ
+ - `file_id`: `snowflake`
+ - ファイルのID
+
+- body: `application/json`
+
+| 項目名 | 型 | 説明 | 制約 | 例 |
+| ------ | --------- | --------------------------------------- | ---- | -- |
+| nsfw | `boolean` | [NSFWフラグ](/spec/endpoint/#nsfwフラグ) | | |
+
+**入力例**
+
+```json
+{
+ "nsfw": false
+}
+```
+
+### 出力
+
+**`200 OK`**
+
+```json
+{
+ "id": "2938492384",
+ "name": "image.jpeg",
+ "author_id": "384880009940302",
+ "hash": "nf9:e;g711*c@drgj55",
+ "mime": "image/jpeg",
+ "nsfw": false,
+ "url": "https://images.example.com/image.jpeg",
+ "thumbnail": "https://images.example.com/thumb-image.jpeg"
+}
+```
+
+| 項目名 | 型 | 説明 | 制約 | 例 |
+| --------- | --------------------- | ------------------------------------------- | ------------- | -- |
+| id | `snowflake` | ファイルのID | | |
+| name | `string` | ファイル名 | 1≤N≤256[文字] | |
+| author_id | `snowflake` | アップロードしたアカウントのID | | |
+| hash | `string` | 画像のblurhash | | |
+| mime | `string` | mimeタイプ | | |
+| nsfw | `boolean` | [NSFWフラグ](/spec/endpoint/#nsfwフラグ) | | |
+| url | `string` | 画像へのリンク | | |
+| thumbnail | `string`, `undefined` | (利用可能な場合のみ) 縮小版のサムネイル画像 | | |
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `FILE_NOT_FOUND`: ファイルが存在しません
+
+| 項目名 | 型 | 説明 | 制約 | 例 |
+| --------- | --------------------- | ------------------------------------------- | ------------- | -- |
+| id | `snowflake` | ファイルのID | | |
+| name | `string` | ファイル名 | 1≤N≤256[文字] | |
+| author_id | `snowflake` | アップロードしたアカウントのID | | |
+| hash | `string` | 画像のblurhash | | |
+| mime | `string` | mimeタイプ | | |
+| nsfw | `boolean` | [NSFWフラグ](/spec/endpoint/#nsfwフラグ) | | |
+| url | `string` | 画像へのリンク | | |
+| thumbnail | `string`, `undefined` | (利用可能な場合のみ) 縮小版のサムネイル画像 | | |
diff --git a/src/content/docs/spec/endpoint/list.md b/src/content/docs/spec/endpoint/list.md
new file mode 100644
index 0000000..922d807
--- /dev/null
+++ b/src/content/docs/spec/endpoint/list.md
@@ -0,0 +1,403 @@
+---
+title: "リストAPI"
+---
+
+## `POST /lists/`
+
+リストを作成します
+
+### 入力
+
+- body: `application/json`
+
+| 項目名 | 型 | 説明 | 制約 | 例 |
+| ------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -- |
+| title | `string` | リストのタイトル | 1≤N≤100[文字] | |
+| public | `boolean` | デフォルト: `false` (非公開) 公開: リストにアサインされたアカウントには通知が飛びます. 非公開: 通知は飛ばず、自分以外のアカウントからは見えません | | |
+
+### 入力例
+
+```json
+{
+ "title": "Pulsate Developers",
+ "public": false
+}
+```
+
+### 出力
+
+**`200 OK`**
+
+```json
+{
+ "id": "18342938400393",
+ "title": "Pulsate Developers",
+ "public": false
+}
+```
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `TITLE_TOO_LONG`: タイトルが長すぎます
+
+## `PATCH /lists/{list_id}`
+
+リスト情報を編集します
+
+### 入力
+
+- パスパラメータ
+ - `list_id`: `string`
+ - 編集したいリストのID
+
+- body: `application/json`
+
+| 項目名 | 型 | 説明 | 制約 |
+| ------ | --------- | -------------------- | ------------- |
+| title | `string` | リストのタイトル | 1≤N≤100[文字] |
+| public | `boolean` | 公開・非公開のフラグ | |
+
+### 入力例
+
+```json
+{
+ "title": "Edited Title",
+ "public": true
+}
+```
+
+### 出力
+
+**`200 OK`**
+
+```json
+{
+ "id": "18342938400393",
+ "title": "Edited Title",
+ "public": true,
+ "assignees": [
+ {
+ "id": "1838933554",
+ "name": "@john@example.com"
+ }
+ ]
+}
+```
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `LIST_NOTFOUND`: リストが見つかりません
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `TITLE_TOO_LONG`: タイトルが長すぎます
+
+## `GET /lists/{list_id}`
+
+リスト情報を取得します
+
+### 入力
+
+- パスパラメータ
+ - `list_id`: `string`
+ - 取得したいリストのID
+
+### 出力
+
+**`200 OK`**
+
+```json
+{
+ "id": "18342938400393",
+ "title": "Pulsate Developers",
+ "public": false,
+ "assignees": [
+ {
+ "id": "1838933554",
+ "name": "@john@example.com"
+ }
+ ]
+}
+```
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `LIST_NOTFOUND`: リストが見つかりません
+
+## `GET /lists/accounts/{account_id}`
+
+アカウントが持つリストを取得します
+
+### 入力
+
+- パスパラメータ
+ - `account_id`: `snowflake`
+ - アカウントのID
+
+### 出力
+
+**`200 OK`**
+
+```json
+[
+ {
+ "id": "18342938400393",
+ "title": "Pulsate Developers",
+ "public": false,
+ "assignees": [
+ {
+ "id": "1838933554",
+ "name": "@john@example.com"
+ }
+ ]
+ }
+]
+```
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND` : ユーザーが存在しません
+- `LIST_NOTFOUND`: リストが見つかりません
+
+## `POST /lists/{list_id}`
+
+リストにアカウントをアサインします
+
+### 入力
+
+- パスパラメータ
+ - `list_id`: `string`
+ - リストのID
+- body: `application/json`
+ - account_id: `Array<`snowflake`>`
+ - アカウントID
+ - 一度にアサインできる最大アカウント数: 30
+
+### 出力
+
+**`200 OK`**
+
+```json
+{
+ "account_id": [
+ "389384553329569",
+ "586039500493885",
+ "4847377595"
+ ]
+}
+```
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `TOO_MANY_TARGETS`: アサインするアカウント数が多すぎます
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: アカウントが存在しません
+- `LIST_NOTFOUND`: リストが見つかりません
+
+## `DELETE /lists/{list_id}`
+
+リストからアカウントを削除します
+
+### 入力
+
+- パスパラメータ
+ - `list_id`: `string`
+ - リストのID
+- body: `application/json`
+ - account_id: `Array<`snowflake`>`
+ - 削除するアカウントのID
+ - 一度に削除できるアカウント数: 30
+
+### 入力例
+
+```json
+{
+ "account_id": [
+ "389384553329569",
+ "586039500493885",
+ "4847377595"
+ ]
+}
+```
+
+### 出力
+
+**`204 No Content`**
+
+削除しました.
+
+※レスポンスボディは空になります.
+
+**`400 Bad Request`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `TOO_MANY_TARGETS` : 削除するアカウント数が多すぎます
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `ACCOUNT_NOT_FOUND`: アカウントが存在しません
+- `LIST_NOTFOUND`: リストが見つかりません
+
+## `DELETE /lists/{list_id}`
+
+リストを削除します.
+
+### 入力
+
+- パスパラメータ
+ - `list_id`: `string`
+ - リストのID
+
+### 出力
+
+**`204 No Content`**
+
+削除しました.
+
+※レスポンスボディは空になります.
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `LIST_NOTFOUND`: リストが見つかりません
+
+## `GET /lists/{list_id}/notes`
+
+リストのノートを取得します.
+
+### 入力
+
+- パスパラメータ
+ - `list_id`: `snowflake`
+ - リストのID
+- クエリパラメータ
+ - `has_attachment`: `bool | undefined`
+ - デフォルト: `false`
+ - ファイルを含む投稿のみを返します
+ - `no_nsfw` : `bool | undefined`
+ - デフォルト: `false`
+ - NSFWフラグの立っているファイルを含む投稿を返さなくなります
+ - `before_id` : ``snowflake`| undefined`
+ - デフォルト: `undefined`
+ - デフォルトでは現在取得できる最新の投稿から20件取得します.
+ - 指定したIDより古い投稿を返します.指定したIDの投稿は含まれません
+
+### 出力
+
+**`200 OK`**
+
+取得に成功しました
+
+```json
+[
+ {
+ "id": "3893974892",
+ "content": "hello world!",
+ "cw_comment": "",
+ "visibility": "public",
+ "created_at": "2023-09-27T14:17:29.169Z",
+ "attachment_files": [
+ {
+ "id": "204980348583",
+ "filename": "hello.png",
+ "content_type": "image/png",
+ "url": "https://example.com/images/hello.png",
+ "blur": "eoig:woi!our@nj/d",
+ "nsfw": false
+ }
+ ],
+ "reactions": [
+ {
+ "emoji": "<:alias:11938437>",
+ "reacted_by": "3085763644"
+ },
+ {
+ "emoji": "🎉",
+ "reacted_by": "494984128"
+ }
+ ],
+ "author": {
+ "id": "2874987398",
+ "name": "@john@example.com",
+ "display_name": "John Doe",
+ "bio": "I am Test User.",
+ "avatar": "https://example.com/images/avatar.png",
+ "header": "https://example.com/images/header.png",
+ "followed_count": 200,
+ "following_count": 10
+ }
+ }
+]
+```
+
+**`404 Not Found`**
+
+```json
+{
+ "error": "TEST_ERROR_CODE"
+}
+```
+
+- `LIST_NOTFOUND`: リストが見つかりません
+- `NOTHING_LEFT`: これ以上古い投稿はありません
+ - 1つでも古い投稿がある場合は投稿を返します
diff --git a/src/content/docs/spec/endpoint/notes.md b/src/content/docs/spec/endpoint/notes.md
new file mode 100644
index 0000000..08f062c
--- /dev/null
+++ b/src/content/docs/spec/endpoint/notes.md
@@ -0,0 +1,814 @@
+---
+title: "投稿API"
+---
+
+:::note
+投稿は”ノート”, 再投稿は”リノート”と言い換えられている場合があります.
+
+ダイレクト投稿: ノートのうち,公開範囲がダイレクトに指定されているもの
+:::
+
+## `POST /notes`
+
+ノートを作成
+
+### 入力
+
+- body: `application/json`
+
+| 項目名 | 型 | 制約/説明 | 数制約 | 例 |
+| ------------------- | ----------------------------- | ------------------------------------------------------------------------------------------ | ------------- | -- |
+| content | `string` | 投稿本文添付ファイルが存在する場合は0文字を許容 | 1≤3000[文字] | |
+| visibility | `string`, `undefined` | 投稿の公開範囲 デフォルト: `public` とり得る値: `public` `home` `followers`, `direct` | - | |
+| attachment_file_ids | `Array, undefined` | 投稿の添付ファイルID 1つでもファイルが存在しない場合はエラー終了する | 0≤N≤16[個] | |
+| cw_comment | `string` | CW時の注釈. [CW/CWフラグ](/spec/endpoint/#contentswarningcwフラグ) 参照デフォルトは空文字列 | 0≤N≤256[文字] | |
+| send_to | `snowflake`, `undefined` | ダイレクト投稿の宛先公開範囲が`direct`のときのみ指定可能 | | |
+
+### 入力例
+
+```json
+{
+ "content": "hello world!",
+ "visibility": "public",
+ "attachment_file_ids": [
+ "11938472"
+ ],
+ "cw_comment": ""
+}
+```
+
+```json
+{
+ "content": "hello world!",
+ "visibility": "direct",
+ "attachment_file_ids": [
+ "11938472"
+ ],
+ "cw_comment": "",
+ "send_to": "8585030584"
+}
+```
+
+### 出力
+
+**`201 Created`**
+
+投稿を作成しました.
+
+```json
+{
+ "id": "3893974892",
+ "content": "hello world!",
+ "cw_comment": "",
+ "visibility": "public",
+ "created_at": "2023-09-27T14:17:29.169Z",
+ "attachment_files": [
+ {
+ "id": "11938472",
+ "filename": "hello.png",
+ "content_type": "image/png",
+ "url": "https://example.com/images/hello.png",
+ "blur": "eoig:woi!our@nj/d",
+ "nsfw": false
+ }
+ ]
+}
+```
+
+| 項目名 | 型 | 説明 | 数制約 | 例 |
+| ---------------- | ---------------------- | -------------------------------------------------------------------------------------- | ------------- | -- |
+| id | `snowflake` | 投稿のID | | |
+| content | `string` | 投稿本文. 添付ファイルが存在する場合は0文字を許容 | 1≤3000[文字] | |
+| visibility | `string` | 投稿の公開範囲. デフォルト: `public`. とり得る値: `public` `home` `followers` `direct` | - | |
+| attachment_files | `Array