Field NationDeveloper Platform
Field NationDeveloper Platform
IntroductionQuickstartAPI Playground

Documentation

API Reference OverviewWebhook Operations APIEvents APIDelivery Logs APIHistory API

Support

Migration Guide
API Reference

Delivery Logs API

Monitor webhook delivery attempts, access detailed logs, and retry failed deliveries programmatically.


Endpoints Overview

MethodEndpointDescription
GET/api/v1/webhooks/delivery-logsList delivery logs
GET/api/v1/webhooks/delivery-logs/{deliveryId}Get delivery details
PATCH/api/v1/webhooks/delivery-logs/{deliveryId}/retryRetry failed delivery

List Delivery Logs

Retrieve paginated list of webhook delivery attempts.

Request

GET /api/v1/webhooks/delivery-logs

Query Parameters:

Prop

Type

Description

webhookId?string

Filter by webhook ID

workOrderId?number

Filter by work order ID

eventName?string

Filter by event name

deliveryStatus?string

Filter by HTTP status code (e.g., '200', '500')

deliveryId?string

Filter by specific delivery ID

page?number

Page number (starts at 1)

perPage?number

Items per page (max 500)

sortBy?string

Sort by: deliveryId, webhookId, workOrderId, eventName, deliveryStatus, createdAt

sortDirection?string

ASC or DESC

Example Requests

curl -X GET "https://api-sandbox.fndev.net/api/v1/webhooks/delivery-logs?perPage=50" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
curl -X GET "https://api-sandbox.fndev.net/api/v1/webhooks/delivery-logs?deliveryStatus=500" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
curl -X GET "https://api-sandbox.fndev.net/api/v1/webhooks/delivery-logs?webhookId=wh_abc123" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
curl -X GET "https://api-sandbox.fndev.net/api/v1/webhooks/delivery-logs?workOrderId=12345" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

{
  "metadata": {
    "timestamp": "2025-01-15T12:00:00Z",
    "query": {
      "webhookId": "wh_abc123",
      "page": 1,
      "perPage": 50
    }
  },
  "result": [
    {
      "deliveryId": "del_xyz789",
      "webhookId": "wh_abc123",
      "workOrderId": 12345,
      "eventName": "workorder.status.published",
      "deliveryStatus": 200,
      "deliveryAttempt": 1,
      "createdAt": "2025-01-15T11:59:00Z"
    }
  ]
}

Get Delivery Details

Retrieve detailed information including pre-signed URL to complete log file.

Request

GET /api/v1/webhooks/delivery-logs/{deliveryId}

Example

curl -X GET https://api-sandbox.fndev.net/api/v1/webhooks/delivery-logs/del_xyz789 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

{
  "metadata": {
    "timestamp": "2025-01-15T12:00:00Z"
  },
  "result": {
    "deliveryId": "del_xyz789",
    "webhookId": "wh_abc123",
    "eventName": "workorder.status.published",
    "deliveryStatus": 200,
    "deliveryAttempt": 1,
    "createdAt": "2025-01-15T11:59:00Z",
    "delivery_log": "https://s3.amazonaws.com/fn-logs/del_xyz789?AWSAccessKeyId=...&Expires=1642252800&Signature=..."
  }
}

Delivery Logs Dashboard


Retry Failed Delivery

Manually retry a failed delivery attempt.

Request

PATCH /api/v1/webhooks/delivery-logs/{deliveryId}/retry

Example

curl -X PATCH https://api-sandbox.fndev.net/api/v1/webhooks/delivery-logs/del_xyz789/retry \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

{
  "metadata": {
    "timestamp": "2025-01-15T12:00:00Z"
  },
  "result": {
    "job_id": "job_abc123"
  }
}

Retry Delivery

The job_id can be used to track the retry attempt in delivery logs.


Code Examples

class DeliveryLogMonitor {
  constructor(accessToken) {
    this.accessToken = accessToken;
    this.baseUrl = 'https://api-sandbox.fndev.net';
  }

  async getLogs(filters = {}) {
    const params = new URLSearchParams(filters);
    const response = await fetch(
      `${this.baseUrl}/api/v1/webhooks/delivery-logs?${params}`,
      {
        headers: { 'Authorization': `Bearer ${this.accessToken}` }
      }
    );
    return await response.json();
  }

  async getDeliveryDetails(deliveryId) {
    const response = await fetch(
      `${this.baseUrl}/api/v1/webhooks/delivery-logs/${deliveryId}`,
      {
        headers: { 'Authorization': `Bearer ${this.accessToken}` }
      }
    );
    return await response.json();
  }

  async retryDelivery(deliveryId) {
    const response = await fetch(
      `${this.baseUrl}/api/v1/webhooks/delivery-logs/${deliveryId}/retry`,
      {
        method: 'PATCH',
        headers: { 'Authorization': `Bearer ${this.accessToken}` }
      }
    );
    return await response.json();
  }

  async getFailedDeliveries(webhookId, hours = 24) {
    const since = new Date(Date.now() - hours * 60 * 60 * 1000).toISOString();

    const logs = await this.getLogs({
      webhookId,
      sortBy: 'createdAt',
      sortDirection: 'DESC'
    });

    return logs.result.filter(log =>
      log.deliveryStatus >= 400 &&
      new Date(log.createdAt) >= new Date(since)
    );
  }

  async retryAllFailed(webhookId) {
    const failed = await this.getFailedDeliveries(webhookId);

    const results = [];
    for (const log of failed) {
      try {
        const result = await this.retryDelivery(log.deliveryId);
        results.push({ deliveryId: log.deliveryId, success: true, jobId: result.result.job_id });
      } catch (error) {
        results.push({ deliveryId: log.deliveryId, success: false, error: error.message });
      }
    }

    return results;
  }
}

// Usage
const monitor = new DeliveryLogMonitor(accessToken);

// Get failed deliveries
const failed = await monitor.getFailedDeliveries('wh_abc123', 24);
console.log(`${failed.length} failed deliveries in last 24 hours`);

// Retry all failed
const results = await monitor.retryAllFailed('wh_abc123');
console.log(`Retried ${results.length} deliveries`);

Last updated on

Events API

List and discover available webhook events with filtering by model type. Programmatically retrieve all 33 webhook events.

History API

Access webhook change history and audit trail. Track all modifications with user, timestamp, and change details.

On this page

Endpoints Overview
List Delivery Logs
Request
Example Requests
Response
Get Delivery Details
Request
Example
Response
Retry Failed Delivery
Request
Example
Response
Code Examples