Create Alert

User Intent

"How do I set up alerts for content or entities? Show me alert configuration."

Operation

SDK Method: createAlert() Use Case: Automated published notifications


Code Example (TypeScript)

import { Graphlit } from 'graphlit-client';
import { ContentTypes } from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

// Create alert for new content matching criteria
const alert = await graphlit.createAlert({
  name: "New Research Papers",
  description: "Alert on AI research papers",
  filter: {
    search: "artificial intelligence",
    types: [ContentTypes.File],
    collections: [{ id: 'research-collection-id' }]
  },
  webhookUrl: 'https://myapp.com/webhooks/content-alert'
});

console.log(`Alert created: ${alert.createAlert.id}`);

Alert Types

Content Alerts: New content matching filters Entity Alerts: Specific entity mentions Feed Alerts: New items from feed Threshold Alerts: Usage or count thresholds


Last updated

Was this helpful?