Finalize a media upload
Confirm that a media version's bytes have been uploaded. Snapvisor reads the object back to check the file is what it claims to be, records an image's dimensions, bills it to the screenshot meter, and updates the managed pull request comment. There is no processing step: the media is usable the moment this returns. Use it right after uploading the file to the target returned by createMedia.
Confirm that a media version's bytes have been uploaded. Snapvisor reads the object back to check the file is what it claims to be, records an image's dimensions, bills it to the screenshot meter, and updates the managed pull request comment. There is no processing step: the media is usable the moment this returns. Use it right after uploading the file to the target returned by createMedia.
Authenticate as a project with a project token.
Send it as a bearer token in the Authorization header:
Authorization: Bearer <project-token>You can find your project token in your Snapvisor project settings. Project tokens are used by CI and the SDK to create builds and deployments.
In: header
Path Parameters
The media ID
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/media/string/finalize"{ "id": "string", "name": "string", "state": "before", "description": "string", "stage": "staged", "branch": "string", "prNumber": 0, "url": "http://example.com", "markdown": "string", "version": 0, "versionCount": 0, "fileUrl": "http://example.com", "posterUrl": "http://example.com", "contentType": "string", "sizeBytes": 0, "width": 0, "height": 0, "visibility": "team", "status": "pending", "expiresAt": "string", "createdAt": "string"}List a media's versions GET
List a media's most recent uploaded versions, newest first, up to 100. A separate call because it is rarely needed: a media usually has one version, and the media itself already carries the newest one flattened onto it. Check `versionCount` first — at 1 there is nothing here you do not already have. Use it when a comment carries a `mediaVersionId` older than the media's current version. A pin describes a spot on *those* bytes, so feedback written on an earlier upload has to be read against that upload — match the id here to get its file.
List a project's media GET
List the standalone images and videos uploaded to a project, most recent first. `branch` and `prNumber` are what this is usually for: everything uploaded for the work in hand, whether or not a pull request exists yet. `branch` covers both — a media keeps its branch after publishing — so it stays a single query across the moment the pull request opens. Use it to find everything uploaded for a branch or pull request.