Use the upsert endpoint to create content if it doesn’t exist, or update if it does:
Copy
const content = await raily.content.upsert({ externalId: 'article-123', title: 'Introduction to AI', type: 'article', source: 'https://example.com/articles/ai-intro'});// Creates if externalId doesn't exist, updates if it does