SCALIX help

← All tools

lads_upload_video

LinkedIn Ads write medium risk

Part of the Sponsored Content Agent.

What it does

STARTS a video upload only: POST /rest/videos?action=initializeUpload with {owner, fileSizeBytes} and returns the video URN urn:li:video:{id} plus uploadInstructions (uploadUrl + byte range per part). It stops there — no bytes are sent and videos?action=finalizeUpload is not called, so the URN is not usable until both happen (scheduled for November). Thumbnails and captions are not handled. Two-phase (parity with Google, ADR-028/029): the first call (no preview_id) builds the request locally and returns a preview_id — nothing is sent to LinkedIn; re-call with that preview_id and identical arguments to COMMIT (single-use, 30-min; a changed/forged/replayed token fails closed).

When to use it

Use to stage a video asset before creating a SINGLE_VIDEO creative. Confirm compliance and ownership, then upload; for large files upload all parts in order and finalize. Do NOT attach to a creative until status is AVAILABLE.

Inputs

NameTypeRequiredDescription
ownerstringyesAsset owner URN — ad account or organization. Within bearer scope.
file_size_bytesintegeryesExact byte size; drives single vs multipart upload instructions and must match the file.
preview_idstringnoOmit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview.

Safeguards

A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.

Policy

Video creative must meet LinkedIn editorial standards and AI-disclosure rules (no deepfakes of real people; disclose AI-generated/altered video). Upload only to an owner within the bearer's scope.

Reminder

Use policy-compliant video; disclose AI-generated/altered content and never deepfake a real person; scope to the authorized account only.

Errors

Error classMeansWhat to doRetry
INVALID_ARGUMENTBad initializeUpload body, wrong fileSizeBytes, or out-of-order/missing parts at finalize (400).Match fileSizeBytes; upload every part in order and pass ETags as uploadedPartIds in the same order.no
UNSUPPORTED_MEDIA_TYPEUnsupported video format (415).Re-encode to a supported format (e.g. MP4) and retry.no
REQUEST_ENTITY_TOO_LARGEVideo exceeds size limit (413).Compress/trim and retry.no
PERMISSION_DENIEDNo rw_ads or owner access (403).Verify scope + owner role; re-auth if needed (needs_reauth).no
PROCESSING_INCOMPLETEVideo still PROCESSING / not yet AVAILABLE when referenced.Poll status (GET /rest/videos/{id}) until AVAILABLE before attaching; retry attach.yes
TOKEN_REVOKEDToken expired/revoked (401) on the API call (NOT the PUT).Refresh and retry once; else re-auth.yes
RESOURCE_EXHAUSTEDRate limit (429).Backoff 5/10/20s cap 60s; respect Retry-After.yes
PLATFORM_ERRORLinkedIn 5xx / upload-part failure (500).Retry the failed part with backoff, then finalize.yes

Edge cases

  • Multiple uploadInstructions => multipart: upload parts strictly in order; a single failed part breaks finalize -> re-upload that part.
  • Do NOT send Authorization on the video PUT (unlike images) -> including it can fail.
  • finalizeUpload requires uploadToken + all ETags (uploadedPartIds) in the correct order.
  • Processing is async -> video must reach AVAILABLE before use in a creative; poll status.
  • Uploaded video is reusable across organic + sponsored formats.
  • Captions/thumbnails upload independently of file size.