SCALIX help

← All tools

lads_register_upload

LinkedIn Ads write medium risk

Part of the Sponsored Content Agent.

What it does

Legacy/unified media registration via the Assets API: POST /rest/assets?action=registerUpload with registerUploadRequest{owner, recipes:[urn:li:digitalmediaRecipe:...], serviceRelationships:[{identifier:'urn:li:userGeneratedContent', relationshipType:'OWNER'}], supportedUploadMechanism?, fileSize?}. Returns an asset URN urn:li:digitalmediaAsset:{id} plus an uploadUrl (single) or MultipartUpload partUploadRequests (>200MB) — complete multipart with action=completeMultiPartUpload using the metadata + ETags. The asset id can be reused as urn:li:image / urn:li:video. NOTE: LinkedIn's Images and Videos APIs replace the Assets API, which gets no new features and "will be deprecated in the future"; prefer lads_upload_image / lads_upload_video / lads_upload_document. The preview and the commit say what this call does and does not do: it registers the upload, and the bytes still have to be PUT to the upload URL. Recipe must match the use case (e.g. companyUpdate-article-image for image ads, ads-video_v2 for video ads). Log the asset. 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 only when interoperating with legacy Assets-API media or a flow that still requires recipes; otherwise prefer lads_upload_image/video/document. Confirm the recipe matches the creative and the owner is in scope, then register + upload.

Inputs

NameTypeRequiredDescription
ownerstringyesAsset owner URN (sponsoredAccount/organization/person). Within bearer scope.
recipesarrayyesRecipe URN(s) identifying the use case, e.g. urn:li:digitalmediaRecipe:companyUpdate-article-image (image ad), ssu-carousel-card-image (carousel), rightRail-logo-image (text/dynamic), ads-video_v2 (video). Must match the intended creative.
service_relationshipsarrayno[{identifier, relationshipType}] declaring who owns the asset. Defaults to [{identifier:'urn:li:userGeneratedContent', relationshipType:'OWNER'}] (the doc sample) when omitted.
supported_upload_mechanismarraynoSINGLE_REQUEST_UPLOAD (<200MB, default) | MULTIPART_UPLOAD (>200MB, requires fileSize). For images, SYNCHRONOUS_UPLOAD is recommended.
file_sizeintegernoByte size; required for MULTIPART_UPLOAD to compute part ranges.
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

Uploaded creative assets must meet LinkedIn editorial standards and AI-disclosure rules (disclose AI-generated; no deepfakes of real people); upload only to an owner within the bearer's scope. Use the recipe matching the creative use case.

Reminder

Prefer the modern Images/Videos/Documents APIs; ensure assets are policy-compliant and scoped to the authorized account only.

Errors

Error classMeansWhat to doRetry
INVALID_ARGUMENTWrong/missing recipe for the use case, or serviceRelationships >5 (400).Use the correct recipe URN for the creative type; keep serviceRelationships <=5.no
UNSUPPORTED_MEDIA_TYPEFile format unsupported for the recipe (415).Match file format to the recipe (e.g. JPG/PNG for image recipes) and retry.no
REQUEST_ENTITY_TOO_LARGEFile exceeds size limit (413).Use MULTIPART_UPLOAD with fileSize for >200MB, or compress.no
PERMISSION_DENIEDNo rw_ads or owner access (403).Verify scope + owner role; re-auth if needed (needs_reauth).no
PROCESSING_INCOMPLETEAsset recipe status not AVAILABLE (still PROCESSING/WAITING_UPLOAD).Poll GET /rest/assets/{id} until AVAILABLE before use.yes
TOKEN_REVOKEDToken expired/revoked (401).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.Retry with backoff.yes

Edge cases

  • Wrong recipe for the creative -> asset uploads but can't attach; pick the recipe that matches the format.
  • >200MB requires MULTIPART_UPLOAD + fileSize; split into parts and completeMultiPartUpload with ETags.
  • Image registerUpload should use SYNCHRONOUS_UPLOAD to guarantee the asset is ready before creative creation.
  • The Assets API gets no new features and LinkedIn says it will be deprecated -> recommend the Images/Videos/Documents APIs (lads_upload_image/video/document).
  • digitalmediaAsset id can be reused as urn:li:image / urn:li:video by swapping the URN prefix.
  • serviceRelationships array max size 5.