1Shot API Webhook icon

1Shot API Webhook

Starts the workflow when a 1Shot API webhook is received and authenticated

1Shot API Webhook

AI-generated

Overview

This node implements a webhook trigger for the 1Shot API, designed to start workflows upon receiving and authenticating webhook requests. It supports two types of webhook verification: a standard 1Shot webhook with ED-25519 signature verification and an X402 payment-gated webhook requiring authorization. The node is useful for scenarios where secure webhook handling is needed, such as verifying signed requests or gating access based on payment tokens. For example, it can be used to trigger workflows only when a valid signed webhook is received or when a payment token authorization is confirmed.

Use Case Examples

  1. Trigger a workflow when a signed webhook from 1Shot API is received, ensuring authenticity via ED-25519 signature verification.
  2. Trigger a workflow gated by X402 payment tokens, allowing execution only if the payment conditions are met.

Properties

Name Meaning
Webhook Type Choose the type of webhook verification to use, either '1Shot Signature Verification' or 'X402 Payment Gateway'.
Public Key The ED-25519 public key provided by 1Shot for webhook verification, required when using the 'oneshot' webhook type.
Allow Multiple HTTP Methods Whether to allow the webhook to listen for multiple HTTP methods.
HTTP Method The HTTP method to listen to when multiple methods are not allowed and webhook type is 'x402'.
HTTP Methods The HTTP methods to listen to when multiple methods are allowed and webhook type is 'x402'.
Path The path to listen to for incoming webhook requests, supporting dynamic values with ':' notation.
Respond When and how to respond to the webhook, options include immediately, when the last node finishes, or streaming.
Response Code The HTTP response code to return for the webhook response when webhook type is 'x402'.
Response Data What data should be returned in the response when webhook type is 'x402' and response mode is 'lastNode'.
Tokens The tokens that will be accepted for payment in the X402 payment-gated webhook type, including token name or ID, pay-to address, and minimum payment amount.
Options Additional options for the X402 webhook type, such as allowed origins (CORS), resource description, mime type, ignoring bots, IP whitelist, response body settings, raw body, custom response data, response content-type, response headers, property name for response data, and refunds contact email.

Output

JSON

  • body - The JSON body of the webhook request payload.
  • headers - The HTTP headers received with the webhook request.
  • query - The query parameters from the webhook request URL.
  • params - The dynamic path parameters extracted from the webhook URL.

Dependencies

  • An OAuth2 API credential for 1Shot API authentication

Troubleshooting

  • Ensure the correct public key is provided for ED-25519 signature verification to avoid authentication failures.
  • Verify that the payment tokens and amounts are correctly configured for the X402 payment-gated webhook to prevent unauthorized access.
  • Check that the HTTP methods and paths are correctly set to match incoming webhook requests.
  • If using streaming response mode, ensure the downstream nodes support streaming to avoid response issues.

Links

Discussion