Attachments

APIs for uploading answer attachments and integrating with Misskey Drive. Pass the returned key to /api/v1/questions/:id/answer to bind the attachment to an answer.

Uploaded attachments that remain unbound to any answer for a certain period will be deleted automatically.

POST/api/v1/answers/attachments/upload

Upload an image from the device. The server compresses it to WebP and generates a BlurHash. Include the returned key in the attachments array of /api/v1/questions/:id/answer.

Authentication

questions:write

Request Body

Content-Type: multipart/form-data

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

Response

{
  "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

Import a file from the user's Misskey Drive. Response shape matches upload.

Authentication

questions:write

Request Body

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

Response

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

Proxy to Misskey Drive files list. Only image/* files are returned.

Authentication

questions:write

Query Parameters

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

Response

{
  "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,
  "nextUntilId": "<misskey file id>"   // next untilId (includes non-image files)
}
GET/api/v1/misskey/drive/folders

Proxy to Misskey Drive folders list. When folderId is given, current also contains that folder's details.

Authentication

questions:write

Query Parameters

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

Response

{
  "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
}