naftiko: 1.0.0-alpha2 info: label: X API v2 — Webhooks description: 'X API v2 — Webhooks. 8 operations. Lead operation: X Get Stream Links. Self-contained Naftiko capability covering one Twitter business surface.' tags: - Twitter - Webhooks created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: TWITTER_API_KEY: TWITTER_API_KEY capability: consumes: - type: http namespace: x-webhooks baseUri: https://api.x.com description: X API v2 — Webhooks business capability. Self-contained, no shared references. resources: - name: 2-tweets-search-webhooks path: /2/tweets/search/webhooks operations: - name: getwebhooksstreamlinks method: GET description: X Get Stream Links outputRawFormat: json outputParameters: - name: result type: object value: $. - name: 2-tweets-search-webhooks-webhook_id path: /2/tweets/search/webhooks/{webhook_id} operations: - name: deletewebhooksstreamlink method: DELETE description: X Delete Stream Link outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: webhook_id in: path type: string description: The webhook ID to link to your FilteredStream ruleset. required: true - name: createwebhooksstreamlink method: POST description: X Create Stream Link outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: webhook_id in: path type: string description: The webhook ID to link to your FilteredStream ruleset. required: true - name: tweet.fields in: query type: string description: A comma separated list of Tweet fields to display. - name: expansions in: query type: string description: A comma separated list of fields to expand. - name: media.fields in: query type: string description: A comma separated list of Media fields to display. - name: poll.fields in: query type: string description: A comma separated list of Poll fields to display. - name: user.fields in: query type: string description: A comma separated list of User fields to display. - name: place.fields in: query type: string description: A comma separated list of Place fields to display. - name: 2-webhooks path: /2/webhooks operations: - name: getwebhooks method: GET description: X Get Webhook outputRawFormat: json outputParameters: - name: result type: object value: $. - name: createwebhooks method: POST description: X Create Webhook outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: 2-webhooks-replay path: /2/webhooks/replay operations: - name: createwebhookreplayjob method: POST description: X Create Replay Job for Webhook outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: 2-webhooks-webhook_id path: /2/webhooks/{webhook_id} operations: - name: deletewebhooks method: DELETE description: X Delete Webhook outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: webhook_id in: path type: string description: The ID of the webhook to delete. required: true - name: validatewebhooks method: PUT description: X Validate Webhook outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: webhook_id in: path type: string description: The ID of the webhook to check. required: true authentication: type: bearer token: '{{env.TWITTER_API_KEY}}' exposes: - type: rest namespace: x-webhooks-rest port: 8080 description: REST adapter for X API v2 — Webhooks. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/2/tweets/search/webhooks name: 2-tweets-search-webhooks description: REST surface for 2-tweets-search-webhooks. operations: - method: GET name: getwebhooksstreamlinks description: X Get Stream Links call: x-webhooks.getwebhooksstreamlinks outputParameters: - type: object mapping: $. - path: /v1/2/tweets/search/webhooks/{webhook-id} name: 2-tweets-search-webhooks-webhook-id description: REST surface for 2-tweets-search-webhooks-webhook_id. operations: - method: DELETE name: deletewebhooksstreamlink description: X Delete Stream Link call: x-webhooks.deletewebhooksstreamlink with: webhook_id: rest.webhook_id outputParameters: - type: object mapping: $. - method: POST name: createwebhooksstreamlink description: X Create Stream Link call: x-webhooks.createwebhooksstreamlink with: webhook_id: rest.webhook_id tweet.fields: rest.tweet.fields expansions: rest.expansions media.fields: rest.media.fields poll.fields: rest.poll.fields user.fields: rest.user.fields place.fields: rest.place.fields outputParameters: - type: object mapping: $. - path: /v1/2/webhooks name: 2-webhooks description: REST surface for 2-webhooks. operations: - method: GET name: getwebhooks description: X Get Webhook call: x-webhooks.getwebhooks outputParameters: - type: object mapping: $. - method: POST name: createwebhooks description: X Create Webhook call: x-webhooks.createwebhooks with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/2/webhooks/replay name: 2-webhooks-replay description: REST surface for 2-webhooks-replay. operations: - method: POST name: createwebhookreplayjob description: X Create Replay Job for Webhook call: x-webhooks.createwebhookreplayjob with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/2/webhooks/{webhook-id} name: 2-webhooks-webhook-id description: REST surface for 2-webhooks-webhook_id. operations: - method: DELETE name: deletewebhooks description: X Delete Webhook call: x-webhooks.deletewebhooks with: webhook_id: rest.webhook_id outputParameters: - type: object mapping: $. - method: PUT name: validatewebhooks description: X Validate Webhook call: x-webhooks.validatewebhooks with: webhook_id: rest.webhook_id outputParameters: - type: object mapping: $. - type: mcp namespace: x-webhooks-mcp port: 9090 transport: http description: MCP adapter for X API v2 — Webhooks. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: x-get-stream-links description: X Get Stream Links hints: readOnly: true destructive: false idempotent: true call: x-webhooks.getwebhooksstreamlinks outputParameters: - type: object mapping: $. - name: x-delete-stream-link description: X Delete Stream Link hints: readOnly: false destructive: true idempotent: true call: x-webhooks.deletewebhooksstreamlink with: webhook_id: tools.webhook_id outputParameters: - type: object mapping: $. - name: x-create-stream-link description: X Create Stream Link hints: readOnly: false destructive: false idempotent: false call: x-webhooks.createwebhooksstreamlink with: webhook_id: tools.webhook_id tweet.fields: tools.tweet.fields expansions: tools.expansions media.fields: tools.media.fields poll.fields: tools.poll.fields user.fields: tools.user.fields place.fields: tools.place.fields outputParameters: - type: object mapping: $. - name: x-get-webhook description: X Get Webhook hints: readOnly: true destructive: false idempotent: true call: x-webhooks.getwebhooks outputParameters: - type: object mapping: $. - name: x-create-webhook description: X Create Webhook hints: readOnly: false destructive: false idempotent: false call: x-webhooks.createwebhooks with: body: tools.body outputParameters: - type: object mapping: $. - name: x-create-replay-job-webhook description: X Create Replay Job for Webhook hints: readOnly: false destructive: false idempotent: false call: x-webhooks.createwebhookreplayjob with: body: tools.body outputParameters: - type: object mapping: $. - name: x-delete-webhook description: X Delete Webhook hints: readOnly: false destructive: true idempotent: true call: x-webhooks.deletewebhooks with: webhook_id: tools.webhook_id outputParameters: - type: object mapping: $. - name: x-validate-webhook description: X Validate Webhook hints: readOnly: false destructive: false idempotent: true call: x-webhooks.validatewebhooks with: webhook_id: tools.webhook_id outputParameters: - type: object mapping: $.