# 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)

```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

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.graphlit.dev/api-guides/use-cases/alerts/alert-create.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
