{
  "openapi": "3.1.0",
  "info": {
    "title": "Sharpwise public API",
    "version": "2026-11-23",
    "summary": "The catalog, the locked-file look-up and the purchase intent.",
    "description": "No payment is taken on this site today. A purchase intent is counted and answered with a reference; to go ahead, email hello@getsharpwise.com with the product name and that reference. The free Reality Check runs in the person's own browser. Their trade file is read on their device and is not uploaded; only summary figures and three codes made here go to our server, never the trades, so an agent sends the person to the check page instead of uploading a file. Sharpwise gives statistical evidence about past trading results. It is not investment advice or a recommendation to invest.",
    "contact": {
      "email": "hello@getsharpwise.com",
      "url": "https://getsharpwise.com/agents/"
    }
  },
  "servers": [
    {
      "url": "https://getsharpwise.com"
    }
  ],
  "paths": {
    "/api/catalog.json": {
      "get": {
        "operationId": "getCatalog",
        "summary": "Every product, price, status and buy call",
        "responses": {
          "200": {
            "description": "The catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          }
        }
      }
    },
    "/api/records/{ref}": {
      "get": {
        "operationId": "getRecord",
        "summary": "Look up a locked file",
        "description": "By link, serial or 64-hex hash. A private locked file answers exactly as a missing one.",
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 80
            },
            "description": "Locked file id, serial or 64-hex hash"
          }
        ],
        "responses": {
          "200": {
            "description": "The results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Record"
                    }
                  },
                  "required": [
                    "record"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The reference is malformed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No public locked file has this reference",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The results store is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/records/{id}/record.json": {
      "get": {
        "operationId": "getRecordStatement",
        "summary": "The signed statement, exactly the signed bytes",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The statement",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No public locked file has this id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/records/{id}/audit.json": {
      "get": {
        "operationId": "getRecordAudit",
        "summary": "The results, its proof and the keys in one file",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The audit bundle",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No public locked file has this id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/intent": {
      "post": {
        "operationId": "sendPurchaseIntent",
        "summary": "Send a request to buy. It counts the request; no payment is taken and nothing is bought.",
        "description": "Counts the request (no email, name or note is kept) and can notify hello@getsharpwise.com. Call it from a server; a browser may call it only from getsharpwise.com. Five calls a minute per caller.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntentRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/IntentRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Counted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntentRecorded"
                }
              }
            }
          },
          "303": {
            "description": "A form post is sent back to /agents/ with the outcome"
          },
          "400": {
            "description": "The body is not JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A browser on another site called it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 4 KB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unknown product id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many calls; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The store is unavailable; nothing was kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "Price": {
        "type": "object",
        "properties": {
          "display": {
            "type": "string"
          },
          "amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "from": {
            "type": "boolean"
          },
          "cadence": {
            "type": "string"
          }
        },
        "required": [
          "display",
          "amount",
          "from",
          "cadence"
        ]
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "reality-check",
              "reality-review",
              "sealed",
              "public",
              "public-pro",
              "presets",
              "check-a-link",
              "wallet-replay",
              "crash-test",
              "crash-test-builder",
              "proving-ground",
              "api",
              "agent-challenge",
              "white-label",
              "proving-ground-white-label"
            ]
          },
          "name": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "does": {
            "type": "string"
          },
          "when": {
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "tiers": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Price"
                },
                {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string"
                    }
                  }
                }
              ]
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "live",
              "on_request"
            ]
          },
          "door": {
            "enum": [
              1,
              2,
              3,
              "firms"
            ],
            "description": "Which of the three doors the product sits behind, or For firms"
          },
          "state": {
            "type": "string",
            "enum": [
              "live",
              "limited",
              "not_yet_available"
            ],
            "description": "From the one status table; status is live when state is live or limited"
          },
          "limit_line": {
            "type": [
              "string",
              "null"
            ],
            "description": "What runs, for a limited product, or a live product's limit"
          },
          "page_url": {
            "type": "string",
            "format": "uri"
          },
          "run_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "buy": {
            "type": [
              "object",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "price",
          "status",
          "page_url"
        ]
      },
      "Catalog": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "payment": {
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        },
        "required": [
          "name",
          "currency",
          "products"
        ]
      },
      "Record": {
        "type": "object",
        "description": "A locked file: the signed statement plus its status.",
        "properties": {
          "id": {
            "type": "string"
          },
          "serial": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "issued_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "locking",
              "locked",
              "revoked"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ]
          },
          "root": {
            "type": "string"
          },
          "anchor": {
            "type": [
              "object",
              "null"
            ]
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "IntentRequest": {
        "type": "object",
        "properties": {
          "product": {
            "type": "string",
            "enum": [
              "reality-check",
              "reality-review",
              "sealed",
              "public",
              "public-pro",
              "presets",
              "check-a-link",
              "wallet-replay",
              "crash-test",
              "crash-test-builder",
              "proving-ground",
              "api",
              "agent-challenge",
              "white-label",
              "proving-ground-white-label"
            ],
            "description": "A product id from /api/catalog.json"
          },
          "agent": {
            "type": "string",
            "maxLength": 120,
            "description": "Not kept. Named in not_kept if sent, like email, name, company and note."
          }
        },
        "required": [
          "product"
        ]
      },
      "IntentRecorded": {
        "type": "object",
        "properties": {
          "status": {
            "const": "recorded"
          },
          "reference": {
            "type": "string"
          },
          "product": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "price": {
                "type": "string"
              }
            }
          },
          "payment": {
            "type": "string"
          },
          "next": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "not_kept": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Fields sent that were not kept"
          },
          "ignored": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Price fields sent and ignored: the price comes from the catalog"
          },
          "notified": {
            "type": "boolean",
            "description": "Whether the email to hello@getsharpwise.com went out"
          }
        },
        "required": [
          "status",
          "reference",
          "product"
        ]
      }
    }
  }
}