Misskey drive API

The drive API from Misskey — 18 operation(s) for drive.

OpenAPI Specification

misskey-drive-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: 2025.4.1-io.12b-fb6fbea074
  title: Misskey account drive API
servers:
- url: https://misskey.io/api
tags:
- name: drive
paths:
  /drive:
    post:
      operationId: post___drive
      summary: drive
      description: 'No description provided.


        **Credential required**: *Yes* / **Permission**: *read:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      responses:
        '200':
          description: OK (with results)
          content:
            application/json:
              schema:
                type: object
                properties:
                  capacity:
                    type: number
                  usage:
                    type: number
                required:
                - capacity
                - usage
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INVALID_PARAM:
                  value:
                    error:
                      message: Invalid param.
                      code: INVALID_PARAM
                      id: 3d81ceae-475f-4600-b2a8-2bc116157532
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CREDENTIAL_REQUIRED:
                  value:
                    error:
                      message: Credential required.
                      code: CREDENTIAL_REQUIRED
                      id: 1384574d-a912-4b81-8601-c7b1c4085df1
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AUTHENTICATION_FAILED:
                  value:
                    error:
                      message: Authentication failed. Please ensure your token is correct.
                      code: AUTHENTICATION_FAILED
                      id: b0a7f5f8-dc2f-4171-b91f-de88ad238e14
        '418':
          description: I'm Ai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                I_AM_AI:
                  value:
                    error:
                      message: You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
                      code: I_AM_AI
                      id: 60c46cd1-f23a-46b1-bebe-5d2b73951a84
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INTERNAL_ERROR:
                  value:
                    error:
                      message: Internal error occurred. Please contact us if the error persists.
                      code: INTERNAL_ERROR
                      id: 5d37dbcb-891e-41ca-a3d6-e690c97775ac
  /drive/files:
    post:
      operationId: post___drive___files
      summary: drive/files
      description: 'No description provided.


        **Credential required**: *Yes* / **Permission**: *read:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive/files.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 10
                sinceId:
                  type: string
                  format: misskey:id
                untilId:
                  type: string
                  format: misskey:id
                folderId:
                  type:
                  - string
                  - 'null'
                  format: misskey:id
                  default: null
                type:
                  type:
                  - string
                  - 'null'
                  pattern: ^[a-zA-Z\/\-*]+$
                sort:
                  type:
                  - string
                  - 'null'
                  enum:
                  - +createdAt
                  - -createdAt
                  - +name
                  - -name
                  - +size
                  - -size
                  - null
      responses:
        '200':
          description: OK (with results)
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  $ref: '#/components/schemas/DriveFile'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INVALID_PARAM:
                  value:
                    error:
                      message: Invalid param.
                      code: INVALID_PARAM
                      id: 3d81ceae-475f-4600-b2a8-2bc116157532
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CREDENTIAL_REQUIRED:
                  value:
                    error:
                      message: Credential required.
                      code: CREDENTIAL_REQUIRED
                      id: 1384574d-a912-4b81-8601-c7b1c4085df1
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AUTHENTICATION_FAILED:
                  value:
                    error:
                      message: Authentication failed. Please ensure your token is correct.
                      code: AUTHENTICATION_FAILED
                      id: b0a7f5f8-dc2f-4171-b91f-de88ad238e14
        '418':
          description: I'm Ai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                I_AM_AI:
                  value:
                    error:
                      message: You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
                      code: I_AM_AI
                      id: 60c46cd1-f23a-46b1-bebe-5d2b73951a84
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INTERNAL_ERROR:
                  value:
                    error:
                      message: Internal error occurred. Please contact us if the error persists.
                      code: INTERNAL_ERROR
                      id: 5d37dbcb-891e-41ca-a3d6-e690c97775ac
  /drive/files/attached-notes:
    post:
      operationId: post___drive___files___attached-notes
      summary: drive/files/attached-notes
      description: 'Find the notes to which the given file is attached.


        **Credential required**: *Yes* / **Permission**: *read:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sinceId:
                  type: string
                  format: misskey:id
                untilId:
                  type: string
                  format: misskey:id
                limit:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 10
                fileId:
                  type: string
                  format: misskey:id
              required:
              - fileId
      responses:
        '200':
          description: OK (with results)
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  $ref: '#/components/schemas/Note'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                NO_SUCH_FILE:
                  value:
                    error:
                      message: No such file.
                      code: NO_SUCH_FILE
                      id: c118ece3-2e4b-4296-99d1-51756e32d232
                INVALID_PARAM:
                  value:
                    error:
                      message: Invalid param.
                      code: INVALID_PARAM
                      id: 3d81ceae-475f-4600-b2a8-2bc116157532
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CREDENTIAL_REQUIRED:
                  value:
                    error:
                      message: Credential required.
                      code: CREDENTIAL_REQUIRED
                      id: 1384574d-a912-4b81-8601-c7b1c4085df1
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AUTHENTICATION_FAILED:
                  value:
                    error:
                      message: Authentication failed. Please ensure your token is correct.
                      code: AUTHENTICATION_FAILED
                      id: b0a7f5f8-dc2f-4171-b91f-de88ad238e14
        '418':
          description: I'm Ai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                I_AM_AI:
                  value:
                    error:
                      message: You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
                      code: I_AM_AI
                      id: 60c46cd1-f23a-46b1-bebe-5d2b73951a84
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INTERNAL_ERROR:
                  value:
                    error:
                      message: Internal error occurred. Please contact us if the error persists.
                      code: INTERNAL_ERROR
                      id: 5d37dbcb-891e-41ca-a3d6-e690c97775ac
  /drive/files/check-existence:
    post:
      operationId: post___drive___files___check-existence
      summary: drive/files/check-existence
      description: 'Check if a given file exists.


        **Credential required**: *Yes* / **Permission**: *read:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                md5:
                  type: string
              required:
              - md5
      responses:
        '200':
          description: OK (with results)
          content:
            application/json:
              schema:
                type: boolean
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INVALID_PARAM:
                  value:
                    error:
                      message: Invalid param.
                      code: INVALID_PARAM
                      id: 3d81ceae-475f-4600-b2a8-2bc116157532
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CREDENTIAL_REQUIRED:
                  value:
                    error:
                      message: Credential required.
                      code: CREDENTIAL_REQUIRED
                      id: 1384574d-a912-4b81-8601-c7b1c4085df1
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AUTHENTICATION_FAILED:
                  value:
                    error:
                      message: Authentication failed. Please ensure your token is correct.
                      code: AUTHENTICATION_FAILED
                      id: b0a7f5f8-dc2f-4171-b91f-de88ad238e14
        '418':
          description: I'm Ai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                I_AM_AI:
                  value:
                    error:
                      message: You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
                      code: I_AM_AI
                      id: 60c46cd1-f23a-46b1-bebe-5d2b73951a84
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INTERNAL_ERROR:
                  value:
                    error:
                      message: Internal error occurred. Please contact us if the error persists.
                      code: INTERNAL_ERROR
                      id: 5d37dbcb-891e-41ca-a3d6-e690c97775ac
  /drive/files/create:
    post:
      operationId: post___drive___files___create
      summary: drive/files/create
      description: 'Upload a new drive file.


        **Credential required**: *Yes* / **Permission**: *write:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive/files/create.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                folderId:
                  type:
                  - string
                  - 'null'
                  format: misskey:id
                  default: null
                name:
                  type:
                  - string
                  - 'null'
                  default: null
                comment:
                  type:
                  - string
                  - 'null'
                  maxLength: 512
                  default: null
                isSensitive:
                  type: boolean
                  default: false
                force:
                  type: boolean
                  default: false
                file:
                  type: string
                  format: binary
                  description: The file contents.
              required:
              - file
      responses:
        '200':
          description: OK (with results)
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/DriveFile'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INVALID_PARAM:
                  value:
                    error:
                      message: Invalid param.
                      code: INVALID_PARAM
                      id: 3d81ceae-475f-4600-b2a8-2bc116157532
                PROCESSING:
                  value:
                    error:
                      message: We are processing your request. Please wait a moment.
                      code: PROCESSING
                      id: b495d816-b077-4dc1-b135-7fde73fcca5e
                      httpStatusCode: 202
                INVALID_FILE_NAME:
                  value:
                    error:
                      message: Invalid file name.
                      code: INVALID_FILE_NAME
                      id: f449b209-0c60-4e51-84d5-29486263bfd4
                INAPPROPRIATE:
                  value:
                    error:
                      message: Cannot upload the file because it has been determined that it possibly contains inappropriate content.
                      code: INAPPROPRIATE
                      id: bec5bd69-fba3-43c9-b4fb-2894b66ad5d2
                NO_FREE_SPACE:
                  value:
                    error:
                      message: Cannot upload the file because you have no free space of drive.
                      code: NO_FREE_SPACE
                      id: d08dbc37-a6a9-463a-8c47-96c32ab5f064
                MAX_FILE_SIZE_EXCEEDED:
                  value:
                    error:
                      message: Cannot upload the file because it exceeds the maximum file size.
                      code: MAX_FILE_SIZE_EXCEEDED
                      id: b9d8c348-33f0-4673-b9a9-5d4da058977a
                      httpStatusCode: 413
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CREDENTIAL_REQUIRED:
                  value:
                    error:
                      message: Credential required.
                      code: CREDENTIAL_REQUIRED
                      id: 1384574d-a912-4b81-8601-c7b1c4085df1
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AUTHENTICATION_FAILED:
                  value:
                    error:
                      message: Authentication failed. Please ensure your token is correct.
                      code: AUTHENTICATION_FAILED
                      id: b0a7f5f8-dc2f-4171-b91f-de88ad238e14
        '418':
          description: I'm Ai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                I_AM_AI:
                  value:
                    error:
                      message: You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
                      code: I_AM_AI
                      id: 60c46cd1-f23a-46b1-bebe-5d2b73951a84
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                RATE_LIMIT_EXCEEDED:
                  value:
                    error:
                      message: Rate limit exceeded. Please try again later.
                      code: RATE_LIMIT_EXCEEDED
                      id: d5826d14-3982-4d2e-8011-b9e9f02499ef
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INTERNAL_ERROR:
                  value:
                    error:
                      message: Internal error occurred. Please contact us if the error persists.
                      code: INTERNAL_ERROR
                      id: 5d37dbcb-891e-41ca-a3d6-e690c97775ac
  /drive/files/delete:
    post:
      operationId: post___drive___files___delete
      summary: drive/files/delete
      description: 'Delete an existing drive file.


        **Credential required**: *Yes* / **Permission**: *write:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive/files/delete.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                fileId:
                  type: string
                  format: misskey:id
              required:
              - fileId
      responses:
        '204':
          description: OK (without any results)
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                NO_SUCH_FILE:
                  value:
                    error:
                      message: No such file.
                      code: NO_SUCH_FILE
                      id: 908939ec-e52b-4458-b395-1025195cea58
                ACCESS_DENIED:
                  value:
                    error:
                      message: Access denied.
                      code: ACCESS_DENIED
                      id: 5eb8d909-2540-4970-90b8-dd6f86088121
                INVALID_PARAM:
                  value:
                    error:
                      message: Invalid param.
                      code: INVALID_PARAM
                      id: 3d81ceae-475f-4600-b2a8-2bc116157532
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CREDENTIAL_REQUIRED:
                  value:
                    error:
                      message: Credential required.
                      code: CREDENTIAL_REQUIRED
                      id: 1384574d-a912-4b81-8601-c7b1c4085df1
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AUTHENTICATION_FAILED:
                  value:
                    error:
                      message: Authentication failed. Please ensure your token is correct.
                      code: AUTHENTICATION_FAILED
                      id: b0a7f5f8-dc2f-4171-b91f-de88ad238e14
        '418':
          description: I'm Ai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                I_AM_AI:
                  value:
                    error:
                      message: You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
                      code: I_AM_AI
                      id: 60c46cd1-f23a-46b1-bebe-5d2b73951a84
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INTERNAL_ERROR:
                  value:
                    error:
                      message: Internal error occurred. Please contact us if the error persists.
                      code: INTERNAL_ERROR
                      id: 5d37dbcb-891e-41ca-a3d6-e690c97775ac
  /drive/files/find:
    post:
      operationId: post___drive___files___find
      summary: drive/files/find
      description: 'Search for a drive file by the given parameters.


        **Credential required**: *Yes* / **Permission**: *read:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive/files/find.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                folderId:
                  type:
                  - string
                  - 'null'
                  format: misskey:id
                  default: null
              required:
              - name
      responses:
        '200':
          description: OK (with results)
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  $ref: '#/components/schemas/DriveFile'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INVALID_PARAM:
                  value:
                    error:
                      message: Invalid param.
                      code: INVALID_PARAM
                      id: 3d81ceae-475f-4600-b2a8-2bc116157532
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CREDENTIAL_REQUIRED:
                  value:
                    error:
                      message: Credential required.
                      code: CREDENTIAL_REQUIRED
                      id: 1384574d-a912-4b81-8601-c7b1c4085df1
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AUTHENTICATION_FAILED:
                  value:
                    error:
                      message: Authentication failed. Please ensure your token is correct.
                      code: AUTHENTICATION_FAILED
                      id: b0a7f5f8-dc2f-4171-b91f-de88ad238e14
        '418':
          description: I'm Ai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                I_AM_AI:
                  value:
                    error:
                      message: You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
                      code: I_AM_AI
                      id: 60c46cd1-f23a-46b1-bebe-5d2b73951a84
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INTERNAL_ERROR:
                  value:
                    error:
                      message: Internal error occurred. Please contact us if the error persists.
                      code: INTERNAL_ERROR
                      id: 5d37dbcb-891e-41ca-a3d6-e690c97775ac
  /drive/files/find-by-hash:
    post:
      operationId: post___drive___files___find-by-hash
      summary: drive/files/find-by-hash
      description: 'Search for a drive file by a hash of the contents.


        **Credential required**: *Yes* / **Permission**: *read:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                md5:
                  type: string
              required:
              - md5
      responses:
        '200':
          description: OK (with results)
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  $ref: '#/components/schemas/DriveFile'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INVALID_PARAM:
                  value:
                    error:
                      message: Invalid param.
                      code: INVALID_PARAM
                      id: 3d81ceae-475f-4600-b2a8-2bc116157532
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                CREDENTIAL_REQUIRED:
                  value:
                    error:
                      message: Credential required.
                      code: CREDENTIAL_REQUIRED
                      id: 1384574d-a912-4b81-8601-c7b1c4085df1
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                AUTHENTICATION_FAILED:
                  value:
                    error:
                      message: Authentication failed. Please ensure your token is correct.
                      code: AUTHENTICATION_FAILED
                      id: b0a7f5f8-dc2f-4171-b91f-de88ad238e14
        '418':
          description: I'm Ai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                I_AM_AI:
                  value:
                    error:
                      message: You sent a request to Ai-chan, Misskey's showgirl, instead of the server.
                      code: I_AM_AI
                      id: 60c46cd1-f23a-46b1-bebe-5d2b73951a84
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                INTERNAL_ERROR:
                  value:
                    error:
                      message: Internal error occurred. Please contact us if the error persists.
                      code: INTERNAL_ERROR
                      id: 5d37dbcb-891e-41ca-a3d6-e690c97775ac
  /drive/files/show:
    post:
      operationId: post___drive___files___show
      summary: drive/files/show
      description: 'Show the properties of a drive file.


        **Credential required**: *Yes* / **Permission**: *read:drive*'
      externalDocs:
        description: Source code
        url: https://github.com/MisskeyIO/misskey/blob/io/packages/backend/src/server/api/endpoints/drive/files/show.ts
      tags:
      - drive
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                fileId:
                  type: string
                  format: misskey:id
                url:
                  type: string
              anyOf:
              - required:
                - fileId
              - required:
                - url
      responses:
        '200':
          description: OK (with results)
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/DriveFile'
        '400':
          description: Client error
          content:
            application/json:
              schema:
              

# --- truncated at 32 KB (81 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/misskey/refs/heads/main/openapi/misskey-drive-api-openapi.yml