PeerTube User Imports API

To import an archive of user data.

Operations 4

POST /api/v1/users/{userId}/imports/import-resumable Initialize the resumable user import #
PUT /api/v1/users/{userId}/imports/import-resumable Send chunk for the resumable user import #
DELETE /api/v1/users/{userId}/imports/import-resumable Cancel the resumable user import #
GET /api/v1/users/{userId}/imports/latest Get latest user import #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/peertube-user-imports-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

peertube-user-imports-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PeerTube User Imports API
  version: 8.1.0
  contact:
    name: PeerTube Community
    url: https://joinpeertube.org
  license:
    name: AGPLv3.0
    url: https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE
  x-logo:
    url: https://joinpeertube.org/img/brand.png
    altText: PeerTube Project Homepage
  description: The PeerTube API is built on HTTP(S) and is RESTful.
servers:
- url: https://peertube2.cpy.re
  description: Live Test Server (live data - latest nightly version)
- url: https://peertube3.cpy.re
  description: Live Test Server (live data - latest RC version)
- url: https://peertube.cpy.re
  description: Live Test Server (live data - stable version)
tags:
- name: User Imports
  description: To import an archive of user data.
paths:
  /api/v1/users/{userId}/imports/import-resumable:
    post:
      summary: Initialize the resumable user import
      description: '**PeerTube >= 6.1** Uses a resumable protocol to initialize the import of the archive'
      operationId: userImportResumableInit
      security:
      - OAuth2: []
      tags:
      - User Imports
      parameters:
      - $ref: '#/components/parameters/userId'
      - $ref: '#/components/parameters/resumableUploadInitContentLengthHeader'
      - $ref: '#/components/parameters/resumableUploadInitContentTypeHeader'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserImportResumable'
      responses:
        '201':
          description: created
          headers:
            Location:
              schema:
                type: string
                format: url
            Content-Length:
              schema:
                type: number
                example: 0
    put:
      summary: Send chunk for the resumable user import
      description: '**PeerTube >= 6.1** Uses a resumable protocol to continue, pause or resume the import of the archive'
      operationId: userImportResumable
      security:
      - OAuth2: []
      tags:
      - User Imports
      parameters:
      - $ref: '#/components/parameters/userId'
      - $ref: '#/components/parameters/resumableUploadId'
      - $ref: '#/components/parameters/resumableUploadChunkContentRangeHeader'
      - $ref: '#/components/parameters/resumableUploadChunkContentLengthHeader'
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '204':
          description: 'last chunk received: successful operation'
        '308':
          description: resume incomplete
          headers:
            Range:
              schema:
                type: string
                example: bytes=0-262143
            Content-Length:
              schema:
                type: number
                example: 0
    delete:
      summary: Cancel the resumable user import
      description: '**PeerTube >= 6.1** Uses a resumable protocol to cancel the resumable user import'
      operationId: userImportResumableCancel
      security:
      - OAuth2: []
      tags:
      - User Imports
      parameters:
      - $ref: '#/components/parameters/userId'
      - $ref: '#/components/parameters/resumableUploadId'
      - name: Content-Length
        in: header
        required: true
        schema:
          type: number
          example: 0
      responses:
        '204':
          description: import cancelled
          headers:
            Content-Length:
              schema:
                type: number
                example: 0
  /api/v1/users/{userId}/imports/latest:
    get:
      summary: Get latest user import
      description: '**PeerTube >= 6.1**'
      operationId: getLatestUserImport
      security:
      - OAuth2: []
      tags:
      - User Imports
      parameters:
      - $ref: '#/components/parameters/userId'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  state:
                    type: object
                    properties:
                      id:
                        $ref: '#/components/schemas/UserImportState'
                      label:
                        type: string
                  createdAt:
                    type: string
                    format: date-time
components:
  parameters:
    resumableUploadId:
      name: upload_id
      in: query
      required: true
      description: 'Created session id to proceed with. If you didn''t send chunks in the last hour, it is

        not valid anymore and you need to initialize a new upload.

        '
      schema:
        type: string
    resumableUploadInitContentLengthHeader:
      name: X-Upload-Content-Length
      in: header
      schema:
        type: number
        example: 2469036
      required: true
      description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading.
    userId:
      name: userId
      in: path
      required: true
      description: User id
      schema:
        $ref: '#/components/schemas/id'
    resumableUploadInitContentTypeHeader:
      name: X-Upload-Content-Type
      in: header
      schema:
        type: string
        format: mimetype
        example: video/mp4
      required: true
      description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary.
    resumableUploadChunkContentRangeHeader:
      name: Content-Range
      in: header
      schema:
        type: string
        example: bytes 0-262143/2469036
      required: true
      description: 'Specifies the bytes in the file that the request is uploading.


        For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first

        262144 bytes (256 x 1024) in a 2,469,036 byte file.

        '
    resumableUploadChunkContentLengthHeader:
      name: Content-Length
      in: header
      schema:
        type: number
        example: 262144
      required: true
      description: 'Size of the chunk that the request is sending.


        Remember that larger chunks are more efficient. PeerTube''s web client uses chunks varying from

        1048576 bytes (~1MB) and increases or reduces size depending on connection health.

        '
  schemas:
    UserImportResumable:
      properties:
        filename:
          description: Archive filename including extension
          type: string
          format: filename
          example: user-export-6-2024-02-09T10_12_11.682Z
    UserImportState:
      type: integer
      enum:
      - 1
      - 2
      - 3
      - 4
      description: "The user import state:\n  - `1`: Pending\n  - `2`: Processing\n  - `3`: Completed\n  - `4`: Errored\n"
    id:
      type: integer
      minimum: 1
      example: 42
  securitySchemes:
    OAuth2:
      description: 'Authenticating via OAuth requires the following steps:

        - Have an activated account

        - [Generate] an access token for that account at `/api/v1/users/token`.

        - Make requests with the *Authorization: Bearer <token\>* header

        - Profit, depending on the role assigned to the account


        Note that the __access token is valid for 1 day__ and is given

        along with a __refresh token valid for 2 weeks__.


        [Generate]: https://docs.joinpeertube.org/api/rest-getting-started

        '
      type: oauth2
      flows:
        password:
          tokenUrl: /api/v1/users/token
          scopes:
            admin: Admin scope
            moderator: Moderator scope
            user: User scope
externalDocs:
  url: https://docs.joinpeertube.org/api-rest-reference.html
x-tagGroups:
- name: Static endpoints
  tags:
  - Static Video Files
- name: Download
  tags:
  - Video Download
- name: Feeds
  tags:
  - Video Feeds
- name: Auth
  tags:
  - Register
  - Session
- name: Accounts
  tags:
  - Accounts
  - Users
  - User Exports
  - User Imports
  - My User
  - My Subscriptions
  - My Notifications
  - My History
- name: Videos
  tags:
  - Video
  - Video Upload
  - Video Imports
  - Video Captions
  - Video Chapters
  - Video Channels
  - Video Comments
  - Video Rates
  - Video Playlists
  - Video Stats
  - Ownership Change
  - Video Mirroring
  - Video Files
  - Video Transcoding
  - Live Videos
  - Channels Sync
  - Video Passwords
  - Video Embed Privacy
- name: Search
  tags:
  - Search
- name: Moderation
  tags:
  - Abuses
  - Video Blocks
  - Account Blocklist
  - Server Blocklist
  - Automatic Tags
  - Watched Words
- name: Instance
  tags:
  - Config
  - Client Config
  - Homepage
  - Instance Follows
  - Instance Redundancy
  - Plugins
  - Stats
  - Logs
  - Job
- name: Remote Jobs
  tags:
  - Runner Registration Token
  - Runner Jobs
  - Runners