6 name: PeerTube Community
7 url: 'https://joinpeertube.org'
10 url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE'
12 url: 'https://joinpeertube.org/img/brand.png'
15 The PeerTube API is built on HTTP(S). Our API is RESTful. It has predictable
16 resource URLs. It returns HTTP response codes to indicate errors. It also
17 accepts and returns JSON in the HTTP body. You can use your favorite
18 HTTP/REST library for your programming language to use PeerTube. No official
19 SDK is currently provided.
22 When you sign up for an account, you are given the possibility to generate
23 sessions, and authenticate using this session token. One session token can
24 currently be used at a time.
26 url: https://docs.joinpeertube.org/api.html
30 Using some features of PeerTube require authentication, for which Accounts
32 provide different levels of permission as well as associated user
35 Accounts also encompass remote accounts discovered across the federation.
38 Each server exposes public information regarding supported videos and
42 Feeds of videos and feeds of comments allow to see updates and get them in
43 an aggregator or script of your choice.
46 Jobs are long-running tasks enqueued and processed by the instance
49 No additional worker registration is currently available.
50 - name: ServerFollowing
52 Managing servers which the instance interacts with is crucial to the
55 of federation in PeerTube and external video indexation. The PeerTube
58 then deals with inter-server ActivityPub operations and propagates
60 information across its social graph by posting activities to actors' inbox
65 Video abuses deal with reports of local or remote videos alike.
68 Operations dealing with listing, uploading, fetching or modifying videos.
71 The search helps to find _videos_ from within the instance and beyond.
72 Videos from other instances federated by the instance (that is, instances
73 followed by the instance) can be found via keywords and other criteria of
77 Operations dealing with comments to a video. Comments are organized in
81 Operations dealing with creation, modification and video listing of a
90 summary: Get the account by name
92 - $ref: '#/components/parameters/name'
93 - $ref: '#/components/parameters/start'
94 - $ref: '#/components/parameters/count'
95 - $ref: '#/components/parameters/sort'
98 description: successful operation
102 $ref: '#/components/schemas/Account'
103 '/accounts/{name}/videos':
108 summary: 'Get videos for an account, provided the name of that account'
110 - $ref: '#/components/parameters/name'
113 description: successful operation
117 $ref: '#/components/schemas/Video'
121 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
122 .then(function(response) {
123 return response.json()
124 }).then(function(data) {
130 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
135 summary: Get all accounts
138 description: successful operation
144 $ref: '#/components/schemas/Account'
149 summary: Get the public configuration of the server
152 description: successful operation
156 $ref: '#/components/schemas/ServerConfig'
159 summary: Get the instance about page content
164 description: successful operation
167 summary: Get the runtime configuration of the server
175 description: successful operation
177 summary: Set the runtime configuration of the server
185 description: successful operation
187 summary: Delete the runtime configuration of the server
195 description: successful operation
196 '/feeds/videos.{format}':
199 Get the feed of videos for the server, with optional filter by account
208 The format expected (xml defaults to RSS 2.0, atom to ATOM 1.0 and
209 json to JSON FEED 1.0
221 The id of the local account to filter to (beware, users IDs and not
222 actors IDs which will return empty feeds
228 description: The name of the local account to filter to
233 description: successful operation
236 summary: Get list of jobs
246 description: The state of the job
249 - $ref: '#/components/parameters/start'
250 - $ref: '#/components/parameters/count'
251 - $ref: '#/components/parameters/sort'
254 description: successful operation
260 $ref: '#/components/schemas/Job'
261 '/server/following/{host}':
268 summary: Unfollow a server by hostname
273 description: 'The host to unfollow '
278 description: successful operation
283 summary: Get followers of the server
285 - $ref: '#/components/parameters/start'
286 - $ref: '#/components/parameters/count'
287 - $ref: '#/components/parameters/sort'
290 description: successful operation
296 $ref: '#/components/schemas/Follow'
301 summary: Get servers followed by the server
303 - $ref: '#/components/parameters/start'
304 - $ref: '#/components/parameters/count'
305 - $ref: '#/components/parameters/sort'
308 description: successful operation
314 $ref: '#/components/schemas/Follow'
321 summary: Follow a server
324 $ref: '#/paths/~1users~1me/put/responses/204'
329 $ref: '#/components/schemas/Follow'
332 summary: Creates user
340 description: successful operation
344 $ref: '#/components/schemas/AddUserResponse'
349 $ref: '#/components/schemas/AddUser'
350 description: User to create
353 summary: Get a list of users
359 - $ref: '#/components/parameters/start'
360 - $ref: '#/components/parameters/count'
361 - $ref: '#/components/parameters/sort'
364 description: successful operation
370 $ref: '#/components/schemas/User'
373 summary: Delete a user by its id
380 - $ref: '#/components/parameters/id'
383 $ref: '#/paths/~1users~1me/put/responses/204'
385 summary: Get user by its id
391 - $ref: '#/components/parameters/id'
394 description: successful operation
398 $ref: '#/components/schemas/User'
400 summary: Update user profile by its id
406 - $ref: '#/components/parameters/id'
409 $ref: '#/paths/~1users~1me/put/responses/204'
414 $ref: '#/components/schemas/UpdateUser'
418 summary: Get current user information
425 description: successful operation
431 $ref: '#/components/schemas/User'
433 summary: Update current user information
440 description: Successful operation
445 $ref: '#/components/schemas/UpdateMe'
447 /users/me/video-quota-used:
449 summary: Get current user used quota
456 description: successful operation
461 '/users/me/videos/{videoId}/rating':
463 summary: 'Get rating of video by its id, among those of the current user'
472 description: 'The video id '
477 description: successful operation
481 $ref: '#/components/schemas/GetMeVideoRating'
484 summary: Get videos of the current user
490 - $ref: '#/components/parameters/start'
491 - $ref: '#/components/parameters/count'
492 - $ref: '#/components/parameters/sort'
495 description: successful operation
501 $ref: '#/components/schemas/Video'
504 summary: Register a user
509 $ref: '#/paths/~1users~1me/put/responses/204'
514 $ref: '#/components/schemas/RegisterUser'
516 /users/me/avatar/pick:
518 summary: Update current user avatar
525 description: successful operation
529 $ref: '#/components/schemas/Avatar'
537 description: The file to upload.
542 # only accept png/jpeg
543 contentType: image/png, image/jpeg
546 summary: Get list of videos
553 description: category id of the video
556 - $ref: '#/components/parameters/start'
557 - $ref: '#/components/parameters/count'
558 - $ref: '#/components/parameters/sort'
561 description: successful operation
567 $ref: '#/components/schemas/Video'
570 summary: Get list of video licences known by the server
575 description: successful operation
584 summary: Get list of video licences known by the server
589 description: successful operation
598 summary: Get list of languages known by the server
603 description: successful operation
612 summary: Get list of privacy policies supported by the server
617 description: successful operation
626 summary: Update metadata for a video by its id
632 - $ref: '#/components/parameters/id2'
635 description: successful operation
639 $ref: '#/components/schemas/Video'
647 description: Video thumbnail file
650 description: Video preview file
653 description: Video category
656 description: Video licence
659 description: Video language
662 description: Video description
665 description: Whether or not we wait transcoding before publish the video
668 description: Text describing how to support the video uploader
671 description: Whether or not this video contains sensitive content
674 description: Video name
677 description: Video tags
680 description: Enable or disable comments for this video
682 scheduleUpdate: &ref_0
690 description: Video privacy target
694 description: When to update the video
698 summary: Get a video by its id
702 - $ref: '#/components/parameters/id2'
705 description: successful operation
709 $ref: '#/components/schemas/Video'
711 summary: Delete a video by its id
717 - $ref: '#/components/parameters/id2'
720 $ref: '#/paths/~1users~1me/put/responses/204'
721 '/videos/{id}/description':
723 summary: Get a video description by its id
727 - $ref: '#/components/parameters/id2'
730 description: successful operation
735 '/videos/{id}/views':
737 summary: Add a view to the video by its id
741 - $ref: '#/components/parameters/id2'
744 $ref: '#/paths/~1users~1me/put/responses/204'
745 '/videos/{id}/watching':
747 summary: Indicate progress of in watching the video by its id for a user
753 - $ref: '#/components/parameters/id2'
758 $ref: '#/components/schemas/UserWatchingVideo'
762 $ref: '#/paths/~1users~1me/put/responses/204'
765 summary: Get list of video ownership changes requests
771 - $ref: '#/components/parameters/id2'
774 description: successful operation
775 '/videos/ownership/{id}/accept':
777 summary: Refuse ownership change request for video by its id
783 - $ref: '#/components/parameters/id2'
786 $ref: '#/paths/~1users~1me/put/responses/204'
787 '/videos/ownership/{id}/refuse':
789 summary: Accept ownership change request for video by its id
795 - $ref: '#/components/parameters/id2'
798 $ref: '#/paths/~1users~1me/put/responses/204'
799 '/videos/{id}/give-ownership':
801 summary: Request change of ownership for a video you own, by its id
807 - $ref: '#/components/parameters/id2'
811 application/x-www-form-urlencoded:
821 $ref: '#/paths/~1users~1me/put/responses/204'
823 description: 'Changing video ownership to a remote account is not supported yet'
826 summary: Upload a video file with its metadata
833 description: successful operation
837 $ref: '#/components/schemas/VideoUploadResponse'
845 description: Video file
849 description: Channel id that will contain this video
852 description: Video thumbnail file
855 description: Video preview file
858 $ref: '#/components/schemas/VideoPrivacy'
860 description: Video category
863 description: Video licence
866 description: Video language
869 description: Video description
872 description: Whether or not we wait transcoding before publish the video
875 description: Text describing how to support the video uploader
878 description: Whether or not this video contains sensitive content
881 description: Video name
884 description: Video tags
887 description: Enable or disable comments for this video
889 scheduleUpdate: *ref_0
897 ## DEPENDENCIES: httpie, jq
899 USERNAME="<your_username>"
900 PASSWORD="<your_password>"
901 FILE_PATH="<your_file_path>"
902 CHANNEL_ID="<your_channel_id>"
905 API_PATH="https://peertube2.cpy.re/api/v1"
907 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
908 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
909 token=$(http -b --form POST "$API_PATH/users/token" \
910 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
913 | jq -r ".access_token")
915 http -b --form POST "$API_PATH/videos/upload" \
916 videofile@$FILE_PATH \
917 channelId=$CHANNEL_ID \
919 "Authorization:Bearer $token"
922 summary: Get list of reported video abuses
928 - $ref: '#/components/parameters/start'
929 - $ref: '#/components/parameters/count'
930 - $ref: '#/components/parameters/sort'
933 description: successful operation
939 $ref: '#/components/schemas/VideoAbuse'
940 '/videos/{id}/abuse':
942 summary: 'Report an abuse, on a video by its id'
948 - $ref: '#/components/parameters/id2'
951 $ref: '#/paths/~1users~1me/put/responses/204'
952 '/videos/{id}/blacklist':
954 summary: Put on blacklist a video by its id
962 - $ref: '#/components/parameters/id2'
965 $ref: '#/paths/~1users~1me/put/responses/204'
967 summary: Delete an entry of the blacklist of a video by its id
975 - $ref: '#/components/parameters/id2'
978 $ref: '#/paths/~1users~1me/put/responses/204'
981 summary: Get list of videos on blacklist
989 - $ref: '#/components/parameters/start'
990 - $ref: '#/components/parameters/count'
991 - $ref: '#/components/parameters/sort'
994 description: successful operation
1000 $ref: '#/components/schemas/VideoBlacklist'
1003 summary: Get list of video channels
1007 - $ref: '#/components/parameters/start'
1008 - $ref: '#/components/parameters/count'
1009 - $ref: '#/components/parameters/sort'
1012 description: successful operation
1018 $ref: '#/components/schemas/VideoChannel'
1020 summary: Creates a video channel for the current user
1027 $ref: '#/paths/~1users~1me/put/responses/204'
1029 $ref: '#/components/requestBodies/VideoChannelInput'
1030 '/video-channels/{id}':
1032 summary: Get a video channel by its id
1036 - $ref: '#/components/parameters/id3'
1039 description: successful operation
1043 $ref: '#/components/schemas/VideoChannel'
1045 summary: Update a video channel by its id
1051 - $ref: '#/components/parameters/id3'
1054 $ref: '#/paths/~1users~1me/put/responses/204'
1056 $ref: '#/components/requestBodies/VideoChannelInput'
1058 summary: Delete a video channel by its id
1064 - $ref: '#/components/parameters/id3'
1067 $ref: '#/paths/~1users~1me/put/responses/204'
1068 '/video-channels/{id}/videos':
1070 summary: Get videos of a video channel by its id
1074 - $ref: '#/components/parameters/id3'
1077 description: successful operation
1081 $ref: '#/components/schemas/Video'
1082 '/accounts/{name}/video-channels':
1084 summary: Get video channels of an account by its name
1088 - $ref: '#/components/parameters/name'
1091 description: successful operation
1097 $ref: '#/components/schemas/VideoChannel'
1098 '/videos/{id}/comment-threads':
1100 summary: Get the comment threads of a video by its id
1104 - $ref: '#/components/parameters/id2'
1105 - $ref: '#/components/parameters/start'
1106 - $ref: '#/components/parameters/count'
1107 - $ref: '#/components/parameters/sort'
1110 description: successful operation
1114 $ref: '#/components/schemas/CommentThreadResponse'
1116 summary: 'Creates a comment thread, on a video by its id'
1122 - $ref: '#/components/parameters/id2'
1125 description: successful operation
1129 $ref: '#/components/schemas/CommentThreadPostResponse'
1130 '/videos/{id}/comment-threads/{threadId}':
1132 summary: 'Get the comment thread by its id, of a video by its id'
1136 - $ref: '#/components/parameters/id2'
1140 description: The thread id (root comment id)
1145 description: successful operation
1149 $ref: '#/components/schemas/VideoCommentThreadTree'
1150 '/videos/{id}/comments/{commentId}':
1152 summary: 'Creates a comment in a comment thread by its id, of a video by its id'
1158 - $ref: '#/components/parameters/id2'
1159 - $ref: '#/components/parameters/commentId'
1162 description: successful operation
1166 $ref: '#/components/schemas/CommentThreadPostResponse'
1168 summary: 'Delete a comment in a comment therad by its id, of a video by its id'
1174 - $ref: '#/components/parameters/id2'
1175 - $ref: '#/components/parameters/commentId'
1178 $ref: '#/paths/~1users~1me/put/responses/204'
1179 '/videos/{id}/rate':
1181 summary: Vote for a video by its id
1187 - $ref: '#/components/parameters/id2'
1190 $ref: '#/paths/~1users~1me/put/responses/204'
1195 summary: Get the videos corresponding to a given query
1197 - $ref: '#/components/parameters/start'
1198 - $ref: '#/components/parameters/count'
1199 - $ref: '#/components/parameters/sort'
1203 description: String to search
1208 description: successful operation
1214 $ref: '#/components/schemas/Video'
1216 - url: 'https://peertube.cpy.re/api/v1'
1217 description: Live Test Server (live data - stable version)
1218 - url: 'https://peertube2.cpy.re/api/v1'
1219 description: Live Test Server (live data - bleeding edge version)
1220 - url: 'https://peertube3.cpy.re/api/v1'
1221 description: Live Test Server (live data - bleeding edge version)
1235 description: Number of items
1242 description: Sort column (-createdAt for example)
1250 The name of the account (chocobozzz or chocobozzz@peertube.cpy.re for
1258 description: The user id
1265 description: The video id or uuid
1272 description: The video channel id or uuid
1279 description: The comment id
1287 $ref: '#/components/schemas/VideoChannelInput'
1291 In the header: *Authorization: Bearer <token\>*
1294 Authenticating via OAuth requires the following steps:
1297 - Have an account with sufficient authorization levels
1299 - [Generate](https://docs.joinpeertube.org/lang/en/devdocs/rest.html) a
1302 - Make Authenticated Requests
1306 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
1309 moderator: Moderator scope
1312 VideoConstantNumber:
1318 VideoConstantString:
1343 $ref: '#/components/schemas/VideoConstantNumber'
1345 $ref: '#/components/schemas/VideoConstantNumber'
1347 $ref: '#/components/schemas/VideoConstantString'
1349 $ref: '#/components/schemas/VideoPrivacy'
1384 $ref: '#/components/schemas/Avatar'
1392 $ref: '#/components/schemas/Account'
1468 $ref: '#/components/schemas/Account'
1469 VideoCommentThreadTree:
1472 $ref: '#/components/schemas/VideoComment'
1476 $ref: '#/components/schemas/VideoCommentThreadTree'
1506 $ref: '#/components/schemas/Avatar'
1509 - $ref: '#/components/schemas/Actor'
1536 $ref: '#/components/schemas/Account'
1540 $ref: '#/components/schemas/VideoChannel'
1589 $ref: '#/components/schemas/Actor'
1591 $ref: '#/components/schemas/Actor'
1633 VideoUploadResponse:
1642 CommentThreadResponse:
1649 $ref: '#/components/schemas/VideoComment'
1650 CommentThreadPostResponse:
1653 $ref: '#/components/schemas/VideoComment'
1658 description: 'The user username '
1661 description: 'The user password '
1664 description: 'The user email '
1667 description: 'The user videoQuota '
1670 description: 'The user role '
1681 description: 'The user id '
1684 description: 'The updated email of the user '
1687 description: 'The updated videoQuota of the user '
1690 description: 'The updated role of the user '
1700 description: 'Your new password '
1703 description: 'Your new email '
1706 description: 'Your new displayNSFW '
1709 description: 'Your new autoPlayVideo '
1719 description: 'Id of the video '
1722 description: 'Rating of the video '
1730 description: 'The username of the user '
1733 description: 'The password of the user '
1736 description: 'The email of the user '