Upload media asset
Uploads bytes to R2 and may attach the managed path; CLI/MCP URLs are fetched. Agent ENTITY and PERSON uploads must cite the exact source image in sourceDetail; PERSON images must be named headshot photos, not avatar CDNs.
Authentication
User bearer token: Supabase or Clerk session JWT, Clerk OAuth access token, or Clerk personal API key
Admin API key for system-to-system write operations
Query parameters
Target UUID for entity/person or integer id for news.
Fallback that permits a wide (non-square) logo or photo into the square slot, used only after confirming no square or near-square source exists. Default false rejects wide wordmark/banner content for ENTITY/PERSON. Blank or invisible images are always rejected regardless of this flag.
Source-backed reason for overriding the returned gate requirement.
Provider name for provider-native IDs or slugs.
Provider-native source ID.
Provider-native source slug.
Actor type; inferred as agent when agentChassis and agentModel are supplied, or as employee from an authenticated user JWT session.
Agent chassis token for agent-authored writes.
Agent model id for agent-authored writes.
Request
Image file to upload. CLI/MCP may supply a local file path or http(s) URL. Agent ENTITY/PERSON uploads require the exact source image; PERSON images cannot be avatar CDNs.
Response
Attached managed storage path; never an external image URL
Earliest recorded write timestamp for this media asset slot from res_provenance_event (when this entity/person/news first received any image in this slot).
Latest write source for this media asset slot from res_provenance_event. changedAt is the last-modified timestamp of the current attached file.
Attached entity/person/news target id, when known