cpy.re – peertube
The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with which generates a client SDK in the language of your choice - we generate some client SDKs automatically:
See the for a few examples of using the PeerTube API.
Authentication
When you sign up for an account on a PeerTube instance, you are given the possibility to generate sessions on it, and authenticate there using an access token. Only one access token can currently be used at a time.
Roles
Accounts are given permissions based on their role. There are three roles on PeerTube: Administrator, Moderator, and User. See the for a detail of their permissions.
Errors
The API uses standard HTTP status codes to indicate the success or failure of the API call, completed by a response body.
We provide error type values for ,
but it is still optional. Types are used to disambiguate errors that bear the same status code
and are non-obvious:
Here a 403 error could otherwise mean that the video is private or blocklisted.
Validation errors
Each parameter is evaluated on its own against a set of rules before the route validator proceeds with potential testing involving parameter combinations. Errors coming from validation errors appear earlier and benefit from a more detailed error description:
Where id is the name of the field concerned by the error, within the route definition.
invalid-params.<field>.location can be either 'params', 'body', 'header', 'query' or 'cookies', and
invalid-params.<field>.value reports the value that didn't pass validation whose invalid-params.<field>.msg
is about.
Deprecated error fields
Some fields could be included with previous versions. They are still included but their use is deprecated:
error: superseded bydetailcode: superseded bytype(which is now an URI)
Rate limits
We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators:
Depending on the endpoint, *failed requests are not taken into account. A service
limit is announced by a 429 Too Many Requests status code.
You can get details about the current state of your rate limit by reading the following headers:
CORS
This API features , allowing cross-domain communication from the browser for some routes:
| Endpoint |
|------------------------- ---|
| /api/* |
| /download/* |
| /lazy-static/* |
| /.well-known/webfinger |
In addition, all routes serving ActivityPub are CORS-enabled for all origins.
HTTP 1.1 404 Not FoundContent-Type: application/problem+json; charset=utf-8
{ "detail": "Video not found", "docs": "https://docs.joinpeertube.org/api/rest-reference.html#operation/getVideo", "status": 404, "title": "Not Found", "type": "about:blank"}HTTP 1.1 403 ForbiddenContent-Type: application/problem+json; charset=utf-8
{ "detail": "Cannot get this video regarding follow constraints", "docs": "https://docs.joinpeertube.org/api/rest-reference.html#operation/getVideo", "status": 403, "title": "Forbidden", "type": "https://docs.joinpeertube.org/api/rest-reference.html#section/Errors/does_not_respect_follow_constraints"}HTTP 1.1 400 Bad RequestContent-Type: application/problem+json; charset=utf-8
{ "detail": "Incorrect request parameters: id", "docs": "https://docs.joinpeertube.org/api/rest-reference.html#operation/getVideo", "instance": "/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180", "invalid-params": { "id": { "location": "params", "msg": "Invalid value", "param": "id", "value": "9c9de5e8-0a1e-484a-b099-e80766180" } }, "status": 400, "title": "Bad Request", "type": "about:blank"}- Homepage
- https://api.apis.guru/v2/specs/cpy.re:peertube/5.1.0.json
- Provider
- cpy.re:peertube / peertube
- OpenAPI version
- 3.0.0
- Spec (JSON)
- https://api.apis.guru/v2/specs/cpy.re/peertube/5.1.0/openapi.json
- Spec (YAML)
- https://api.apis.guru/v2/specs/cpy.re/peertube/5.1.0/openapi.yaml
Tools (188)
Extracted live via the executor SDK.
-
abuses.deleteApiV1AbusesAbuseIdDelete an abuse
-
abuses.deleteApiV1AbusesAbuseIdMessagesAbuseMessageIdDelete an abuse message
-
abuses.getAbusesList abuses
-
abuses.getApiV1AbusesAbuseIdMessagesList messages of an abuse
-
abuses.getMyAbusesList my abuses
-
abuses.postApiV1AbusesReport an abuse
-
abuses.postApiV1AbusesAbuseIdMessagesAdd message to an abuse
-
abuses.putApiV1AbusesAbuseIdUpdate an abuse
-
accountBlocks.deleteApiV1ServerBlocklistAccountsAccountNameUnblock an account by its handle
-
accountBlocks.getApiV1BlocklistStatusGet block status of accounts/hosts
-
accountBlocks.getApiV1ServerBlocklistAccountsList account blocks
-
accountBlocks.postApiV1ServerBlocklistAccountsBlock an account
-
accounts.getAccountGet an account
-
accounts.getAccountFollowersList followers of an account
-
accounts.getAccountsList accounts
-
accounts.getAccountVideosList videos of an account
-
accounts.getApiV1AccountsNameRatingsList ratings of an account
-
channelsSync.addVideoChannelSyncCreate a synchronization for a video channel
-
channelsSync.delVideoChannelSyncDelete a video channel synchronization
-
channelsSync.triggerVideoChannelSyncTriggers the channel synchronization job, fetching all the videos from the remote channel
-
config.delCustomConfigDelete instance runtime configuration
-
config.getAboutGet instance "About" information
-
config.getConfigGet instance public configuration
-
config.getCustomConfigGet instance runtime configuration
-
config.putCustomConfigSet instance runtime configuration
-
homepage.getApiV1CustomPagesHomepageInstanceGet instance custom homepage
-
homepage.putApiV1CustomPagesHomepageInstanceSet instance custom homepage
-
instanceFollows.deleteApiV1ServerFollowersNameWithHostRemove or reject a follower to your server
-
instanceFollows.deleteApiV1ServerFollowingHostOrHandleUnfollow an actor (PeerTube instance, channel or account)
-
instanceFollows.getApiV1ServerFollowersList instances following the server
-
instanceFollows.getApiV1ServerFollowingList instances followed by the server
-
instanceFollows.postApiV1ServerFollowersNameWithHostAcceptAccept a pending follower to your server
-
instanceFollows.postApiV1ServerFollowersNameWithHostRejectReject a pending follower to your server
-
instanceFollows.postApiV1ServerFollowingFollow a list of actors (PeerTube instance, channel or account)
-
instanceRedundancy.putApiV1ServerRedundancyHostUpdate a server redundancy policy
-
job.getJobsList instance jobs
-
job.postApiV1JobsPausePause job queue
-
job.postApiV1JobsResumeResume job queue
-
liveVideos.addLiveCreate a live
-
liveVideos.getApiV1VideosIdLiveSessionIf the video is a replay of a live, you can find the associated live session using this endpoint
-
liveVideos.getApiV1VideosLiveIdSessionsList all sessions created in a particular live
-
liveVideos.getLiveIdGet information about a live
-
liveVideos.updateLiveIdUpdate information about a live
-
logs.getInstanceAuditLogsGet instance audit logs
-
logs.getInstanceLogsGet instance logs
-
logs.sendClientLogSend client log
-
myHistory.deleteApiV1UsersMeHistoryVideosVideoIdDelete history element
-
myHistory.getApiV1UsersMeHistoryVideosList watched videos history
-
myHistory.postApiV1UsersMeHistoryVideosRemoveClear video history
-
myNotifications.getApiV1UsersMeNotificationsList my notifications
-
myNotifications.postApiV1UsersMeNotificationsReadMark notifications as read by their id
-
myNotifications.postApiV1UsersMeNotificationsReadAllMark all my notification as read
-
myNotifications.putApiV1UsersMeNotificationSettingsUpdate my notification settings
-
mySubscriptions.deleteApiV1UsersMeSubscriptionsSubscriptionHandleDelete subscription of my user
-
mySubscriptions.getApiV1UsersMeSubscriptionsGet my user subscriptions
-
mySubscriptions.getApiV1UsersMeSubscriptionsExistGet if subscriptions exist for my user
-
mySubscriptions.getApiV1UsersMeSubscriptionsSubscriptionHandleGet subscription of my user
-
mySubscriptions.getApiV1UsersMeSubscriptionsVideosList videos of subscriptions of my user
-
mySubscriptions.postApiV1UsersMeSubscriptionsAdd subscription to my user
-
myUser.deleteApiV1UsersMeAvatarDelete my avatar
-
myUser.getApiV1UsersMeVideoQuotaUsedGet my user used quota
-
myUser.getApiV1UsersMeVideosGet videos of my user
-
myUser.getApiV1UsersMeVideosVideoIdRatingGet rate of my user for a video
-
myUser.getUserInfoGet my user information
-
myUser.postApiV1UsersMeAvatarPickUpdate my user avatar
-
myUser.putUserInfoUpdate my user information
-
plugins.addPluginInstall a plugin
-
plugins.getApiV1PluginsNpmNamePublicSettingsGet a plugin's public settings
-
plugins.getApiV1PluginsNpmNameRegisteredSettingsGet a plugin's registered settings
-
plugins.getAvailablePluginsList available plugins
-
plugins.getPluginGet a plugin
-
plugins.getPluginsList plugins
-
plugins.putApiV1PluginsNpmNameSettingsSet a plugin's settings
-
plugins.uninstallPluginUninstall a plugin
-
plugins.updatePluginUpdate a plugin
-
register.acceptRegistrationAccept registration
-
register.deleteRegistrationDelete the registration entry. It will not remove the user associated with this registration (if any)
-
register.listRegistrationsList registrations
-
register.registerUserSignup has to be enabled and signup approval is not required
-
register.rejectRegistrationReject registration
-
register.requestRegistrationSignup has to be enabled and require approval on the instance
-
register.resendEmailToVerifyRegistrationResend verification link to registration email
-
register.verifyRegistrationEmailFollowing a user registration request, the user will receive an email asking to click a link containing a secret.
-
search.searchChannelsSearch channels
-
search.searchPlaylistsSearch playlists
-
search.searchVideosSearch videos
-
serverBlocks.deleteApiV1ServerBlocklistServersHostUnblock a server by its domain
-
serverBlocks.getApiV1ServerBlocklistServersList server blocks
-
serverBlocks.postApiV1ServerBlocklistServersBlock a server
-
session.getOAuthClientYou need to retrieve a client id and secret before .
-
session.getOAuthTokenWith your , you can retrieve an access and refresh tokens.
-
session.revokeOAuthTokenRevokes your access token and its associated refresh token, destroying your current session.
-
staticVideoFiles.getStaticStreamingPlaylistsHlsFilenameGet public HLS video file
-
staticVideoFiles.getStaticStreamingPlaylistsHlsPrivateFilenameGet private HLS video file
-
staticVideoFiles.getStaticWebseedFilenameGet public WebTorrent video file
-
staticVideoFiles.getStaticWebseedPrivateFilenameGet private WebTorrent video file
-
stats.getInstanceStatsGet instance public statistics. This endpoint is cached.
-
stats.postApiV1MetricsPlaybackThese metrics are exposed by OpenTelemetry metrics exporter if enabled.
-
users.addUserCreate a user
-
users.confirmTwoFactorRequestConfirm a two factor authentication request
-
users.delUserDelete a user
-
users.disableTwoFactorDisable two factor authentication of a user
-
users.getUserGet a user
-
users.getUsersList users
-
users.putUserUpdate a user
-
users.requestTwoFactorRequest two factor authentication for a user
-
users.resendEmailToVerifyUserResend user verification link
-
users.verifyUserFollowing a user registration, the new user will receive an email asking to click a link containing a secret. This endpoint can also be used to verify a new email set in the user account.
-
video.addViewCall this endpoint regularly (every 5-10 seconds for example) to notify the server the user is watching the video. After a while, PeerTube will increase video's viewers counter. If the user is authenticated, PeerTube will also store the current player time.
-
video.delVideoDelete a video
-
video.getCategoriesList available video categories
-
video.getLanguagesList available video languages
-
video.getLicencesList available video licences
-
video.getPrivacyPoliciesList available video privacy policies
-
video.getVideoGet a video
-
video.getVideoChannelVideosList videos of a video channel
-
video.getVideoDescGet complete video description
-
video.getVideosList videos
-
video.getVideoSourceGet video source file metadata
-
video.putApiV1VideosIdWatchingThis endpoint has been deprecated. Use
/videos/{id}/viewsinstead -
video.putVideoUpdate a video
-
video.requestVideoTokenRequest special tokens that expire quickly to use them in some context (like accessing private static files)
-
video.uploadLegacyUses a single request to upload a video.
-
video.uploadResumableUses to continue, pause or resume the upload of a video
-
video.uploadResumableCancelUses to cancel the upload of a video
-
video.uploadResumableInitUses to initialize the upload of a video
-
videoBlocks.addVideoBlockBlock a video
-
videoBlocks.delVideoBlockUnblock a video by its id
-
videoBlocks.getVideoBlocksList video blocks
-
videoCaptions.addVideoCaptionAdd or replace a video caption
-
videoCaptions.delVideoCaptionDelete a video caption
-
videoCaptions.getVideoCaptionsList captions of a video
-
videoChannels.addVideoChannelCreate a video channel
-
videoChannels.deleteApiV1VideoChannelsChannelHandleAvatarDelete channel avatar
-
videoChannels.deleteApiV1VideoChannelsChannelHandleBannerDelete channel banner
-
videoChannels.delVideoChannelDelete a video channel
-
videoChannels.getApiV1AccountsNameVideoChannelsList video channels of an account
-
videoChannels.getApiV1AccountsNameVideoChannelSyncsList the synchronizations of video channels of an account
-
videoChannels.getVideoChannelGet a video channel
-
videoChannels.getVideoChannelFollowersList followers of a video channel
-
videoChannels.getVideoChannelsList video channels
-
videoChannels.postApiV1VideoChannelsChannelHandleAvatarPickUpdate channel avatar
-
videoChannels.postApiV1VideoChannelsChannelHandleBannerPickUpdate channel banner
-
videoChannels.postApiV1VideoChannelsChannelHandleImportVideosImport a remote channel/playlist videos into a channel
-
videoChannels.putVideoChannelUpdate a video channel
-
videoComments.deleteApiV1VideosIdCommentsCommentIdDelete a comment or a reply
-
videoComments.getApiV1VideosIdCommentThreadsList threads of a video
-
videoComments.getApiV1VideosIdCommentThreadsThreadIdGet a thread
-
videoComments.postApiV1VideosIdCommentsCommentIdReply to a thread of a video
-
videoComments.postApiV1VideosIdCommentThreadsCreate a thread
-
videoFeeds.getSyndicatedCommentsList comments on videos
-
videoFeeds.getSyndicatedSubscriptionVideosList videos of subscriptions tied to a token
-
videoFeeds.getSyndicatedVideosList videos
-
videoFiles.delVideoHlsDelete video HLS files
-
videoFiles.delVideoWebTorrentDelete video WebTorrent files
-
videoImports.deleteApiV1VideosImportsIdDelete ended video import
-
videoImports.importVideoImport a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
-
videoImports.postApiV1VideosImportsIdCancelCancel a pending video import
-
videoMirroring.delMirroredVideoDelete a mirror done on a video
-
videoMirroring.getMirroredVideosList videos being mirrored
-
videoMirroring.putMirroredVideoMirror a video
-
videoOwnershipChange.getApiV1VideosOwnershipList video ownership changes
-
videoOwnershipChange.postApiV1VideosIdGiveOwnershipRequest ownership change
-
videoOwnershipChange.postApiV1VideosOwnershipIdAcceptAccept ownership change request
-
videoOwnershipChange.postApiV1VideosOwnershipIdRefuseRefuse ownership change request
-
videoPlaylists.addPlaylistIf the video playlist is set as public,
videoChannelIdis mandatory. -
videoPlaylists.deleteApiV1VideoPlaylistsPlaylistIdDelete a video playlist
-
videoPlaylists.delVideoPlaylistVideoDelete an element from a playlist
-
videoPlaylists.getApiV1AccountsNameVideoPlaylistsList playlists of an account
-
videoPlaylists.getApiV1UsersMeVideoPlaylistsVideosExistCheck video exists in my playlists
-
videoPlaylists.getApiV1VideoChannelsChannelHandleVideoPlaylistsList playlists of a channel
-
videoPlaylists.getApiV1VideoPlaylistsPlaylistIdGet a video playlist
-
videoPlaylists.getPlaylistPrivacyPoliciesList available playlist privacy policies
-
videoPlaylists.getPlaylistsList video playlists
-
videoPlaylists.putApiV1VideoPlaylistsPlaylistIdIf the video playlist is set as public, the playlist must have a assigned channel.
-
videoPlaylists.putVideoPlaylistVideoUpdate a playlist element
-
videoPlaylists.reorderVideoPlaylistReorder a playlist
-
videoRates.putApiV1VideosIdRateLike/dislike a video
-
videos.addVideoPlaylistVideoAdd a video in a playlist
-
videos.getApiV1UsersMeVideosImportsGet video imports of my user
-
videos.getVideoPlaylistVideosList videos of a playlist
-
videoStats.getApiV1VideosIdStatsOverallGet overall stats of a video
-
videoStats.getApiV1VideosIdStatsRetentionGet retention stats of a video
-
videoStats.getApiV1VideosIdStatsTimeseriesMetricGet timeserie stats of a video
-
videoTranscoding.createVideoTranscodingCreate a transcoding job
-
videoTranscoding.postApiV1VideosIdStudioEditCreate a task to edit a video (cut, add intro/outro etc)
-
openapi.previewSpecPreview an OpenAPI document before adding it as a source
-
openapi.addSourceAdd an OpenAPI source and register its operations as tools