Import news thumbnail from article

View as Markdown

Previews or imports an article-discovered news thumbnail. Supply id or slug to attach to an existing article; normal news create omits newsImageThumbnail and auto-imports.

Authentication

AuthorizationBearer

User bearer token: Supabase or Clerk session JWT, Clerk OAuth access token, or Clerk personal API key

OR
X-API-Keystring

Admin API key for system-to-system write operations

Query parameters

idstringOptional
Optional existing news article id to attach the imported thumbnail.
slugstringOptionalformat: "^[a-z0-9_-]+$"<=255 characters
Optional existing news article slug to attach the imported thumbnail.
urlstringOptional

Article URL to discover a thumbnail from. Omit id/slug with url for URL-only pre-create imports; URL-only imports return an unattached managed media.path. Supply id or slug to attach the import to an existing article.

previewbooleanOptionalDefaults to false
Fetch and return the selected source image URL without writing
sourceTypeenumRequired
Write provenance source type.
sourceDetailstringRequired
Source detail or reviewer reference for the write.
sourceProviderstringOptional

Provider name for provider-native IDs or slugs.

sourceProviderIdstringOptional

Provider-native source ID.

sourceProviderSlugstringOptional

Provider-native source slug.

actorTypeenumOptional

Actor type; inferred as agent when agentChassis and agentModel are supplied, or as employee from an authenticated user JWT session.

Allowed values:
agentChassisstringOptional

Agent chassis token for agent-authored writes.

agentModelstringOptional

Agent model id for agent-authored writes.

Response

OK
sourceImageUrlstringformat: "uri"
External image URL selected by the discovery process after redirects.
candidateCountinteger or nullOptional
Candidate count considered before selection
confidencestring or nullOptional
Confidence assigned to the winning candidate
mediaobject or nullOptional

Managed Cloudflare R2/images-v2 media asset after import; absent for preview. When news id/slug is omitted, use media.path as newsImageThumbnail on create.

winningSignalstring or nullOptional

Winning discovery signal such as JSON_LD_IMAGE or OPEN_GRAPH

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
406
Not Acceptable Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error