### Before User Created Hook Setup Source: https://docs.notifuse.com/integrations/supabase Details the setup process for the Before User Created Hook to sync new Supabase users to Notifuse. ```APIDOC ## Before User Created Hook The Before User Created Hook automatically adds new Supabase users to your Notifuse contact database. ### Setup 1. Toggle on **Before User Created Hook** 2. Generate a webhook secret key in Supabase (different from the auth email hook) 3. Copy the secret key in the Notifuse Supabase integration form 4. (Optional) Select a contact list to automatically add new users to 5. (Optional) Reject disposable email addresses (e.g: @yopmail.com) ``` -------------------------------- ### Example Signup Confirmation Template Source: https://docs.notifuse.com/integrations/supabase Provides an example of an MJML template for signup confirmation emails. ```APIDOC ## Example Template Here's an example signup confirmation template with the correct URL format: ```mjml Welcome! Please confirm your email address by clicking the link below: Confirm Email If you did not sign up for this account, you can ignore this email. ``` ``` -------------------------------- ### Example Signup Confirmation Email Template (MJML) Source: https://docs.notifuse.com/integrations/supabase An example of a signup confirmation email template using MJML, demonstrating how to embed the confirmation URL and provide a user-friendly interface. ```mjml Welcome! Please confirm your email address by clicking the link below: Confirm Email If you did not sign up for this account, you can ignore this email. ``` -------------------------------- ### Start Notifuse with Embedded PostgreSQL using Docker Compose Source: https://docs.notifuse.com/installation This snippet demonstrates how to set up and run Notifuse with an embedded PostgreSQL database using Docker Compose. It involves cloning a configuration file and starting the services in detached mode. This method is recommended for testing and development. ```bash curl -O https://raw.githubusercontent.com/notifuse/notifuse/main/compose.yaml docker compose up -d ``` -------------------------------- ### Liquid Post Variables Example Source: https://docs.notifuse.com/blog/theme Provides examples of Liquid variables available for iterating through posts on home and category pages. It includes post details and author information. ```liquid {% for post in posts %} {{ post.id }} {{ post.slug }} {{ post.category_slug }} {{ post.title }} {{ post.excerpt }} {{ post.featured_image_url }} {{ post.published_at }} {{ post.reading_time_minutes }} {% for author in post.authors %} {{ author.name }} {{ author.avatar_url }} {% endfor %} {% endfor %} ``` -------------------------------- ### Complete Liquid Email Template Example Source: https://docs.notifuse.com/concepts/templates A comprehensive example demonstrating the integration of contact variables, list variables, and system URLs within a single Liquid email template for a welcome message. ```liquid Welcome {{ contact.first_name }}! Thank you for subscribing to {{ list.name }}. We're excited to have you on board! Your registered email: {{ contact.email }} Manage Preferences: {{ notification_center_url }} Don't want to receive these emails? Unsubscribe here: {{ unsubscribe_url }} ``` -------------------------------- ### Complete Example: API Request, Contact Profile, and Template Output Source: https://docs.notifuse.com/concepts/transactional-api This comprehensive example illustrates the interaction between an API request, an existing contact profile, and how the data is rendered in an email template. It shows the structure of the API payload, the details of a contact's profile, and the final personalized email content, including iterating over a list of items. ```json **API Request** : ```json { "workspace_id": "your_workspace", "notification": { "id": "order_confirmation", "external_id": "order-12345-confirmation", "contact": { "email": "sarah@example.com" }, "data": { "order_id": "ORD-12345", "total": "$99.99", "items": ["Product A", "Product B"] }, "metadata": { "campaign_id": "order-confirmations", "source": "checkout" } } } ``` **Existing Contact Profile** : ```json { "first_name": "Sarah", "last_name": "Johnson", "email": "sarah@example.com", "phone": "+1234567890" } ``` **Available in Template** : ```html Hi {{ contact.first_name }}! Your order #{{ order_id }} totaling {{ total }} has been confirmed. Items: {% for item in items %} - {{ item }} {% endfor %} We'll send updates to {{ contact.email }}. ``` ``` -------------------------------- ### Install Certbot on Ubuntu/Debian Source: https://docs.notifuse.com/installation Shell commands to install Certbot, a tool for automatically enabling HTTPS by encrypting and renewing certificates from Let's Encrypt. This is a prerequisite for setting up production SMTP relay with TLS. ```bash sudo apt-get update sudo apt-get install certbot ``` -------------------------------- ### Complete Transactional Email Example (API Request and Template Data) Source: https://docs.notifuse.com/features/transactional-api Provides a comprehensive example of an API request for an order confirmation, including contact and data fields. It also shows the corresponding existing contact profile and how this data is made available in a Liquid template. ```json { "workspace_id": "your_workspace", "notification": { "id": "order_confirmation", "external_id": "order-12345-confirmation", "contact": { "email": "sarah@example.com" }, "data": { "order_id": "ORD-12345", "total": "$99.99", "items": ["Product A", "Product B"] }, "metadata": { "campaign_id": "order-confirmations", "source": "checkout" } } } ``` ```json { "first_name": "Sarah", "last_name": "Johnson", "email": "sarah@example.com", "phone": "+1234567890" } ``` ```liquid Hi {{ contact.first_name }}! Your order #{{ order_id }} totaling {{ total }} has been confirmed. Items: {% for item in items %} - {{ item }} {% endfor %} We'll send updates to {{ contact.email }}. ``` -------------------------------- ### Generic Payload Structure and Examples Source: https://docs.notifuse.com/features/webhooks Provides the general structure of all webhook payloads and specific examples for 'contact.created', 'segment.joined', and other events. ```APIDOC ## Payload Structure All webhook payloads follow this common structure: ### Common Fields | Field | Description | | -------------- | -------------------------------------------- | | `id` | Unique identifier for the webhook delivery | | `type` | The event type that triggered the webhook | | `timestamp` | ISO 8601 timestamp when the webhook was sent | | `workspace_id` | The workspace where the event occurred | | `data` | Event-specific payload data | ### Example: Contact Created ```json { "id": "delivery_abc123", "type": "contact.created", "timestamp": "2024-01-15T10:30:00Z", "workspace_id": "ws_1234567890", "data": { "email": "user@example.com", "id": "contact_12345", "external_id": "ext_67890", "first_name": "John", "last_name": "Doe", "tags": ["newsletter", "customer"], "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" } } ``` ### Example: Segment Joined ```json { "id": "delivery_jkl012", "type": "segment.joined", "timestamp": "2024-01-15T10:30:00Z", "workspace_id": "ws_1234567890", "data": { "email": "user@example.com", "contact_id": "contact_12345", "segment_id": "seg_vip_customers", "segment_name": "VIP Customers", "created_at": "2024-01-15T10:30:00Z" } } ``` ``` -------------------------------- ### Liquid Global Variables Example Source: https://docs.notifuse.com/blog/theme Shows examples of globally available Liquid variables that can be used across all theme pages. These variables provide access to workspace and theme-specific information. ```liquid {{ workspace.id }} {{ workspace.name }} {{ workspace.blog_title }} {{ workspace.logo_url }} {{ workspace.icon_url }} {{ base_url }} {{ current_year }} {{ theme.version }} ``` -------------------------------- ### Get LLM Navigation and Pages Source: https://docs.notifuse.com/api-reference/get-a-broadcast Fetches navigation and other pages from the Notifuse documentation. ```APIDOC ## GET /llms.txt ### Description Fetches the `llms.txt` file, which contains navigation and other page information for the Notifuse documentation. ### Method GET ### Endpoint /llms.txt ### Parameters None ### Request Example None ### Response #### Success Response (200) - **content** (string) - The content of the `llms.txt` file, typically containing navigation links and page data. #### Response Example ```json { "navigation": [ { "title": "Home", "url": "/" }, { "title": "API Documentation", "url": "/api" } ], "pages": { "/": { "title": "Welcome to Notifuse", "content": "..." }, "/api": { "title": "API Documentation", "content": "..." } } } ``` ``` -------------------------------- ### Custom CSS Example Source: https://docs.notifuse.com/blog/theme Placeholder for custom CSS to style the blog. This file allows users to override default theme styles. ```css /* Add your custom CSS here */ body { font-family: sans-serif; } ``` -------------------------------- ### Custom JavaScript Example Source: https://docs.notifuse.com/blog/theme Placeholder for custom JavaScript to add interactivity to the blog. This file can be used for dynamic features. ```javascript // Add your custom JavaScript here console.log('Theme script loaded.'); ``` -------------------------------- ### Liquid Templating Syntax Example Source: https://docs.notifuse.com/blog/theme Demonstrates basic Liquid templating syntax for displaying blog titles and iterating through posts. This requires no external dependencies and outputs HTML content based on available post data. ```liquid

{{ workspace.blog_title }}

{% for post in posts %}

{{ post.title }}

{{ post.excerpt }}

{% endfor %} ``` -------------------------------- ### GET /api/templates.get Source: https://docs.notifuse.com/api-reference/get-a-template Retrieves a single template by its ID. You can optionally specify a version number to get a particular version of the template. This endpoint is crucial for fetching template content for use in communications. ```APIDOC ## GET /api/templates.get ### Description Retrieves a single template by ID. Optionally specify a version number to retrieve a specific version. ### Method GET ### Endpoint /api/templates.get ### Parameters #### Query Parameters - **workspace_id** (string) - Required - The ID of the workspace - **id** (string) - Required - The ID of the template - **version** (integer) - Optional - Specific version number (defaults to latest) ### Request Example ```json { "workspace_id": "ws_1234567890", "id": "welcome_email", "version": 1 } ``` ### Response #### Success Response (200) - **template** (object) - Contains the template details, including its ID, name, version, channel, content (email/web), category, and timestamps. #### Response Example ```json { "template": { "id": "welcome_email", "name": "Welcome Email", "version": 1, "channel": "email", "email": { "subject": "Welcome to Notifuse!", "body": "

Hello {{user_name}}!

Thanks for signing up.

" }, "category": "transactional", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } } ``` #### Error Response (400, 401, 404, 500) - **error** (string) - Description of the error (e.g., "Template not found") ``` -------------------------------- ### Fetch Navigation and Other Pages Source: https://docs.notifuse.com/api-reference/list-webhook-subscriptions Instructions on how to fetch the 'llms.txt' file to find navigation and other pages. ```APIDOC ## Fetch Navigation and Other Pages ### Description To find navigation and other pages in this documentation, fetch the llms.txt file from the specified URL. ### Method GET ### Endpoint `https://docs.notifuse.com/llms.txt` ### Response #### Success Response (200) - **content** (string) - The content of the llms.txt file, which may contain links or references to other pages. #### Response Example ``` # Content of llms.txt - /websites/notifuse/navigation - /websites/notifuse/settings ``` ``` -------------------------------- ### Install Certbot on macOS Source: https://docs.notifuse.com/installation Homebrew command to install Certbot on macOS. Certbot is used for obtaining and renewing Let's Encrypt certificates, essential for securing SMTP relay in production environments. ```bash brew install certbot ``` -------------------------------- ### Start Notifuse Standalone Docker for Production Source: https://docs.notifuse.com/installation This command shows how to run Notifuse as a standalone Docker container. This approach requires a separate PostgreSQL database to be provided. It's suitable for production environments where more control over the database is needed. ```bash docker run -d --name notifuse -p 8080:8080 notifuse/notifuse:latest ``` -------------------------------- ### Fetch Navigation and Pages Source: https://docs.notifuse.com/api-reference/batch-import-contacts Fetches navigation and other pages from the documentation. ```APIDOC ## GET /websites/notifuse/llms.txt ### Description Fetches navigation and other pages from the documentation. ### Method GET ### Endpoint /websites/notifuse/llms.txt ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **content** (string) - The content of the llms.txt file. #### Response Example ``` { "content": "(content of llms.txt)" } ``` ``` -------------------------------- ### Install Certbot on CentOS/RHEL Source: https://docs.notifuse.com/installation Shell commands to install Certbot on CentOS or RHEL systems. Certbot is a critical tool for managing Let's Encrypt certificates, enabling secure TLS connections for SMTP relay. ```bash sudo yum install certbot ``` -------------------------------- ### Template Variables Example (JSON) Source: https://docs.notifuse.com/concepts/transactional-api This JSON snippet shows an example of the `data` object structure, which contains variables that can be accessed within your email templates. These variables are used to personalize email content. ```json { "data": { "order_id": "ORD-12345", "total": "$99.99", "discount_code": "WELCOME20" } } ``` -------------------------------- ### Develop with Self-Signed Certificates using OpenSSL Source: https://docs.notifuse.com/installation This snippet demonstrates how to generate self-signed certificates for local development using OpenSSL. It creates a certificate and a private key, then encodes them to base64. These are intended for development environments only and should not be used in production. ```bash # Using the provided script ./scripts/generate-dev-certs.sh localapi.notifuse.com # Or manually with openssl openssl req -x509 -newkey rsa:2048 \ -keyout dev-cert.key.pem \ -out dev-cert.cert.pem \ -days 365 -nodes \ -subj "/CN=localhost" \ -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" # Encode to base64 cat dev-cert.cert.pem | base64 > cert_base64.txt cat dev-cert.key.pem | base64 > key_base64.txt ``` -------------------------------- ### Order Confirmation External ID Example Source: https://docs.notifuse.com/concepts/transactional-api This JSON snippet shows an example `external_id` format for an order confirmation notification. It is used to uniquely identify an order confirmation event. Consistent formatting helps in preventing duplicate notifications. ```json { "external_id": "order-12345-confirmation" } ``` -------------------------------- ### Data Fetching Source: https://docs.notifuse.com/api-reference/toggle-webhook-subscription-enabled-state Instructions on how to fetch navigation and other pages. ```APIDOC ## Fetch Navigation and Pages ### Description To retrieve navigation and other pages within the documentation, fetch the `llms.txt` file from the specified URL. ### Endpoint - **URL**: `https://docs.notifuse.com/llms.txt` ### Method - `GET` ``` -------------------------------- ### Welcome Email External ID Example Source: https://docs.notifuse.com/concepts/transactional-api This JSON snippet illustrates an example `external_id` for a welcome email notification. It typically includes a user identifier for uniqueness. This consistent `external_id` helps ensure that welcome emails are not sent multiple times. ```json { "external_id": "welcome-user123" } ``` -------------------------------- ### POST /api/templates.create Source: https://docs.notifuse.com/api-reference/create-a-template Creates a new template. Each template must have a channel (email or web) with corresponding channel-specific content. ```APIDOC ## POST /api/templates.create ### Description Creates a new template. Each template must have a channel (email or web) with corresponding channel-specific content. ### Method POST ### Endpoint /api/templates.create ### Parameters #### Request Body - **workspace_id** (string) - Required - The ID of the workspace - **id** (string) - Required - Unique identifier for the template (alphanumeric, underscores, and hyphens only) - **name** (string) - Required - Name of the template - **channel** (string) - Required - Communication channel (email or web) - **email** (object) - Optional - Email channel content - **web** (object) - Optional - Web channel content - **category** (string) - Required - Template category (marketing, transactional, welcome, opt_in, unsubscribe, bounce, blocklist, blog, other) - **template_macro_id** (string) - Optional - ID of the template macro (layout) to use - **test_data** (object) - Optional - Test data for template preview - **settings** (object) - Optional - Channel-specific settings ### Request Example ```json { "workspace_id": "ws_1234567890", "id": "welcome_email", "name": "Welcome Email", "channel": "email", "email": { "subject": "Welcome to Notifuse!", "body": "

Hi {{name}},

Welcome to our service!

" }, "category": "welcome" } ``` ### Response #### Success Response (201) - **template** (object) - Details of the created template #### Response Example ```json { "template": { "id": "welcome_email", "name": "Welcome Email", "version": 1, "channel": "email", "email": { "subject": "Welcome to Notifuse!", "body": "

Hi {{name}},

Welcome to our service!

" }, "category": "welcome" } } ``` #### Error Response (400) - **error** (string) - Description of the error #### Error Response Example ```json { "error": "Template id already exists" } ``` ``` -------------------------------- ### Password Reset External ID Example Source: https://docs.notifuse.com/concepts/transactional-api This JSON snippet demonstrates an example `external_id` for a password reset notification. The format includes user identification and a date stamp for uniqueness. This pattern aids in managing and preventing duplicate password reset requests. ```json { "external_id": "pwd-reset-user123-20240101" } ``` -------------------------------- ### Get Notifuse Template by ID Source: https://docs.notifuse.com/api-reference/get-a-template Retrieves a single Notifuse email or newsletter template by its ID. This GET request can optionally specify a version number to fetch a particular revision. It requires workspace_id and template id as query parameters. Response includes template details or error information. ```yaml openapi: 3.0.3 info: title: Notifuse API description: API for Notifuse - a transactional email and newsletter management platform version: 1.0.0 contact: name: Notifuse Support url: https://www.notifuse.com/support email: hello@notifuse.com servers: - url: https://{notifuseDomain} description: Customer-specific Notifuse API server variables: notifuseDomain: description: Your unique Notifuse domain default: demo.notifuse.com security: [] paths: /api/templates.get: get: summary: Get a template description: >- Retrieves a single template by ID. Optionally specify a version number to retrieve a specific version. operationId: getTemplate parameters: - name: workspace_id in: query required: true schema: type: string description: The ID of the workspace example: ws_1234567890 - name: id in: query required: true schema: type: string description: The ID of the template example: welcome_email - name: version in: query required: false schema: type: integer format: int64 description: Specific version number (defaults to latest) example: 1 responses: '200': description: Template retrieved successfully content: application/json: schema: type: object properties: template: $ref: '#/components/schemas/Template' '400': description: Bad request - validation failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': description: Unauthorized - invalid or missing authentication token content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Template not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: error: Template not found '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' security: - BearerAuth: [] components: schemas: Template: type: object properties: id: type: string description: >- Unique identifier for the template (alphanumeric, underscores, and hyphens only) example: welcome_email maxLength: 32 pattern: '^[a-zA-Z0-9_-]+$' name: type: string description: Name of the template example: Welcome Email maxLength: 32 version: type: integer format: int64 description: Version number of the template example: 1 channel: type: string enum: - email - web description: Communication channel example: email email: $ref: '#/components/schemas/EmailTemplate' web: $ref: '#/components/schemas/WebTemplate' category: type: string enum: - marketing - transactional - welcome - opt_in - unsubscribe - bounce - blocklist - blog - other description: Template category example: transactional maxLength: 20 template_macro_id: type: string nullable: true description: ID of the template macro (layout) to use integration_id: type: string nullable: true description: ID of the integration managing this template (e.g., Supabase) test_data: type: object additionalProperties: true description: Test data for template preview example: user_name: John Doe action_url: https://example.com/action settings: type: object additionalProperties: true description: Channel-specific third-party settings created_at: type: string format: date-time description: When the template was created updated_at: type: string format: date-time description: When the template was last updated deleted_at: type: string format: date-time nullable: true description: When the template was deleted (null if active) required: ``` -------------------------------- ### Website Configuration Source: https://docs.notifuse.com/api-reference/list-broadcasts This section details the structure for website configurations, including UTM parameters and broadcast variation settings. ```APIDOC ## Website Configuration Details ### Description Provides details on website configurations, including tracking parameters and broadcast variation schemas. ### Parameters #### Request Body - **campaign** (object) - Optional - UTM campaign parameter - **medium** (string) - Optional - UTM medium parameter - **campaign** (string) - Optional - UTM campaign parameter - **term** (string) - Optional - UTM term parameter - **content** (string) - Optional - UTM content parameter - **BroadcastVariation** (object) - Required - Represents a variation of a broadcast message. - **variation_name** (string) - Optional - Name of this variation - **template_id** (string) - Required - Template ID for this variation - **metrics** (object) - Optional - Metrics for this variation (see VariationMetrics schema) - **template** (object) - Optional - Full template object (populated when with_templates=true) ### Response #### Success Response (200) - **BroadcastVariation** (object) - Details of the broadcast variation. - **VariationMetrics** (object) - Metrics associated with the broadcast variation. - **recipients** (integer) - Number of recipients - **delivered** (integer) - Number of delivered messages - **opens** (integer) - Number of opens - **clicks** (integer) - Number of clicks - **bounced** (integer) - Number of bounces - **complained** (integer) - Number of complaints - **unsubscribed** (integer) - Number of unsubscribes ``` -------------------------------- ### Notifuse API - Error Response Examples Source: https://docs.notifuse.com/api-reference/authentication/root-user-programmatic-signin Examples of error responses from the Notifuse API, covering scenarios like missing required fields, invalid JSON bodies, unauthorized credentials, and rate limiting. These responses provide specific error messages to help diagnose issues. ```json { "error": "Missing required fields: email, timestamp, signature" } ``` ```json { "error": "Invalid request body" } ``` ```json { "error": "Invalid credentials" } ``` ```json { "error": "Method not allowed" } ``` -------------------------------- ### Notifuse Endpoints Overview Source: https://docs.notifuse.com/api-reference/introduction This section provides an overview of the available Notifuse API endpoints. For detailed information on each endpoint, including parameters, request/response formats, and examples, please refer to the OpenAPI specification file. ```APIDOC ## Notifuse API Endpoints ### Description This API allows interaction with the Notifuse service for various functionalities. The complete list of endpoints, their methods, parameters, and request/response schemas can be found in the OpenAPI specification. ### Method All standard HTTP methods (GET, POST, PUT, DELETE, etc.) are supported depending on the specific endpoint. ### Endpoint Endpoints follow the base path `/websites/notifuse`. ### Authentication All API endpoints are authenticated using Bearer tokens. Include your token in the `Authorization` header as `Bearer YOUR_TOKEN`. ### Request Example ```json { "example": "Authorization: Bearer YOUR_API_TOKEN" } ``` ### Response Responses vary based on the endpoint used. Refer to the OpenAPI specification for details on success and error responses for each endpoint. ### Further Information For a comprehensive list of all available endpoints and their specific details, please consult the [OpenAPI specification file](https://github.com/notifuse/notifuse/openapi.json). ``` -------------------------------- ### GET /api/templates.list Source: https://docs.notifuse.com/api-reference/list-templates Retrieves a list of all templates in the workspace. Supports optional filtering by category and channel. ```APIDOC ## GET /api/templates.list ### Description Retrieves a list of all templates in the workspace. Supports optional filtering by category and channel. ### Method GET ### Endpoint /api/templates.list ### Parameters #### Query Parameters - **workspace_id** (string) - Required - The ID of the workspace - **category** (string) - Optional - Filter templates by category. Allowed values: marketing, transactional, welcome, opt_in, unsubscribe, bounce, blocklist, blog, other - **channel** (string) - Optional - Filter templates by channel. Allowed values: email, web ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **templates** (array) - List of templates retrieved successfully - **id** (string) - Unique identifier for the template - **name** (string) - Name of the template - **version** (integer) - Version number of the template - **channel** (string) - Communication channel - **email** (object) - Email template details - **web** (object) - Web template details - **category** (string) - Template category - **template_macro_id** (string) - ID of the template macro (layout) to use - **integration_id** (string) - ID of the integration managing this template - **test_data** (object) - Test data for template preview - **settings** (object) - Channel-specific third-party settings - **created_at** (string) - When the template was created - **updated_at** (string) - When the template was last updated #### Response Example ```json { "templates": [ { "id": "welcome_email", "name": "Welcome Email", "version": 1, "channel": "email", "email": { "subject": "Welcome to Notifuse!", "body": "

Welcome!

Thank you for signing up.

" }, "category": "welcome", "created_at": "2023-01-01T12:00:00Z", "updated_at": "2023-01-01T12:00:00Z" } ] } ``` #### Error Response (400) - **error** (string) - Description of the error #### Error Response Example ```json { "error": "workspace_id is required" } ``` #### Error Response (401) - **error** (string) - Description of the error #### Error Response (500) - **error** (string) - Description of the error #### Error Response Example ```json { "error": "Failed to get templates" } ``` ``` -------------------------------- ### GET /api/webhookSubscriptions.deliveries Source: https://docs.notifuse.com/api-reference/get-webhook-delivery-history Returns the delivery history for a webhook subscription, including status and response information. ```APIDOC ## GET /api/webhookSubscriptions.deliveries ### Description Returns the delivery history for a webhook subscription, including status and response information. ### Method GET ### Endpoint /api/webhookSubscriptions.deliveries ### Parameters #### Query Parameters - **workspace_id** (string) - Required - The ID of the workspace - **subscription_id** (string) - Optional - The ID of the webhook subscription (if not provided, returns all deliveries for the workspace) - **limit** (integer) - Optional - Number of deliveries to return (1-100). Defaults to 20. - **offset** (integer) - Optional - Offset for pagination. Defaults to 0. ### Request Example ```json { "example": "GET /api/webhookSubscriptions.deliveries?workspace_id=ws_1234567890&subscription_id=whsub_a1b2c3d4e5f6&limit=20&offset=0" } ``` ### Response #### Success Response (200) - **deliveries** (array) - List of webhook deliveries. Each delivery contains: - **id** (string) - Unique identifier for the delivery. - **subscription_id** (string) - ID of the subscription this delivery belongs to. - **event_type** (string) - Type of event that triggered the delivery. - **payload** (object) - The JSON payload sent in the webhook. - **status** (string) - Current status of the delivery (pending, delivering, delivered, failed). - **attempts** (integer) - Number of delivery attempts made. - **max_attempts** (integer) - Maximum number of retry attempts. - **next_attempt_at** (string) - When the next retry will be attempted (date-time format). - **last_attempt_at** (string) - When the last delivery attempt was made (date-time format). - **total** (integer) - Total number of deliveries. - **limit** (integer) - Number of deliveries per page. - **offset** (integer) - Offset for pagination. #### Response Example ```json { "example": "{\n \"deliveries\": [\n {\n \"id\": \"whdel_x1y2z3\",\n \"subscription_id\": \"whsub_a1b2c3d4e5f6\",\n \"event_type\": \"contact.created\",\n \"payload\": {\n \"contact_id\": \"cont_abcdef123456\"\n },\n \"status\": \"delivered\",\n \"attempts\": 1,\n \"max_attempts\": 10,\n \"next_attempt_at\": null,\n \"last_attempt_at\": \"2024-01-15T10:30:00Z\"\n }\n ],\n \"total\": 150,\n \"limit\": 20,\n \"offset\": 0\n}" } ``` #### Error Response (400) - **error** (string) - Error message (e.g., "workspace_id is required") #### Error Response (401) - **error** (string) - Error message (e.g., "Unauthorized - invalid or missing authentication token") #### Error Response (500) - **error** (string) - Error message (e.g., "Internal server error") ``` -------------------------------- ### Expose Local Server with ngrok (Bash) Source: https://docs.notifuse.com/features/webhooks This bash command demonstrates how to use `ngrok` to expose a local development server (running on port 3000) to the internet. The output provides a public URL that can be used as a webhook endpoint during local testing. This is essential for developing and debugging webhook integrations without deploying to production. ```bash # Start ngrok ngrok http 3000 # Use the ngrok URL as your webhook endpoint # https://abc123.ngrok.io/webhooks/notifuse ```