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'
13 altText: PeerTube Project Homepage
17 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
18 HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with
19 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
20 which generates a client SDK in the language of your choice - we generate some client SDKs automatically:
22 - [Python](https://framagit.org/framasoft/peertube/clients/python)
23 - [Go](https://framagit.org/framasoft/peertube/clients/go)
24 - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
26 See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
30 When you sign up for an account, you are given the possibility to generate
31 sessions, and authenticate using this session token. One session token can
32 currently be used at a time.
36 The API uses standard HTTP status codes to indicate the success or failure
37 of the API call. The body of the response will be JSON in the following
42 "code": "unauthorized_request", // example inner error code
43 "error": "Token is invalid." // example exposed error message
47 url: https://docs.joinpeertube.org/api-rest-reference.html
51 Using some features of PeerTube require authentication, for which Accounts
52 provide different levels of permission as well as associated user
53 information. Accounts also encompass remote accounts discovered across the federation.
56 Each server exposes public information regarding supported videos and
60 Jobs are long-running tasks enqueued and processed by the instance
61 itself. No additional worker registration is currently available.
62 - name: Instance Follows
64 Managing servers which the instance interacts with is crucial to the
65 concept of federation in PeerTube and external video indexation. The PeerTube
66 server then deals with inter-server ActivityPub operations and propagates
67 information across its social graph by posting activities to actors' inbox
71 Video abuses deal with reports of local or remote videos alike.
74 Operations dealing with listing, uploading, fetching or modifying videos.
77 The search helps to find _videos_ or _channels_ from within the instance and beyond.
78 Videos from other instances federated by the instance (that is, instances
79 followed by the instance) can be found via keywords and other criteria of
82 Administrators can also enable the use of a remote search system, indexing
83 videos and channels not could be not federated by the instance.
84 - name: Video Comments
86 Operations dealing with comments to a video. Comments are organized in
88 - name: Video Playlists
90 Operations dealing with playlists of videos. Playlists are bound to users
92 - name: Video Channels
94 Operations dealing with the creation, modification and listing of videos within a channel.
97 Operations dealing with blocking videos (removing them from view and
98 preventing interactions).
101 Like/dislike a video.
104 Server syndication feeds
120 - Video Ownership Change
131 - name: Instance Configuration
143 summary: Get an account
145 - $ref: '#/components/parameters/name'
148 description: successful operation
152 $ref: '#/components/schemas/Account'
154 description: account not found
155 '/accounts/{name}/videos':
160 summary: 'List videos of an account'
162 - $ref: '#/components/parameters/name'
163 - $ref: '#/components/parameters/categoryOneOf'
164 - $ref: '#/components/parameters/tagsOneOf'
165 - $ref: '#/components/parameters/tagsAllOf'
166 - $ref: '#/components/parameters/licenceOneOf'
167 - $ref: '#/components/parameters/languageOneOf'
168 - $ref: '#/components/parameters/nsfw'
169 - $ref: '#/components/parameters/filter'
170 - $ref: '#/components/parameters/skipCount'
171 - $ref: '#/components/parameters/start'
172 - $ref: '#/components/parameters/count'
173 - $ref: '#/components/parameters/videosSort'
176 description: successful operation
180 $ref: '#/components/schemas/VideoListResponse'
184 fetch('https://peertube2.cpy.re/api/v1/accounts/{name}/videos')
185 .then(function(response) {
186 return response.json()
187 }).then(function(data) {
193 http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
199 uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
201 http = Net::HTTP.new(uri.host, uri.port)
204 response = http.get(uri.request_uri)
206 puts JSON.parse(response.read_body)
211 r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
219 summary: List accounts
221 - $ref: '#/components/parameters/start'
222 - $ref: '#/components/parameters/count'
223 - $ref: '#/components/parameters/sort'
226 description: successful operation
232 $ref: '#/components/schemas/Account'
237 summary: Get instance public configuration
240 description: successful operation
244 $ref: '#/components/schemas/ServerConfig'
247 summary: Get instance "About" information
252 description: successful operation
256 $ref: '#/components/schemas/ServerConfigAbout'
259 summary: Get instance runtime configuration
267 description: successful operation
271 $ref: '#/components/schemas/ServerConfigCustom'
273 summary: Set instance runtime configuration
281 description: successful operation
283 summary: Delete instance runtime configuration
291 description: successful operation
294 summary: List instance jobs
304 description: The state of the job
313 - $ref: '#/components/parameters/start'
314 - $ref: '#/components/parameters/count'
315 - $ref: '#/components/parameters/sort'
318 description: successful operation
324 $ref: '#/components/schemas/Job'
325 '/server/following/{host}':
332 summary: Unfollow a server
337 description: 'The host to unfollow '
342 description: successful operation
347 summary: List instance followers
349 - $ref: '#/components/parameters/start'
350 - $ref: '#/components/parameters/count'
351 - $ref: '#/components/parameters/sort'
354 description: successful operation
360 $ref: '#/components/schemas/Follow'
365 summary: List instance followings
367 - $ref: '#/components/parameters/start'
368 - $ref: '#/components/parameters/count'
369 - $ref: '#/components/parameters/sort'
372 description: successful operation
378 $ref: '#/components/schemas/Follow'
385 summary: Follow a server
388 description: successful operation
393 $ref: '#/components/schemas/Follow'
396 summary: Create a user
404 description: successful operation
408 $ref: '#/components/schemas/AddUserResponse'
413 $ref: '#/components/schemas/AddUser'
414 description: User to create
423 - $ref: '#/components/parameters/start'
424 - $ref: '#/components/parameters/count'
425 - $ref: '#/components/parameters/usersSort'
428 description: successful operation
434 $ref: '#/components/schemas/User'
437 summary: Delete a user
444 - $ref: '#/components/parameters/id'
447 description: successful operation
455 - $ref: '#/components/parameters/id'
458 description: successful operation
462 $ref: '#/components/schemas/User'
464 summary: Update a user
470 - $ref: '#/components/parameters/id'
473 description: successful operation
478 $ref: '#/components/schemas/UpdateUser'
482 summary: Register a user
487 description: successful operation
492 $ref: '#/components/schemas/RegisterUser'
496 summary: Get my user information
504 description: successful operation
510 $ref: '#/components/schemas/User'
512 summary: Update my user information
520 description: successful operation
525 $ref: '#/components/schemas/UpdateMe'
527 /users/me/videos/imports:
529 summary: Get video imports of my user
537 - $ref: '#/components/parameters/start'
538 - $ref: '#/components/parameters/count'
539 - $ref: '#/components/parameters/sort'
542 description: successful operation
546 $ref: '#/components/schemas/VideoImport'
547 /users/me/video-quota-used:
549 summary: Get my user used quota
557 description: successful operation
562 '/users/me/videos/{videoId}/rating':
564 summary: Get rate of my user for a video
574 description: 'The video id '
579 description: successful operation
583 $ref: '#/components/schemas/GetMeVideoRating'
586 summary: Get videos of my user
594 - $ref: '#/components/parameters/start'
595 - $ref: '#/components/parameters/count'
596 - $ref: '#/components/parameters/sort'
599 description: successful operation
603 $ref: '#/components/schemas/VideoListResponse'
604 /users/me/subscriptions:
606 summary: Get my user subscriptions
613 - $ref: '#/components/parameters/start'
614 - $ref: '#/components/parameters/count'
615 - $ref: '#/components/parameters/sort'
618 description: successful operation
620 summary: Add subscription to my user
628 description: successful operation
629 /users/me/subscriptions/exist:
631 summary: Get if subscriptions exist for my user
638 - $ref: '#/components/parameters/subscriptionsUris'
641 description: successful operation
646 /users/me/subscriptions/videos:
648 summary: List videos of subscriptions of my user
656 - $ref: '#/components/parameters/categoryOneOf'
657 - $ref: '#/components/parameters/tagsOneOf'
658 - $ref: '#/components/parameters/tagsAllOf'
659 - $ref: '#/components/parameters/licenceOneOf'
660 - $ref: '#/components/parameters/languageOneOf'
661 - $ref: '#/components/parameters/nsfw'
662 - $ref: '#/components/parameters/filter'
663 - $ref: '#/components/parameters/skipCount'
664 - $ref: '#/components/parameters/start'
665 - $ref: '#/components/parameters/count'
666 - $ref: '#/components/parameters/videosSort'
669 description: successful operation
673 $ref: '#/components/schemas/VideoListResponse'
674 '/users/me/subscriptions/{subscriptionHandle}':
676 summary: Get subscription of my user
683 - $ref: '#/components/parameters/subscriptionHandle'
686 description: successful operation
690 $ref: '#/components/schemas/VideoChannel'
692 summary: Delete subscription of my user
699 - $ref: '#/components/parameters/subscriptionHandle'
702 description: successful operation
703 /users/me/avatar/pick:
705 summary: Update my user avatar
712 description: successful operation
716 $ref: '#/components/schemas/Avatar'
724 description: The file to upload.
729 contentType: image/png, image/jpeg
732 summary: List video ownership changes
734 - Video Ownership Change
739 description: successful operation
740 '/videos/ownership/{id}/accept':
742 summary: Accept ownership change request
744 - Video Ownership Change
748 - $ref: '#/components/parameters/idOrUUID'
751 description: successful operation
753 description: cannot terminate an ownership change of another user
755 description: video owneship change not found
756 '/videos/ownership/{id}/refuse':
758 summary: Refuse ownership change request
760 - Video Ownership Change
764 - $ref: '#/components/parameters/idOrUUID'
767 description: successful operation
769 description: cannot terminate an ownership change of another user
771 description: video owneship change not found
772 '/videos/{id}/give-ownership':
774 summary: Request ownership change
776 - Video Ownership Change
780 - $ref: '#/components/parameters/idOrUUID'
784 application/x-www-form-urlencoded:
794 description: successful operation
796 description: changing video ownership to a remote account is not supported yet
798 description: video not found
805 - $ref: '#/components/parameters/categoryOneOf'
806 - $ref: '#/components/parameters/tagsOneOf'
807 - $ref: '#/components/parameters/tagsAllOf'
808 - $ref: '#/components/parameters/licenceOneOf'
809 - $ref: '#/components/parameters/languageOneOf'
810 - $ref: '#/components/parameters/nsfw'
811 - $ref: '#/components/parameters/filter'
812 - $ref: '#/components/parameters/skipCount'
813 - $ref: '#/components/parameters/start'
814 - $ref: '#/components/parameters/count'
815 - $ref: '#/components/parameters/videosSort'
818 description: successful operation
822 $ref: '#/components/schemas/VideoListResponse'
825 summary: List available video categories
830 description: successful operation
839 summary: List available video licences
844 description: successful operation
853 summary: List available video languages
858 description: successful operation
867 summary: List available video privacies
872 description: successful operation
881 summary: Update a video
887 - $ref: '#/components/parameters/idOrUUID'
890 description: successful operation
898 description: Video thumbnail file
902 description: Video preview file
906 description: Video category
909 description: Video licence
912 description: Video language
915 $ref: '#/components/schemas/VideoPrivacySet'
917 description: Video description
920 description: Whether or not we wait transcoding before publish the video
923 description: Text describing how to support the video uploader
926 description: Whether or not this video contains sensitive content
929 description: Video name
932 description: Video tags (maximum 5 tags each between 2 and 30 characters)
941 description: Enable or disable comments for this video
943 originallyPublishedAt:
944 description: Date when the content was originally published
948 $ref: '#/components/schemas/VideoScheduledUpdate'
951 contentType: image/jpeg
953 contentType: image/jpeg
959 - $ref: '#/components/parameters/idOrUUID'
962 description: successful operation
966 $ref: '#/components/schemas/VideoDetails'
968 summary: Delete a video
974 - $ref: '#/components/parameters/idOrUUID'
977 description: successful operation
978 '/videos/{id}/description':
980 summary: Get complete video description
984 - $ref: '#/components/parameters/idOrUUID'
987 description: successful operation
992 '/videos/{id}/views':
994 summary: Add a view to a video
998 - $ref: '#/components/parameters/idOrUUID'
1001 description: successful operation
1002 '/videos/{id}/watching':
1004 summary: Set watching progress of a video
1010 - $ref: '#/components/parameters/idOrUUID'
1015 $ref: '#/components/schemas/UserWatchingVideo'
1019 description: successful operation
1022 summary: Upload a video
1029 description: successful operation
1033 $ref: '#/components/schemas/VideoUploadResponse'
1035 description: 'The user video quota is exceeded with this video.'
1037 description: 'Upload has timed out'
1039 description: 'Invalid input file.'
1042 multipart/form-data:
1047 description: Video file
1051 description: Channel id that will contain this video
1054 description: Video thumbnail file
1058 description: Video preview file
1062 $ref: '#/components/schemas/VideoPrivacySet'
1064 description: Video category
1067 description: Video licence
1070 description: Video language
1073 description: Video description
1076 description: Whether or not we wait transcoding before publish the video
1079 description: Text describing how to support the video uploader
1082 description: Whether or not this video contains sensitive content
1085 description: Video name
1088 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1098 description: Enable or disable comments for this video
1100 originallyPublishedAt:
1101 description: Date when the content was originally published
1105 $ref: '#/components/schemas/VideoScheduledUpdate'
1112 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1114 contentType: image/jpeg
1116 contentType: image/jpeg
1120 ## DEPENDENCIES: httpie, jq
1121 # pip install httpie
1122 USERNAME="<your_username>"
1123 PASSWORD="<your_password>"
1124 FILE_PATH="<your_file_path>"
1125 CHANNEL_ID="<your_channel_id>"
1128 API_PATH="https://peertube2.cpy.re/api/v1"
1130 client_id=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1131 client_secret=$(http -b GET "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1132 token=$(http -b --form POST "$API_PATH/users/token" \
1133 client_id="$client_id" client_secret="$client_secret" grant_type=password response_type=code \
1134 username=$USERNAME \
1135 password=$PASSWORD \
1136 | jq -r ".access_token")
1138 http -b --form POST "$API_PATH/videos/upload" \
1139 videofile@$FILE_PATH \
1140 channelId=$CHANNEL_ID \
1142 "Authorization:Bearer $token"
1145 summary: Import a video
1146 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
1153 multipart/form-data:
1158 description: Torrent File
1162 description: HTTP target URL
1165 description: Magnet URI
1168 description: Channel id that will contain this video
1171 description: Video thumbnail file
1175 description: Video preview file
1179 $ref: '#/components/schemas/VideoPrivacySet'
1181 description: Video category
1184 description: Video licence
1187 description: Video language
1190 description: Video description
1193 description: Whether or not we wait transcoding before publish the video
1196 description: Text describing how to support the video uploader
1199 description: Whether or not this video contains sensitive content
1202 description: Video name
1205 description: Video tags (maximum 5 tags each between 2 and 30 characters)
1214 description: Enable or disable comments for this video
1217 $ref: '#/components/schemas/VideoScheduledUpdate'
1223 contentType: application/x-bittorrent
1225 contentType: image/jpeg
1227 contentType: image/jpeg
1230 description: successful operation
1234 $ref: '#/components/schemas/VideoUploadResponse'
1236 description: HTTP or Torrent/magnetURI import not enabled
1238 description: '`magnetUri` or `targetUrl` or a torrent file missing'
1241 summary: List video abuses
1249 - $ref: '#/components/parameters/start'
1250 - $ref: '#/components/parameters/count'
1251 - $ref: '#/components/parameters/abusesSort'
1254 description: successful operation
1260 $ref: '#/components/schemas/VideoAbuse'
1261 '/videos/{id}/abuse':
1263 summary: Report an abuse
1270 - $ref: '#/components/parameters/idOrUUID'
1279 description: Reason why the user reports this video
1282 description: Reason categories that help triage reports
1297 description: Timestamp in the video that marks the beginning of the report
1300 description: Timestamp in the video that marks the ending of the report
1305 description: successful operation
1306 '/videos/{id}/abuse/{abuseId}':
1308 summary: Update an abuse
1317 description: successful operation
1319 description: video abuse not found
1321 - $ref: '#/components/parameters/idOrUUID'
1322 - $ref: '#/components/parameters/abuseId'
1330 $ref: '#/components/schemas/VideoAbuseStateSet'
1333 description: 'Update the comment of the video abuse for other admin/moderators'
1335 summary: Delete an abuse
1344 description: successful operation
1346 description: block not found
1348 - $ref: '#/components/parameters/idOrUUID'
1349 - $ref: '#/components/parameters/abuseId'
1351 '/videos/{id}/blacklist':
1353 summary: Block a video
1361 - $ref: '#/components/parameters/idOrUUID'
1364 description: successful operation
1366 summary: Unblock a video by its id
1374 - $ref: '#/components/parameters/idOrUUID'
1377 description: successful operation
1379 description: block not found
1384 summary: List blocked videos
1390 - $ref: '#/components/parameters/start'
1391 - $ref: '#/components/parameters/count'
1392 - $ref: '#/components/parameters/blacklistsSort'
1395 description: successful operation
1401 $ref: '#/components/schemas/VideoBlacklist'
1402 /videos/{id}/captions:
1404 summary: List captions of a video
1408 - $ref: '#/components/parameters/idOrUUID'
1411 description: successful operation
1422 $ref: '#/components/schemas/VideoCaption'
1423 /videos/{id}/captions/{captionLanguage}:
1425 summary: Add or replace a video caption
1429 - $ref: '#/components/parameters/idOrUUID'
1430 - $ref: '#/components/parameters/captionLanguage'
1433 multipart/form-data:
1438 description: The file to upload.
1443 contentType: text/vtt, application/x-subrip, text/plain
1446 description: successful operation
1448 description: video or language not found
1450 summary: Delete a video caption
1454 - $ref: '#/components/parameters/idOrUUID'
1455 - $ref: '#/components/parameters/captionLanguage'
1458 description: successful operation
1460 description: video or language or caption for that language not found
1463 summary: List video channels
1467 - $ref: '#/components/parameters/start'
1468 - $ref: '#/components/parameters/count'
1469 - $ref: '#/components/parameters/sort'
1472 description: successful operation
1478 $ref: '#/components/schemas/VideoChannel'
1480 summary: Create a video channel
1487 description: successful operation
1492 $ref: '#/components/schemas/VideoChannelCreate'
1493 '/video-channels/{channelHandle}':
1495 summary: Get a video channel
1499 - $ref: '#/components/parameters/channelHandle'
1502 description: successful operation
1506 $ref: '#/components/schemas/VideoChannel'
1508 summary: Update a video channel
1514 - $ref: '#/components/parameters/channelHandle'
1517 description: successful operation
1522 $ref: '#/components/schemas/VideoChannelUpdate'
1524 summary: Delete a video channel
1530 - $ref: '#/components/parameters/channelHandle'
1533 description: successful operation
1534 '/video-channels/{channelHandle}/videos':
1536 summary: List videos of a video channel
1541 - $ref: '#/components/parameters/channelHandle'
1542 - $ref: '#/components/parameters/categoryOneOf'
1543 - $ref: '#/components/parameters/tagsOneOf'
1544 - $ref: '#/components/parameters/tagsAllOf'
1545 - $ref: '#/components/parameters/licenceOneOf'
1546 - $ref: '#/components/parameters/languageOneOf'
1547 - $ref: '#/components/parameters/nsfw'
1548 - $ref: '#/components/parameters/filter'
1549 - $ref: '#/components/parameters/skipCount'
1550 - $ref: '#/components/parameters/start'
1551 - $ref: '#/components/parameters/count'
1552 - $ref: '#/components/parameters/videosSort'
1555 description: successful operation
1559 $ref: '#/components/schemas/VideoListResponse'
1561 /video-playlists/privacies:
1563 summary: List available playlist privacies
1568 description: successful operation
1578 summary: List video playlists
1582 - $ref: '#/components/parameters/start'
1583 - $ref: '#/components/parameters/count'
1584 - $ref: '#/components/parameters/sort'
1587 description: successful operation
1593 $ref: '#/components/schemas/VideoPlaylist'
1595 summary: Create a video playlist
1596 description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
1603 description: successful operation
1618 multipart/form-data:
1623 description: Video playlist display name
1626 description: Video playlist thumbnail file
1630 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1632 description: Video playlist description
1635 description: Video channel in which the playlist will be published
1640 /video-playlists/{id}:
1642 summary: Get a video playlist
1646 - $ref: '#/components/parameters/idOrUUID'
1649 description: successful operation
1653 $ref: '#/components/schemas/VideoPlaylist'
1655 summary: Update a video playlist
1656 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
1663 description: successful operation
1665 - $ref: '#/components/parameters/idOrUUID'
1668 multipart/form-data:
1673 description: Video playlist display name
1676 description: Video playlist thumbnail file
1680 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
1682 description: Video playlist description
1685 description: Video channel in which the playlist will be published
1688 summary: Delete a video playlist
1694 - $ref: '#/components/parameters/idOrUUID'
1697 description: successful operation
1699 /video-playlists/{id}/videos:
1701 summary: 'List videos of a playlist'
1706 - $ref: '#/components/parameters/idOrUUID'
1709 description: successful operation
1713 $ref: '#/components/schemas/VideoListResponse'
1715 summary: 'Add a video in a playlist'
1722 - $ref: '#/components/parameters/idOrUUID'
1725 description: successful operation
1731 videoPlaylistElement:
1744 description: 'Video to add in the playlist'
1747 description: 'Start the video at this specific timestamp (in seconds)'
1750 description: 'Stop the video at this specific timestamp (in seconds)'
1754 /video-playlists/{id}/videos/reorder:
1756 summary: 'Reorder a playlist'
1762 - $ref: '#/components/parameters/idOrUUID'
1765 description: successful operation
1774 description: 'Start position of the element to reorder'
1776 insertAfterPosition:
1778 description: 'New position for the block to reorder, to add the block before the first element'
1782 description: 'How many element from `startPosition` to reorder'
1786 - insertAfterPosition
1788 /video-playlists/{id}/videos/{playlistElementId}:
1790 summary: 'Update a playlist element'
1796 - $ref: '#/components/parameters/idOrUUID'
1797 - $ref: '#/components/parameters/playlistElementId'
1800 description: successful operation
1809 description: 'Start the video at this specific timestamp (in seconds)'
1812 description: 'Stop the video at this specific timestamp (in seconds)'
1814 summary: 'Delete an element from a playlist'
1820 - $ref: '#/components/parameters/idOrUUID'
1821 - $ref: '#/components/parameters/playlistElementId'
1824 description: successful operation
1826 '/users/me/video-playlists/videos-exist':
1828 summary: 'Check video exists in my playlists'
1837 description: The video ids to check
1844 description: successful operation
1864 '/accounts/{name}/video-channels':
1866 summary: List video channels of an account
1871 - $ref: '#/components/parameters/name'
1874 description: successful operation
1880 $ref: '#/components/schemas/VideoChannel'
1881 '/accounts/{name}/ratings':
1883 summary: List ratings of an account
1889 - $ref: '#/components/parameters/name'
1890 - $ref: '#/components/parameters/start'
1891 - $ref: '#/components/parameters/count'
1892 - $ref: '#/components/parameters/sort'
1896 description: Optionally filter which ratings to retrieve
1904 description: successful operation
1910 $ref: '#/components/schemas/VideoRating'
1911 '/videos/{id}/comment-threads':
1913 summary: List threads of a video
1917 - $ref: '#/components/parameters/idOrUUID'
1918 - $ref: '#/components/parameters/start'
1919 - $ref: '#/components/parameters/count'
1920 - $ref: '#/components/parameters/commentsSort'
1923 description: successful operation
1927 $ref: '#/components/schemas/CommentThreadResponse'
1929 summary: Create a thread
1935 - $ref: '#/components/parameters/idOrUUID'
1938 description: successful operation
1942 $ref: '#/components/schemas/CommentThreadPostResponse'
1951 description: 'Text comment'
1955 '/videos/{id}/comment-threads/{threadId}':
1957 summary: Get a thread
1961 - $ref: '#/components/parameters/idOrUUID'
1962 - $ref: '#/components/parameters/threadId'
1965 description: successful operation
1969 $ref: '#/components/schemas/VideoCommentThreadTree'
1970 '/videos/{id}/comments/{commentId}':
1972 summary: Reply to a thread of a video
1978 - $ref: '#/components/parameters/idOrUUID'
1979 - $ref: '#/components/parameters/commentId'
1982 description: successful operation
1986 $ref: '#/components/schemas/CommentThreadPostResponse'
1995 description: 'Text comment'
2000 summary: Delete a comment or a reply
2006 - $ref: '#/components/parameters/idOrUUID'
2007 - $ref: '#/components/parameters/commentId'
2010 description: successful operation
2011 '/videos/{id}/rate':
2013 summary: Like/dislike a video
2019 - $ref: '#/components/parameters/idOrUUID'
2022 description: successful operation
2027 summary: Search videos
2029 - $ref: '#/components/parameters/categoryOneOf'
2030 - $ref: '#/components/parameters/tagsOneOf'
2031 - $ref: '#/components/parameters/tagsAllOf'
2032 - $ref: '#/components/parameters/licenceOneOf'
2033 - $ref: '#/components/parameters/languageOneOf'
2034 - $ref: '#/components/parameters/nsfw'
2035 - $ref: '#/components/parameters/filter'
2036 - $ref: '#/components/parameters/skipCount'
2037 - $ref: '#/components/parameters/start'
2038 - $ref: '#/components/parameters/count'
2039 - $ref: '#/components/parameters/searchTarget'
2040 - $ref: '#/components/parameters/videosSearchSort'
2045 String to search. If the user can make a remote URI search, and the string is an URI then the
2046 PeerTube instance will fetch the remote object and add it to its database. Then,
2047 you can use the REST API to fetch the complete video information and interact with it.
2053 description: Get videos that are published after this date
2060 description: Get videos that are published before this date
2064 - name: originallyPublishedStartDate
2067 description: Get videos that are originally published after this date
2071 - name: originallyPublishedEndDate
2074 description: Get videos that are originally published before this date
2081 description: Get videos that have this minimum duration
2087 description: Get videos that have this maximum duration
2092 description: successful operation
2096 $ref: '#/components/schemas/VideoListResponse'
2097 /search/video-channels:
2101 summary: Search channels
2103 - $ref: '#/components/parameters/start'
2104 - $ref: '#/components/parameters/count'
2105 - $ref: '#/components/parameters/searchTarget'
2106 - $ref: '#/components/parameters/sort'
2111 String to search. If the user can make a remote URI search, and the string is an URI then the
2112 PeerTube instance will fetch the remote object and add it to its database. Then,
2113 you can use the REST API to fetch the complete channel information and interact with it.
2118 description: successful operation
2124 $ref: '#/components/schemas/VideoChannel'
2125 /blocklist/accounts:
2129 summary: List account blocks
2134 - $ref: '#/components/parameters/start'
2135 - $ref: '#/components/parameters/count'
2136 - $ref: '#/components/parameters/sort'
2139 description: successful operation
2143 summary: Block an account
2155 description: account to block, in the form `username@domain`
2160 description: successful operation
2162 description: self-blocking forbidden
2163 '/blocklist/accounts/{accountName}':
2167 summary: Unblock an account by its handle
2175 description: account to unblock, in the form `username@domain`
2180 description: successful operation
2182 description: account or account block does not exist
2187 summary: List server blocks
2192 - $ref: '#/components/parameters/start'
2193 - $ref: '#/components/parameters/count'
2194 - $ref: '#/components/parameters/sort'
2197 description: successful operation
2201 summary: Block a server
2213 description: server domain to block
2218 description: successful operation
2220 description: self-blocking forbidden
2221 '/blocklist/servers/{host}':
2225 summary: Unblock a server by its domain
2233 description: server domain to unblock
2238 description: successful operation
2240 description: account block does not exist
2241 '/feeds/video-comments.{format}':
2245 summary: List comments on videos
2247 - url: 'https://peertube.cpy.re'
2248 description: Live Test Server (live data - stable version)
2249 - url: 'https://peertube2.cpy.re'
2250 description: Live Test Server (live data - latest nighlty version)
2251 - url: 'https://peertube3.cpy.re'
2252 description: Live Test Server (live data - latest RC version)
2257 description: 'format expected (we focus on making `rss` the most featureful ; it serves Media RSS)'
2270 description: 'limit listing to a specific video'
2275 description: successful operation
2280 default: 'max-age=900' # 15 min cache
2284 $ref: '#/components/schemas/VideoCommentsForXML'
2285 application/rss+xml:
2287 $ref: '#/components/schemas/VideoCommentsForXML'
2290 $ref: '#/components/schemas/VideoCommentsForXML'
2291 application/atom+xml:
2293 $ref: '#/components/schemas/VideoCommentsForXML'
2298 description: accept header unsupported
2299 '/feeds/videos.{format}':
2303 summary: List videos
2305 - url: 'https://peertube.cpy.re'
2306 description: Live Test Server (live data - stable version)
2307 - url: 'https://peertube2.cpy.re'
2308 description: Live Test Server (live data - latest nighlty version)
2309 - url: 'https://peertube3.cpy.re'
2310 description: Live Test Server (live data - latest RC version)
2315 description: 'format expected (we focus on making `rss` the most featureful ; it serves Media RSS)'
2328 description: 'limit listing to a specific account'
2333 description: 'limit listing to a specific account'
2336 - name: videoChannelId
2338 description: 'limit listing to a specific video channel'
2341 - name: videoChannelName
2343 description: 'limit listing to a specific video channel'
2348 description: successful operation
2353 default: 'max-age=900' # 15 min cache
2357 $ref: '#/components/schemas/VideosForXML'
2358 application/rss+xml:
2360 $ref: '#/components/schemas/VideosForXML'
2363 $ref: '#/components/schemas/VideosForXML'
2364 application/atom+xml:
2366 $ref: '#/components/schemas/VideosForXML'
2371 description: accept header unsupported
2373 - url: 'https://peertube.cpy.re/api/v1'
2374 description: Live Test Server (live data - stable version)
2375 - url: 'https://peertube2.cpy.re/api/v1'
2376 description: Live Test Server (live data - latest nighlty version)
2377 - url: 'https://peertube3.cpy.re/api/v1'
2378 description: Live Test Server (live data - latest RC version)
2385 description: Offset used to paginate results
2392 description: "Number of items to return"
2401 description: Sort column (`-createdAt` for example)
2409 If the administrator enabled search index support, you can override the default search target.
2412 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
2413 It means the instance may not know the objects you fetched. If you want to load video/channel information:
2414 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
2415 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
2416 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
2417 * If the current user has not the ability to make a remote URI search, then redirect the user on the origin instance or fetch
2418 the data from the origin instance API
2428 description: Sort videos by criteria
2443 description: Sort videos by criteria
2458 description: Sort comments by criteria
2468 description: Sort blacklists by criteria
2484 description: Sort users by criteria
2495 description: Sort abuses by criteria
2507 The name of the account (`chocobozzz` or `chocobozzz@example.org` for
2515 description: The user id
2522 description: The object id or uuid
2526 name: playlistElementId
2529 description: Playlist element id
2536 description: Video abuse id
2540 name: captionLanguage
2543 description: The caption language
2550 description: "The video channel handle (example: 'my_username@example.com' or 'my_username')"
2554 name: subscriptionHandle
2557 description: "The subscription handle (example: 'my_username@example.com' or 'my_username')"
2564 description: The thread id (root comment id)
2571 description: The comment id
2578 description: category id of the video (see /videos/categories)
2591 description: tag(s) of the video
2604 description: tag(s) of the video, where all should be present in the video
2617 description: language id of the video (see /videos/languages). Use `_unknown` to filter on videos that don't have a video language
2630 description: licence id of the video (see /videos/licences)
2643 description: if you don't need the `total` in the response
2654 description: whether to include nsfw videos, if any
2665 Special filters (local for instance) which might require special rights:
2666 * `local` - only videos local to the instance
2667 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
2677 description: list of uris to check if each is part of the user subscriptions
2685 In the header: *Authorization: Bearer <token\>*
2688 Authenticating via OAuth requires the following steps:
2691 - Have an account with sufficient authorization levels
2693 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
2696 - Make Authenticated Requests
2700 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
2703 moderator: Moderator scope
2706 VideoConstantNumber:
2712 VideoConstantString:
2719 VideoPlaylistPrivacySet:
2725 description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)'
2726 VideoPlaylistPrivacyConstant:
2729 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2733 VideoPlaylistTypeSet:
2738 description: 'The video playlist type (Regular = `1`, Watch Later = `2`)'
2739 VideoPlaylistTypeConstant:
2742 $ref: '#/components/schemas/VideoPlaylistTypeSet'
2753 description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)'
2754 VideoPrivacyConstant:
2757 $ref: '#/components/schemas/VideoPrivacySet'
2774 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
2784 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
2794 description: 'The video playlist privacy (Pending = `1`, Rejected = `2`, Accepted = `3`)'
2795 VideoAbuseStateConstant:
2798 $ref: '#/components/schemas/VideoAbuseStateSet'
2801 VideoAbusePredefinedReasons:
2815 VideoResolutionConstant:
2819 description: 'Video resolution (240, 360, 720 ...)'
2822 VideoScheduledUpdate:
2825 $ref: '#/components/schemas/VideoPrivacySet'
2829 description: When to update the video
2847 - $ref: '#/components/schemas/Avatar'
2848 VideoChannelSummary:
2863 - $ref: '#/components/schemas/Avatar'
2875 - $ref: '#/components/schemas/Video'
2881 $ref: '#/components/schemas/VideoResolutionConstant'
2884 description: 'Video file size in bytes'
2897 VideoStreamingPlaylists:
2905 description: 'Playlist type (HLS = `1`)'
2913 $ref: '#/components/schemas/VideoFile'
2933 originallyPublishedAt:
2936 $ref: '#/components/schemas/VideoConstantNumber'
2938 $ref: '#/components/schemas/VideoConstantNumber'
2940 $ref: '#/components/schemas/VideoConstantString'
2942 $ref: '#/components/schemas/VideoPrivacyConstant'
2969 $ref: '#/components/schemas/VideoStateConstant'
2973 - $ref: '#/components/schemas/VideoScheduledUpdate'
2981 $ref: '#/components/schemas/AccountSummary'
2983 $ref: '#/components/schemas/VideoChannelSummary'
2992 - $ref: '#/components/schemas/Video'
3000 $ref: '#/components/schemas/VideoChannel'
3002 $ref: '#/components/schemas/Account'
3010 $ref: '#/components/schemas/VideoFile'
3022 $ref: '#/components/schemas/VideoStreamingPlaylists'
3023 VideoImportStateConstant:
3031 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
3048 $ref: '#/components/schemas/VideoImportStateConstant'
3058 $ref: '#/components/schemas/Video'
3066 $ref: '#/components/schemas/VideoAbusePredefinedReasons'
3068 $ref: '#/components/schemas/Account'
3070 $ref: '#/components/schemas/VideoAbuseStateConstant'
3146 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
3148 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
3150 $ref: '#/components/schemas/AccountSummary'
3152 $ref: '#/components/schemas/VideoChannelSummary'
3171 totalRepliesFromVideoAuthor:
3176 $ref: '#/components/schemas/Account'
3177 VideoCommentThreadTree:
3180 $ref: '#/components/schemas/VideoComment'
3184 $ref: '#/components/schemas/VideoCommentThreadTree'
3188 $ref: '#/components/schemas/VideoConstantString'
3218 $ref: '#/components/schemas/Avatar'
3221 - $ref: '#/components/schemas/Actor'
3239 description: 'Theme enabled by this user'
3242 description: 'Has the user confirmed their email address?'
3244 $ref: '#/components/schemas/NSFWPolicy'
3249 description: 'Automatically start playing the video on the watch page'
3251 $ref: '#/components/schemas/UserRole'
3266 videoAbusesAcceptedCount:
3268 videoAbusesCreatedCount:
3272 noInstanceConfigWarningModal:
3283 $ref: '#/components/schemas/Account'
3287 $ref: '#/components/schemas/VideoChannel'
3357 allowedForCurrentIP:
3359 requiresEmailVerification:
3562 requiresEmailVerification:
3586 allowAdditionalExtensions:
3654 $ref: '#/components/schemas/Actor'
3656 $ref: '#/components/schemas/Actor'
3698 VideoUploadResponse:
3707 CommentThreadResponse:
3714 $ref: '#/components/schemas/VideoComment'
3715 CommentThreadPostResponse:
3718 $ref: '#/components/schemas/VideoComment'
3726 $ref: '#/components/schemas/Video'
3731 description: 'The user username'
3736 description: 'The user password. If the smtp server is configured, you can leave empty and an email will be sent'
3741 description: 'The user email. MUST be in the format of an email address.'
3744 description: 'The user video quota'
3747 description: 'The user daily video quota'
3749 $ref: '#/components/schemas/UserRole'
3761 description: 'The user id'
3764 description: 'The updated email of the user'
3767 description: 'The updated video quota of the user'
3770 description: 'The updated daily video quota of the user'
3772 $ref: '#/components/schemas/UserRole'
3783 description: 'Your new password'
3786 description: 'Your new email'
3789 description: 'Your new displayNSFW'
3792 description: 'Your new autoPlayVideo'
3802 description: 'Id of the video'
3805 description: 'Rating of the video'
3812 $ref: '#/components/schemas/Video'
3815 description: 'Rating of the video'
3823 description: 'The username of the user'
3826 description: 'The password of the user'
3829 description: 'The email of the user'
3832 description: 'The user display name'
3838 description: 'The name for the default channel'
3841 description: 'The display name for the default channel'
3857 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
3869 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
3870 bulkVideosSupportUpdate:
3872 description: 'Update the support field for all videos of this channel'
3877 name: 'media:peerLink'
3886 - application/x-bittorrent
3892 name: 'media:content'
3922 VideoCommentsForXML:
3955 description: video watch page URL
3958 description: video canonical URL
3962 description: video publication date
3965 description: video description
3968 description: video description
3971 description: publisher user name
3974 description: video category (MRSS)
3977 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
3991 description: video embed path, relative to the canonical URL domain (MRSS)
3999 description: video watch path, relative to the canonical URL domain (MRSS)
4019 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
4020 'media:description':
4027 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
4030 description: main streamable file for the video
4039 - application/x-bittorrent
4048 description: list of streamable files for the video. see [media:peerLink](https://www.rssboard.org/media-rss#media-peerlink) and [media:content](https://www.rssboard.org/media-rss#media-content) or (MRSS)
4051 - $ref: '#/components/schemas/MRSSPeerLink'
4052 - $ref: '#/components/schemas/MRSSGroupContent'