> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# X API quickstart for Twitter webhook delivery

> Add a webhook to your X API quickstart. Create the endpoint, keep the signing secret, and receive signed X (Twitter) monitor events on your server in minutes.

> For the complete documentation index, see [llms.txt](https://docs.xquik.com/llms.txt).

This step follows the [X API quickstart](https://docs.xquik.com/x-api-quickstart.md). You need an API key and a monitor from that guide.

## Set up a webhook

Receive signed monitor events at your endpoint.

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
curl -s -X POST https://xquik.com/api/v1/webhooks \
  -H "x-api-key: xq_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-server.com/webhook", "eventTypes": ["tweet.new"]}' | jq
```

```typescript TypeScript SDK theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
import XTwitterScraper from "x-twitter-scraper";

const client = new XTwitterScraper({ apiKey: "xq_your_api_key_here" });
const webhook = await client.webhooks.create({
  url: "https://your-server.com/webhook",
  eventTypes: ["tweet.new"],
});
const webhookSecret = webhook.secret;
process.stdout.write(`Webhook ${webhook.id} ready\n`);
// Store webhookSecret in your secret manager. Do not print it.
```

```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
const response = await fetch("https://xquik.com/api/v1/webhooks", {
  method: "POST",
  headers: {
    "x-api-key": "xq_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://your-server.com/webhook",
    eventTypes: ["tweet.new"],
  }),
});
const webhook = await response.json();
const webhookSecret = webhook.secret;
if (!webhookSecret) throw new Error("missing webhook secret");
process.stdout.write(`Webhook ${webhook.id} ready\n`);
// Store webhookSecret in your secret manager; do not print it.
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
import requests

response = requests.post(
    "https://xquik.com/api/v1/webhooks",
    headers={"x-api-key": "xq_your_api_key_here"},
    json={
        "url": "https://your-server.com/webhook",
        "eventTypes": ["tweet.new"],
    },
)
webhook = response.json()
webhook_secret = webhook["secret"]
if not webhook_secret:
    raise RuntimeError("missing webhook secret")
print(f"Webhook {webhook['id']} ready")
# Store webhook_secret in your secret manager; do not print it.
```

```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    body, _ := json.Marshal(map[string]interface{}{
        "url":        "https://your-server.com/webhook",
        "eventTypes": []string{"tweet.new"},
    })

    req, _ := http.NewRequest("POST", "https://xquik.com/api/v1/webhooks", bytes.NewReader(body))
    req.Header.Set("x-api-key", "xq_your_api_key_here")
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    var webhook struct {
        ID     string `json:"id"`
        Secret string `json:"secret"`
    }
    if err := json.NewDecoder(resp.Body).Decode(&webhook); err != nil {
        panic(err)
    }

    webhookSecret := webhook.Secret
    if webhookSecret == "" {
        panic("missing webhook secret")
    }
    fmt.Printf("Webhook %s ready\n", webhook.ID)
    // Store webhookSecret in your secret manager; do not print it.
}
```

**Response.**

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}}
{
  "id": "15",
  "url": "https://your-server.com/webhook",
  "eventTypes": ["tweet.new"],
  "secret": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
  "createdAt": "2026-02-24T10:30:00.000Z"
}
```

Save the `secret` from the response in a secret manager. Xquik returns it once. Use it to [verify webhook signatures](https://docs.xquik.com/webhooks/verification.md). Do not print it in shared logs.

## Next steps

* [X API quickstart](https://docs.xquik.com/x-api-quickstart.md)
* [Webhooks overview](https://docs.xquik.com/webhooks/overview.md)
* [Signature verification](https://docs.xquik.com/webhooks/verification.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.