{
  "openapi": "3.1.0",
  "info": {
    "title": "CAPPZ paid agents (silwa.duckdns.org, mainnet)",
    "version": "1.0.0",
    "description": "Pay-per-job agents paid in XRP on the XRP Ledger (mainnet) to rhszv2Ghe8NbqPDmmdJvJ4Cq2E3hjfYnYh. Results are signed with Ed25519 key 3e9de0c5da28792ebe2ad16e1921aae96b36eb79138af0d0f0926f64f3dee742. No auth: pay each stage with its destinationTag. Guide: https://silwa.duckdns.org/agents/  llms.txt: https://silwa.duckdns.org/agents/llms.txt"
  },
  "servers": [
    {
      "url": "https://silwa.duckdns.org/agents"
    }
  ],
  "paths": {
    "/timestamp/agent": {
      "get": {
        "summary": "Agent card: price, stages, payTo, network, signer",
        "responses": {
          "200": {
            "description": "Card"
          }
        }
      }
    },
    "/timestamp/jobs": {
      "post": {
        "summary": "Open a job",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "object",
                    "required": [
                      "sha256"
                    ],
                    "properties": {
                      "sha256": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{64}$"
                      },
                      "note": {
                        "type": "string",
                        "maxLength": 200
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Opened",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          },
          "422": {
            "description": "Bad input"
          }
        }
      }
    },
    "/timestamp/jobs/{jobId}": {
      "get": {
        "summary": "Job state",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          }
        }
      }
    },
    "/timestamp/jobs/{jobId}/payments": {
      "post": {
        "summary": "Report a payment (optional: payments are matched automatically within ~15 s)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "txHash"
                ],
                "properties": {
                  "txHash": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded"
          },
          "409": {
            "description": "Not a validated payment of this stage, or already used"
          }
        }
      }
    },
    "/timestamp/jobs/{jobId}/retry": {
      "post": {
        "summary": "Retry failed work (paid stages stay paid)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job"
          }
        }
      }
    },
    "/timestamp/jobs/{jobId}/stages/{n}/result": {
      "get": {
        "summary": "Stage result: 402 until paid, then the bytes (header x-result-sha256)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (signed)"
          },
          "402": {
            "description": "Payment required: { message, resultSha256, pay: { amount, currency, destination, destinationTag, preparedTx } }"
          },
          "409": {
            "description": "Not ready yet"
          }
        }
      }
    },
    "/webhook/agent": {
      "get": {
        "summary": "Agent card: price, stages, payTo, network, signer",
        "responses": {
          "200": {
            "description": "Card"
          }
        }
      }
    },
    "/webhook/jobs": {
      "post": {
        "summary": "Open a job",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string",
                        "maxLength": 100
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Opened",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          },
          "422": {
            "description": "Bad input"
          }
        }
      }
    },
    "/webhook/jobs/{jobId}": {
      "get": {
        "summary": "Job state",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          }
        }
      }
    },
    "/webhook/jobs/{jobId}/payments": {
      "post": {
        "summary": "Report a payment (optional: payments are matched automatically within ~15 s)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "txHash"
                ],
                "properties": {
                  "txHash": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded"
          },
          "409": {
            "description": "Not a validated payment of this stage, or already used"
          }
        }
      }
    },
    "/webhook/jobs/{jobId}/retry": {
      "post": {
        "summary": "Retry failed work (paid stages stay paid)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job"
          }
        }
      }
    },
    "/webhook/jobs/{jobId}/stages/{n}/result": {
      "get": {
        "summary": "Stage result: 402 until paid, then the bytes (header x-result-sha256)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (signed)"
          },
          "402": {
            "description": "Payment required: { message, resultSha256, pay: { amount, currency, destination, destinationTag, preparedTx } }"
          },
          "409": {
            "description": "Not ready yet"
          }
        }
      }
    },
    "/draw/agent": {
      "get": {
        "summary": "Agent card: price, stages, payTo, network, signer",
        "responses": {
          "200": {
            "description": "Card"
          }
        }
      }
    },
    "/draw/jobs": {
      "post": {
        "summary": "Open a job",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "object",
                    "description": "Either entries, or entriesSha256 with count.",
                    "properties": {
                      "entries": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 10000,
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "description": "The list; each entry is one ticket."
                      },
                      "entriesSha256": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{64}$",
                        "description": "SHA-256 of the UTF-8 JSON array of entries (JSON.stringify), when the list stays private."
                      },
                      "count": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000000
                      },
                      "winners": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000,
                        "default": 1
                      },
                      "drawAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the draw happens: at most 30 days ahead; never sooner than 120 s after the commitment (the default)."
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 100
                      },
                      "public": {
                        "type": "boolean",
                        "default": false,
                        "description": "Serve the result (with entries, if sent) at /draw/draws/{jobId}."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Opened",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          },
          "422": {
            "description": "Bad input"
          }
        }
      }
    },
    "/draw/jobs/{jobId}": {
      "get": {
        "summary": "Job state",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          }
        }
      }
    },
    "/draw/jobs/{jobId}/payments": {
      "post": {
        "summary": "Report a payment (optional: payments are matched automatically within ~15 s)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "txHash"
                ],
                "properties": {
                  "txHash": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded"
          },
          "409": {
            "description": "Not a validated payment of this stage, or already used"
          }
        }
      }
    },
    "/draw/jobs/{jobId}/retry": {
      "post": {
        "summary": "Retry failed work (paid stages stay paid)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job"
          }
        }
      }
    },
    "/draw/jobs/{jobId}/stages/{n}/result": {
      "get": {
        "summary": "Stage result: 402 until paid, then the bytes (header x-result-sha256)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (signed)"
          },
          "402": {
            "description": "Payment required: { message, resultSha256, pay: { amount, currency, destination, destinationTag, preparedTx } }"
          },
          "409": {
            "description": "Not ready yet"
          }
        }
      }
    },
    "/vault-check/agent": {
      "get": {
        "summary": "Agent card: price, stages, payTo, network, signer",
        "responses": {
          "200": {
            "description": "Card"
          }
        }
      }
    },
    "/vault-check/jobs": {
      "post": {
        "summary": "Open a job",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "object",
                    "required": [
                      "account"
                    ],
                    "properties": {
                      "account": {
                        "type": "string",
                        "description": "The pooled account to check (XRPL classic address)."
                      },
                      "guard": {
                        "type": "string",
                        "description": "The guard co-signer it should require."
                      },
                      "recovery": {
                        "type": "array",
                        "maxItems": 8,
                        "items": {
                          "type": "string"
                        },
                        "description": "Offline recovery signers (treated as offline, not online keys)."
                      },
                      "policy": {
                        "type": "object",
                        "description": "Optional outflow policy (destinations, limits): adds the worst case and reconciliation."
                      },
                      "approvals": {
                        "type": "array",
                        "description": "The guard's recorded approvals (with policy): every recent outflow is matched against them."
                      },
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 400,
                        "default": 200
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Opened",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          },
          "422": {
            "description": "Bad input"
          }
        }
      }
    },
    "/vault-check/jobs/{jobId}": {
      "get": {
        "summary": "Job state",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          }
        }
      }
    },
    "/vault-check/jobs/{jobId}/payments": {
      "post": {
        "summary": "Report a payment (optional: payments are matched automatically within ~15 s)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "txHash"
                ],
                "properties": {
                  "txHash": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded"
          },
          "409": {
            "description": "Not a validated payment of this stage, or already used"
          }
        }
      }
    },
    "/vault-check/jobs/{jobId}/retry": {
      "post": {
        "summary": "Retry failed work (paid stages stay paid)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job"
          }
        }
      }
    },
    "/vault-check/jobs/{jobId}/stages/{n}/result": {
      "get": {
        "summary": "Stage result: 402 until paid, then the bytes (header x-result-sha256)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (signed)"
          },
          "402": {
            "description": "Payment required: { message, resultSha256, pay: { amount, currency, destination, destinationTag, preparedTx } }"
          },
          "409": {
            "description": "Not ready yet"
          }
        }
      }
    },
    "/vault-guard/agent": {
      "get": {
        "summary": "Agent card: price, stages, payTo, network, signer",
        "responses": {
          "200": {
            "description": "Card"
          }
        }
      }
    },
    "/vault-guard/jobs": {
      "post": {
        "summary": "Open a job",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "object",
                    "required": [
                      "account",
                      "policy"
                    ],
                    "properties": {
                      "account": {
                        "type": "string"
                      },
                      "policy": {
                        "type": "object",
                        "required": [
                          "destinations",
                          "limits"
                        ],
                        "properties": {
                          "destinations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "address",
                                "label"
                              ],
                              "properties": {
                                "address": {
                                  "type": "string"
                                },
                                "tag": {
                                  "type": "integer"
                                },
                                "label": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "limits": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "asset",
                                "perTx",
                                "perWindow"
                              ],
                              "properties": {
                                "asset": {
                                  "type": "string",
                                  "description": "XRP (drops) or <currency>/<issuer> (decimal)"
                                },
                                "perTx": {
                                  "type": "string"
                                },
                                "perWindow": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "windowHours": {
                            "type": "number",
                            "default": 24
                          },
                          "maxFeeDrops": {
                            "type": "integer",
                            "default": 1000
                          },
                          "maxLedgerAhead": {
                            "type": "integer",
                            "default": 20
                          }
                        }
                      },
                      "recovery": {
                        "type": "array",
                        "maxItems": 8,
                        "items": {
                          "type": "string"
                        }
                      },
                      "alertUrl": {
                        "type": "string",
                        "description": "https URL that receives a signed alert for any outflow the guard did not approve."
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 100
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Opened",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          },
          "422": {
            "description": "Bad input"
          }
        }
      }
    },
    "/vault-guard/jobs/{jobId}": {
      "get": {
        "summary": "Job state",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Job view: job (id, state, stages) and pay (the next stage due: amount, destination, destinationTag, preparedTx)."
                }
              }
            }
          }
        }
      }
    },
    "/vault-guard/jobs/{jobId}/payments": {
      "post": {
        "summary": "Report a payment (optional: payments are matched automatically within ~15 s)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "txHash"
                ],
                "properties": {
                  "txHash": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded"
          },
          "409": {
            "description": "Not a validated payment of this stage, or already used"
          }
        }
      }
    },
    "/vault-guard/jobs/{jobId}/retry": {
      "post": {
        "summary": "Retry failed work (paid stages stay paid)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job"
          }
        }
      }
    },
    "/vault-guard/jobs/{jobId}/stages/{n}/result": {
      "get": {
        "summary": "Stage result: 402 until paid, then the bytes (header x-result-sha256)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result JSON (signed)"
          },
          "402": {
            "description": "Payment required: { message, resultSha256, pay: { amount, currency, destination, destinationTag, preparedTx } }"
          },
          "409": {
            "description": "Not ready yet"
          }
        }
      }
    },
    "/vault-guard/guard/{account}": {
      "get": {
        "summary": "The guard address this node uses for a vault (free), with the signer-list weights to set up",
        "parameters": [
          {
            "name": "account",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ guard, network, derivation, weights }"
          }
        }
      }
    },
    "/vault-guard/cosign/{jobId}": {
      "post": {
        "summary": "Ask the guard to co-sign one prepared (autofilled, unsigned) transaction",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tx"
                ],
                "properties": {
                  "tx": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{ approved: true, txBlob, approval, record }"
          },
          "402": {
            "description": "Not paid"
          },
          "410": {
            "description": "Period ended"
          },
          "422": {
            "description": "{ approved: false, reasons, record }"
          }
        }
      }
    },
    "/vault-guard/status/{jobId}": {
      "get": {
        "summary": "Period, policy, decisions and the last reconciliation time",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status"
          }
        }
      }
    },
    "/draw/log": {
      "get": {
        "summary": "Every commitment this node signed, oldest first, each naming the one before it (hash chain). No entries.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ total, from, commitments: [signed DrawCommitted] } (at most 200)"
          }
        }
      }
    },
    "/draw/commitments/{jobId}": {
      "get": {
        "summary": "One signed commitment: list SHA-256, count, winners, drawAt, the ledger it followed",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signed DrawCommitted"
          },
          "404": {
            "description": "No commitment yet (unpaid) or unknown job"
          }
        }
      }
    },
    "/draw/draws/{jobId}": {
      "get": {
        "summary": "A public draw's result (JSON; a page for browsers)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result: draw, commitment, winners, entries if sent"
          },
          "404": {
            "description": "Not public, not drawn yet, or unknown"
          }
        }
      }
    },
    "/webhook/hooks/{jobId}": {
      "get": {
        "summary": "Endpoint status (active, period, record count; never bodies)",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status"
          }
        }
      },
      "post": {
        "summary": "Deliver a webhook (any content type, ≤ 64 KB); returns the signed record id",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^job-[0-9a-f]{16}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {}
          }
        },
        "responses": {
          "200": {
            "description": "{ txId, txHash, receivedAt }"
          },
          "402": {
            "description": "Deposit not paid"
          },
          "410": {
            "description": "Period ended"
          },
          "413": {
            "description": "Body over 64 KB"
          },
          "429": {
            "description": "Record limit reached"
          }
        }
      }
    }
  }
}