{
  "openapi": "3.1.0",
  "info": {
    "title": "Workflow Fieldwork catalog",
    "version": "1.0.0",
    "contact": {
      "email": "hello@runwithlap.com"
    },
    "description": "Discover workflow services, run free checks, and pay for supported direct jobs using x402."
  },
  "servers": [
    {
      "url": "https://workflowfieldwork.com"
    }
  ],
  "paths": {
    "/catalog.json": {
      "get": {
        "operationId": "getRepairCatalog",
        "security": [],
        "summary": "List AI agent and n8n workflow repair offers",
        "responses": {
          "200": {
            "description": "Current USDC prices, buyer inputs and marketplace references",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "offers"
                  ],
                  "properties": {
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "price_usdc",
                          "listing_url",
                          "required_inputs",
                          "deliverable"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "price_usdc": {
                            "type": "number",
                            "minimum": 0
                          },
                          "listing_url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "required_inputs": {
                            "type": "string"
                          },
                          "deliverable": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/job-demand": {
      "post": {
        "operationId": "recordJobDemand",
        "security": [],
        "summary": "Request a job without placing an order",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "request_id",
                  "category",
                  "intent"
                ],
                "properties": {
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "category": {
                    "type": "string",
                    "description": "Category from POST /api/triage with an empty JSON object"
                  },
                  "intent": {
                    "type": "string",
                    "enum": [
                      "exploring",
                      "ready_to_buy"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching request already recorded"
          },
          "201": {
            "description": "Demand recorded"
          },
          "400": {
            "description": "Invalid demand request"
          },
          "409": {
            "description": "Request ID already used for another selection"
          },
          "429": {
            "description": "Daily demand limit reached"
          }
        }
      }
    },
    "/api/triage": {
      "post": {
        "operationId": "triageJob",
        "security": [],
        "summary": "List problem categories or find a repair offer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Available categories or a repair or scope-review route"
          },
          "400": {
            "description": "Invalid or unknown category"
          }
        }
      }
    },
    "/api/x402/reconcile-exports": {
      "post": {
        "operationId": "reconcileExports",
        "summary": "Compare two redacted JSON exports",
        "x-fieldwork-payment": {
          "service_id": "reconcile-exports",
          "method": "POST",
          "api_path": "/api/x402/reconcile-exports",
          "browser_path": "/checkout/reconcile/",
          "protocol": "x402-v2",
          "scheme": "exact",
          "price_usdc": 1,
          "network": "eip155:8453",
          "agent_example_path": "/agents/reconcile-agent.txt",
          "payment_challenge_header": "PAYMENT-REQUIRED",
          "payment_authorization_header": "PAYMENT-SIGNATURE",
          "payment_receipt_header": "PAYMENT-RESPONSE",
          "max_body_bytes": 16384,
          "max_rows_per_export": 100,
          "api_url": "https://workflowfieldwork.com/api/x402/reconcile-exports"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "1.00"
          }
        },
        "description": "Direct x402 pilot when enabled. Costs 1 USDC on Base. Send the same request body with the signed payment. If settlement is uncertain, retain the same signature and body. Maximum request size 16 KiB.",
        "parameters": [
          {
            "in": "header",
            "name": "PAYMENT-SIGNATURE",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "before",
                  "after"
                ],
                "properties": {
                  "id_key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "default": "id"
                  },
                  "before": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object"
                    }
                  },
                  "after": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object"
                    }
                  }
                }
              },
              "example": {
                "before": [
                  {
                    "id": "1",
                    "status": "open"
                  }
                ],
                "after": [
                  {
                    "id": "1",
                    "status": "closed"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Missing, duplicate, invalid and changed records",
            "headers": {
              "PAYMENT-RESPONSE": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input"
          },
          "402": {
            "description": "x402 v2 payment requirements",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Authorization is bound to a different request"
          },
          "413": {
            "description": "Over 16 KiB or more than 100 rows per export. The response links to custom quotes."
          },
          "415": {
            "description": "Unsupported media type"
          },
          "429": {
            "description": "Verification capacity or settlement limit reached",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Checkout disabled or settlement could not be confirmed"
          }
        }
      }
    },
    "/api/check-duplicate-ids": {
      "post": {
        "operationId": "checkDuplicateIds",
        "security": [],
        "summary": "Find duplicate and missing IDs in redacted JSON rows",
        "description": "Free deterministic check. Maximum request size 16 KiB.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rows"
                ],
                "properties": {
                  "id_key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "default": "id"
                  },
                  "rows": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object"
                    }
                  }
                }
              },
              "example": {
                "id_key": "id",
                "rows": [
                  {
                    "id": "evt-1"
                  },
                  {
                    "id": "evt-1"
                  },
                  {}
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Duplicate and missing IDs by one-based row number",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows_checked": {
                      "type": "integer"
                    },
                    "duplicate_rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "row": {
                            "type": "integer"
                          },
                          "first_row": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "missing_or_invalid_id_rows": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or unsupported rows"
          },
          "413": {
            "description": "Request body too large"
          },
          "415": {
            "description": "Unsupported media type"
          }
        }
      }
    }
  }
}
