SCALIX help

← All tools

lads_upload_image

LinkedIn Ads write medium risk

Part of the Sponsored Content Agent.

What it does

STARTS an image upload only: POST /rest/images?action=initializeUpload with {owner} and returns uploadUrl, uploadUrlExpiresAt and the image URN urn:li:image:{id}. It stops there — no file bytes are sent from Scalix, so the URN is not usable until the caller PUTs the binary to uploadUrl (Authorization header required for images). Sending the bytes from this tool is scheduled for November. 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 an image asset before creating an image/carousel/spotlight creative. Confirm the asset is policy-compliant and owned by the scoped account, then upload. Do NOT proceed to attach a creative until the upload is confirmed complete.

Inputs

NameTypeRequiredDescription
ownerstringyesAsset owner URN — ad account (urn:li:sponsoredAccount:{id}) or organization (urn:li:organization:{id}). Within bearer scope.
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

Creative imagery must meet LinkedIn editorial standards (professional, non-deceptive; low-res/meme rejected) and any AI-generated image must be disclosed and must NOT be a deepfake of a real person. Upload only to an owner within the bearer's scope.

Reminder

Use professional, policy-compliant imagery; disclose AI-generated visuals; never upload to an account outside the bearer's scope.

Errors

Error classMeansWhat to doRetry
UNSUPPORTED_MEDIA_TYPEUnsupported image format (415).Convert to JPG/PNG/GIF and retry.no
REQUEST_ENTITY_TOO_LARGEImage exceeds the pixel/size limit (413).Resize within LinkedIn's pixel/size limit and retry.no
INVALID_ARGUMENTMalformed initializeUpload request or bad owner (400).Fix owner URN/body per surfaced message.no
PERMISSION_DENIEDNo rw_ads or no access to owner (403).Verify scope + owner role; re-auth if needed (needs_reauth).no
UPLOAD_URL_EXPIREDuploadUrl expired before the PUT (uploadUrlExpiresAt passed).Re-run initializeUpload to get a fresh uploadUrl, then PUT promptly.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 / processing error (422/500).Retry with backoff; re-initialize if processing failed.yes

Edge cases

  • uploadUrl is short-lived (uploadUrlExpiresAt) -> PUT immediately or re-initialize.
  • Images API requires Authorization on the PUT (unlike video upload) — omitting it 401s.
  • GIF supports up to 250 frames; over that is rejected.
  • Attaching the image to a creative before processing completes can fail -> confirm completion first.
  • Asset can be reused across image/carousel/spotlight formats (no recipe in Images API).
  • Idempotency: re-initializing creates a new image URN; reuse the existing URN where possible.