Mewk

添付ファイル

回答に添付する画像のアップロード API と、Misskey Drive 連携 API。アップロードした画像の key を回答 API に渡すことで紐付ける。

アップロード後、 一定期間回答と紐付かなかった添付ファイルは自動的に削除されます。

POST/api/v1/answers/attachments/upload

デバイスから画像をアップロードする。サーバ側で WebP 圧縮と BlurHash 生成が行われる。レスポンスの key を /api/v1/questions/:id/answer の attachments に含めることで回答に紐付く。

認証

questions:write

リクエストボディ

Content-Type: multipart/form-data

file: <image file>   // image/jpeg, image/png, image/webp, image/avif — max 15MB

レスポンス

{
  "attachment": {
    "key": "attachments/answer/<userId>/<uuid>.webp",
    "url": "https://<host.tld>/attachments/answer/...",
    "name": "image.jpg",
    "mimeType": "image/webp",
    "size": 12345,
    "blurhash": "L...",
    "width": 1024,
    "height": 768
  }
}
POST/api/v1/answers/attachments/import-from-drive

Misskey Drive 上のファイルを取り込む。レスポンス形式は upload と同じ。

認証

questions:write

リクエストボディ

{
  "fileId": "<misskey drive file id>"
}

レスポンス

{
  "attachment": { /* same as upload response */ }
}
GET/api/v1/misskey/drive/files

Misskey Drive のファイル一覧をプロキシ取得する。image/* のみ返す。

認証

questions:write

クエリパラメータ

folderId: string | null   // omit / empty for root
limit:    number          // default 50, max 100
untilId:  string          // optional pagination cursor

レスポンス

{
  "files": [
    {
      "id": "<misskey file id>",
      "name": "image.jpg",
      "type": "image/jpeg",
      "size": 12345,
      "url": "https://...",
      "thumbnailUrl": "https://...",
      "isSensitive": false,
      "folderId": null,
      "createdAt": "2026-05-19T..."
    }
  ],
  "hasMore": false
}
GET/api/v1/misskey/drive/folders

Misskey Drive のフォルダ一覧をプロキシ取得する。folderId 指定時は current にそのフォルダ詳細も返す。

認証

questions:write

クエリパラメータ

folderId: string | null   // omit / empty for root
limit:    number          // default 100, max 100
untilId:  string          // optional pagination cursor

レスポンス

{
  "folders": [
    {
      "id": "<misskey folder id>",
      "name": "mewk",
      "parentId": null,
      "createdAt": "2026-05-19T...",
      "foldersCount": 0,
      "filesCount": 4
    }
  ],
  "current": { /* current folder if folderId given, else null */ },
  "hasMore": false
}