{
  "openapi": "3.1.1",
  "info": {
    "title": "GoPlausible API",
    "version": "1.1.0",
    "summary": "W3C Verifiable Credentials and Presentations on public ledgers: issued, registered, presented and verified.",
    "description": "The API behind goplausible.xyz: credentials and presentations, their verification, the `did:algo` DID method, one sign-in for Algorand, Base and Solana wallets, the signed-in account, its media, and the legacy PLAUS routes the app still uses.\n\n**Content negotiation.** The routes that have a page (`/api`, `/api/credentials`, `/api/verify`, `/api/docs`) answer HTML to a browser and JSON to everything else. `?format=html` or `?format=json` decides first; otherwise an `Accept` header naming `text/html` gets the page.\n\n**Errors.** A refused or failed request answers a JSON `Error`: `error` (a message for people), `code` (stable, machine-readable) and `requestId` (quote it to support). An unknown path answers `404` with code `not_found`, a known path with another method answers `405` with code `method_not_allowed`.\n\n**CORS.** Every route answers `Access-Control-Allow-Origin: *`. `OPTIONS` answers a `204` preflight (the top-up and receipt pages answer it with `200` and the page's headers).\n\n**Authentication.** Most routes are public. The account routes need a session from `POST /api/auth/signin` (`Authorization: Bearer <token>`); the legacy profile routes need the legacy token instead.",
    "termsOfService": "https://goplausible.xyz/terms",
    "contact": {
      "name": "GoPlausible",
      "url": "https://goplausible.com"
    }
  },
  "servers": [
    {
      "url": "https://goplausible.xyz",
      "description": "GoPlausible API (mainnet)"
    }
  ],
  "tags": [
    {
      "name": "Index",
      "description": "The API's own index and this description of it."
    },
    {
      "name": "Credentials",
      "description": "Verifiable credentials and presentations, addressed by their `did:algo:…:uuid:…` DID or the CID of their pinned document."
    },
    {
      "name": "Verification",
      "description": "The verifier: the proof, the validity window, the issuer, the holder and their sign-in, the registration on the PLAUSIBLE contract, the pinned copy and the status — for the current W3C documents and the legacy PLAUS credentials."
    },
    {
      "name": "Identifiers",
      "description": "The `did:algo` DID method (accounts, transactions, applications, assets, uuids) and NFD names; DIDs of other methods resolve through the same route."
    },
    {
      "name": "Authentication",
      "description": "One sign-in for every chain: a challenge, the wallet's signature (ARC-60 on Algorand, SIWE on Base, SIWS on Solana), a session. The first sign-in of an account creates its PLAUSIBLE profile."
    },
    {
      "name": "Account",
      "description": "The signed-in account."
    },
    {
      "name": "Media",
      "description": "Images, badges, certificates and attachments of credentials and presentations. Uploads need a session; reads are public."
    },
    {
      "name": "IPFS",
      "description": "A proxy for pinned content, served with headers that allow cross-site embedding."
    },
    {
      "name": "Top-ups and receipts",
      "description": "Pages other GoPlausible services store for people to open: ARC-90 top-up pages (Algorand remote MCP servers) and payment receipts (the remote MCP servers and the x402 facilitator)."
    },
    {
      "name": "Legacy PLAUS",
      "description": "The routes of the previous protocol version, kept for the profiles and credentials that exist. No new legacy profiles are created."
    },
    {
      "name": "App",
      "description": "Routes used by the goplausible.xyz app itself."
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "tags": [
          "Index"
        ],
        "operationId": "getApiIndex",
        "summary": "The API index",
        "description": "A browser gets the index page; every other client gets a JSON directory of the API's route groups.",
        "parameters": [
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "description": "The directory, or the page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiDirectory"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          }
        }
      }
    },
    "/api/openapi.json": {
      "get": {
        "tags": [
          "Index"
        ],
        "operationId": "getOpenApiDocument",
        "summary": "This OpenAPI document",
        "responses": {
          "200": {
            "description": "The OpenAPI 3.1 description of this API.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An OpenAPI 3.1 document."
                }
              }
            }
          }
        }
      }
    },
    "/api/docs": {
      "get": {
        "tags": [
          "Index"
        ],
        "operationId": "getApiDocs",
        "summary": "The API reference page",
        "description": "This document rendered as a page for browsers; any other client gets the OpenAPI document itself.",
        "parameters": [
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "description": "The reference page, or the OpenAPI document.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An OpenAPI 3.1 document."
                }
              }
            }
          }
        }
      }
    },
    "/api/credentials": {
      "get": {
        "tags": [
          "Credentials"
        ],
        "operationId": "getCredentialsLanding",
        "summary": "Open a credential or presentation",
        "description": "A browser gets a page to paste a DID or CID into; other clients get a usage note. With `id`, a redirect to `/api/credentials/{id}`.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "A credential DID or CID to open.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "description": "The usage note, or the page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageNote"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          },
          "302": {
            "description": "Redirect to the credential named by `id`.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            }
          }
        }
      }
    },
    "/api/credentials/{id}": {
      "get": {
        "tags": [
          "Credentials"
        ],
        "operationId": "getCredential",
        "summary": "A credential or presentation",
        "description": "The document itself for any non-browser client: `application/vc` or `application/vp` when the `Accept` header names that type, `application/json` otherwise. A browser gets the credential page, with the proof checked against the key the signer's DID document publishes.\n\nDID documents and NFT pages are not served here (`404`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The credential's or presentation's `did:algo:<network>:uuid:<uuid>` DID, or the CID of its pinned document.",
            "schema": {
              "type": "string",
              "examples": [
                "did:algo:mainnet:uuid:0b7c6a59-6f0b-4c43-9a8c-1d2e3f405162"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "description": "The verifiable credential or presentation, or its page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifiableDocument"
                }
              },
              "application/vc": {
                "schema": {
                  "$ref": "#/components/schemas/VerifiableDocument"
                }
              },
              "application/vp": {
                "schema": {
                  "$ref": "#/components/schemas/VerifiableDocument"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: the id is neither a CID nor a `did:algo` DID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: nothing is registered under this id, or what is there is not a credential or presentation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "description": "`ipfs_unavailable`: the pinned document could not be fetched from IPFS.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/verify": {
      "get": {
        "tags": [
          "Verification"
        ],
        "operationId": "getVerifierLanding",
        "summary": "The verifier",
        "description": "A browser gets a page to paste a DID or CID into; other clients get a usage note. With `id`, a redirect to `/api/verify/{id}`.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "A credential DID or CID to verify.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "description": "The usage note, or the page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageNote"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          },
          "302": {
            "description": "Redirect to the verification of `id`.",
            "headers": {
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Verification"
        ],
        "operationId": "verifyDocument",
        "summary": "Verify a posted credential or presentation",
        "description": "The body is the verifiable credential or presentation itself, or `{ document, challenge, domain }` to also check a presentation's proof against an expected challenge and domain. At most 1 MB.",
        "requestBody": {
          "required": true,
          "description": "The document to verify.",
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/VerifiableDocument"
                  },
                  {
                    "$ref": "#/components/schemas/VerifyRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The verification report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationReport"
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: the body is not JSON, or not a verifiable credential or presentation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`too_large`: the body is over 1 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal`: the verifier hit an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/verify/{id}": {
      "get": {
        "tags": [
          "Verification"
        ],
        "operationId": "getVerification",
        "summary": "Verify a stored credential or presentation",
        "description": "Runs every check live. Non-browser clients get the JSON report with the document under `document`; a browser gets the verification page.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The credential's or presentation's `did:algo:<network>:uuid:<uuid>` DID, or the CID of its pinned document.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "description": "The report (with the document), or the page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationWithDocument"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: the id is neither a CID nor a `did:algo` DID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: nothing verifiable is registered under this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal`: the verifier hit an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/verification/{id}": {
      "get": {
        "tags": [
          "Verification"
        ],
        "operationId": "getVerificationHistorical",
        "summary": "Verify a stored credential (historical path)",
        "description": "The address printed on older credential pages and QR codes. Answers exactly as `GET /api/verify/{id}`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The credential's DID or CID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "description": "The report (with the document), or the page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationWithDocument"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: the id is neither a CID nor a `did:algo` DID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: nothing verifiable is registered under this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal`: the verifier hit an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/1.0/identifiers/{did}": {
      "get": {
        "tags": [
          "Identifiers"
        ],
        "operationId": "resolveDid",
        "summary": "Resolve a DID",
        "description": "`did:algo` DIDs are resolved from Algorand chain data (accounts — a rekeyed account publishes its `auth-addr` key —, transactions, applications, assets) or, for `uuid` DIDs, from the registered documents. Addresses and transaction ids are accepted in either case; when the id was not upper-case, `didDocumentMetadata.canonicalId` names the upper-case DID. DIDs of every other method (`did:nfd`, `did:web`, `did:key`, …) are resolved through GoPlausible's universal resolver and returned as it answers.\n\nThe answer is always `200`; when nothing could be resolved it carries only `message`.",
        "parameters": [
          {
            "name": "did",
            "in": "path",
            "required": true,
            "description": "The DID to resolve.",
            "schema": {
              "type": "string",
              "examples": [
                "did:algo:UTI7PAASILRDA3ISHY5M7J7LNRX2AIVQJWI7ZKCCGKVLMFD3VPR5PWSZ4I",
                "did:algo:mainnet:app:946441472"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The DID resolution result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DidResolutionResult"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "description": "`upstream_failed`: the resolver did not answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/did/{uid}": {
      "get": {
        "tags": [
          "Identifiers"
        ],
        "operationId": "constructDid",
        "summary": "Construct the did:algo DID of an identifier",
        "description": "Names the identifier's kind and answers its `did:algo` DID with the DID document built from chain data.",
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "An Algorand address (58 characters), a transaction id (52 characters), an application or asset id, or a uuid.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The DID and its document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstructedDid"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "description": "`upstream_failed`: the DID could not be constructed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/challenge": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "authChallenge",
        "summary": "Ask for a sign-in challenge",
        "description": "Answers a challenge bound to the account (valid for five minutes) and what the wallet signs: the ARC-60 parameters on Algorand, the exact Sign-In with Ethereum (ERC-4361) message on Base, the exact Sign-In with Solana message on Solana.",
        "requestBody": {
          "required": true,
          "description": "The account that will sign in.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountRef"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The challenge.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Challenge"
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: unknown chain, or the address is not a valid account of that chain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/auth/signin": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "authSignin",
        "summary": "Sign in",
        "description": "Verifies the wallet's signature over the challenge. The first sign-in of an account is its **subscription**: GoPlausible creates its profile DID document and a SubscriptionCredential (signed `eddsa-jcs-2022`, the sign-in response as its evidence), pins both to IPFS and registers them on the PLAUSIBLE contract. Every later sign-in is a **login**. Both answer a session.\n\nMethods: `arc60` (Algorand; `payment` for an Algorand wallet that cannot sign data, a signed payment transaction that is never broadcast), `siwe` (Base; EOA signatures, ERC-1271 smart accounts and ERC-6492 counterfactual signatures), `siws` (Solana).\n\nAn Algorand wallet that also has a legacy profile receives its legacy session under `legacy`.",
        "requestBody": {
          "required": true,
          "description": "The challenge and the wallet's signed response.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SigninRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigninResult"
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: a field is missing, the chain or address is invalid, or the method does not belong to the chain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`challenge_invalid` (malformed, expired, or issued for another account) or `signature_invalid`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "description": "`ipfs_pin_failed` or `registry_failed`: creating the profile failed; sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`chain_unavailable`: Base did not answer the smart-account check; nothing was decided — sign in again in a moment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/lookup": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "authLookup",
        "summary": "Does an account exist?",
        "description": "Whether the account has a profile, and (Algorand) whether the wallet has a legacy profile. Signs nothing, creates nothing.",
        "requestBody": {
          "required": true,
          "description": "The account to look up.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountRef"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The account's state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupResult"
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: unknown chain, or the address is not a valid account of that chain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "authLogout",
        "summary": "End the session",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "The session is revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoutResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SessionRequired"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/auth/jwks.json": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "operationId": "authJwks",
        "summary": "The session key",
        "description": "The public key that signs sessions, as a JWK Set (RFC 7517; OKP / Ed25519, RFC 8037), so any party can verify a GoPlausible session.",
        "responses": {
          "200": {
            "description": "The JWK Set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Jwks"
                }
              }
            }
          }
        }
      }
    },
    "/api/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getMe",
        "summary": "The signed-in account",
        "description": "The account, its profile DID document, the credentials it holds and issued, its presentations, names, media and recent sign-ins, and the current session.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "The composed profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SessionRequired"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/media": {
      "post": {
        "tags": [
          "Media"
        ],
        "operationId": "uploadMedia",
        "summary": "Upload a media object",
        "description": "The body is the file itself, at most 5 MB, sent with its own `Content-Type`.",
        "security": [
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "X-Media-Role",
            "in": "header",
            "description": "What the object is.",
            "schema": {
              "type": "string",
              "enum": [
                "image",
                "badge",
                "certificate",
                "attachment"
              ],
              "default": "image"
            }
          },
          {
            "name": "X-Media-Credential",
            "in": "header",
            "description": "The id of one of the account's credentials to attach the object to.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Media-Presentation",
            "in": "header",
            "description": "The id of one of the account's presentations to attach the object to.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The file.",
          "content": {
            "image/svg+xml": {},
            "image/png": {},
            "image/jpeg": {},
            "image/webp": {},
            "application/pdf": {}
          }
        },
        "responses": {
          "200": {
            "description": "Stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaObject"
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: an unknown role, or an empty body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SessionRequired"
          },
          "404": {
            "description": "`not_found`: the named credential or presentation is not the account's.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`too_large`: over 5 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: not SVG, PNG, JPEG, WebP or PDF.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "description": "`media_unavailable`: the media store is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/media/{id}": {
      "get": {
        "tags": [
          "Media"
        ],
        "operationId": "getMedia",
        "summary": "A media object",
        "description": "The bytes, with their stored content type, a strong `ETag` (the SHA-256 of the bytes) and immutable caching.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The media object's id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "The `ETag` already held.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "image/svg+xml": {},
              "image/png": {},
              "image/jpeg": {},
              "image/webp": {},
              "application/pdf": {}
            }
          },
          "304": {
            "description": "Not modified.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "404": {
            "description": "`not_found`: no media object has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`media_unavailable`: the media store is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Media"
        ],
        "operationId": "headMedia",
        "summary": "A media object's headers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The media object's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The headers of `GET`, no body.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "404": {
            "description": "No media object has this id."
          }
        }
      },
      "delete": {
        "tags": [
          "Media"
        ],
        "operationId": "deleteMedia",
        "summary": "Delete a media object",
        "description": "Only the account that uploaded it may delete it.",
        "security": [
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The media object's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/SessionRequired"
          },
          "404": {
            "description": "`not_found`: the account has no media object with this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/ipfs/{cid}": {
      "get": {
        "tags": [
          "IPFS"
        ],
        "operationId": "getIpfs",
        "summary": "Pinned content",
        "description": "The content behind a CID, through GoPlausible's gateway first and a public gateway second, with `Cross-Origin-Resource-Policy: cross-origin` and immutable caching. A path inside the CID is served too: `/api/ipfs/{cid}/{path}`.",
        "parameters": [
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "description": "A CIDv0 or CIDv1.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The content, with its own content type.",
            "content": {
              "*/*": {}
            }
          },
          "400": {
            "description": "Not a CID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProxyError"
                }
              }
            }
          },
          "404": {
            "description": "No such path under this CID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProxyError"
                }
              }
            }
          },
          "502": {
            "description": "No gateway could serve the content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProxyError"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "IPFS"
        ],
        "operationId": "headIpfs",
        "summary": "Pinned content's headers",
        "parameters": [
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "description": "A CIDv0 or CIDv1.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The headers of `GET`, no body."
          },
          "404": {
            "description": "No such path under this CID."
          }
        }
      }
    },
    "/api/arc90/{id}": {
      "get": {
        "tags": [
          "Top-ups and receipts"
        ],
        "operationId": "getArc90TopupPage",
        "summary": "An ARC-90 top-up page",
        "description": "The page an Algorand remote MCP server stored for a top-up: the ARC-90 payment URI and its QR code. Top-up pages are short-lived.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The top-up page's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The stored page, under a sandboxing Content-Security-Policy.",
            "headers": {
              "Content-Security-Policy": {
                "$ref": "#/components/headers/CSP"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: no page under this id (expired or never stored).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Top-ups and receipts"
        ],
        "operationId": "headArc90TopupPage",
        "summary": "An ARC-90 top-up page: headers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The top-up page's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The headers of `GET`, no body."
          },
          "404": {
            "description": "No page under this id."
          }
        }
      }
    },
    "/api/arc90/image/{name}": {
      "get": {
        "tags": [
          "Top-ups and receipts"
        ],
        "operationId": "getArc90TopupImage",
        "summary": "A top-up QR code image",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The image's name: `<id>.jpeg`.",
            "schema": {
              "type": "string",
              "pattern": "\\.jpeg$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image.",
            "content": {
              "image/jpeg": {}
            }
          },
          "400": {
            "description": "`badrequest`: the name does not end in `.jpeg`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: no image under this name (images are short-lived).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Top-ups and receipts"
        ],
        "operationId": "headArc90TopupImage",
        "summary": "A top-up QR code image: headers",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The image's name: `<id>.jpeg`.",
            "schema": {
              "type": "string",
              "pattern": "\\.jpeg$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The headers of `GET`, no body."
          },
          "404": {
            "description": "No image under this name."
          }
        }
      }
    },
    "/api/receipt/{id}": {
      "get": {
        "tags": [
          "Top-ups and receipts"
        ],
        "operationId": "getReceiptPage",
        "summary": "A payment receipt",
        "description": "A receipt stored by an Algorand remote MCP server or the x402 facilitator. Receipts are kept for 90 days.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The receipt's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The stored page, under a sandboxing Content-Security-Policy.",
            "headers": {
              "Content-Security-Policy": {
                "$ref": "#/components/headers/CSP"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: no page under this id (expired or never stored).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Top-ups and receipts"
        ],
        "operationId": "headReceiptPage",
        "summary": "A payment receipt: headers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The receipt's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The headers of `GET`, no body."
          },
          "404": {
            "description": "No page under this id."
          }
        }
      }
    },
    "/api/receipt/image/{name}": {
      "get": {
        "tags": [
          "Top-ups and receipts"
        ],
        "operationId": "getReceiptImage",
        "summary": "A receipt image",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The image's name: `<id>.jpeg`.",
            "schema": {
              "type": "string",
              "pattern": "\\.jpeg$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image.",
            "content": {
              "image/jpeg": {}
            }
          },
          "400": {
            "description": "`badrequest`: the name does not end in `.jpeg`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: no image under this name (images are short-lived).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Top-ups and receipts"
        ],
        "operationId": "headReceiptImage",
        "summary": "A receipt image: headers",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The image's name: `<id>.jpeg`.",
            "schema": {
              "type": "string",
              "pattern": "\\.jpeg$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The headers of `GET`, no body."
          },
          "404": {
            "description": "No image under this name."
          }
        }
      }
    },
    "/api/page/{signature}": {
      "get": {
        "tags": [
          "Legacy PLAUS"
        ],
        "operationId": "getLegacyPlausPage",
        "summary": "A legacy PLAUS credential page",
        "description": "The public page of a credential claimed on the previous protocol version: the NFT card, the badges, the DID and credential documents.",
        "parameters": [
          {
            "name": "signature",
            "in": "path",
            "required": true,
            "description": "The CID of the credential's pinned page document, or its `did:algo:<network>:uuid:<uuid>` DID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The page.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "An HTML page."
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: neither a CID nor a `did:algo` DID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: no credential, metadata or PLAUS is registered under this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "description": "`ipfs_unavailable`: the documents could not be fetched from IPFS.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/profile": {
      "post": {
        "tags": [
          "Legacy PLAUS"
        ],
        "operationId": "legacyProfile",
        "summary": "Legacy: the profile",
        "security": [
          {
            "legacyToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The wallet and the nonce its token was issued for.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyAuth"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyProfileResult"
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: `walletAddress`, `nonce` or the token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`auth_failed`: the token was not issued to this wallet and nonce.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`profile_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/re-check": {
      "post": {
        "tags": [
          "Legacy PLAUS"
        ],
        "operationId": "legacyRecheck",
        "summary": "Legacy: repair the claimed credentials",
        "description": "Rebuilds every claimed PLAUS that lacks its credential document: the claim transaction, the DID document, the credential and its Open Badges, pinned and registered. A PLAUS that cannot be rebuilt is left as it was.",
        "security": [
          {
            "legacyToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The wallet and the nonce its token was issued for.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyAuth"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The profile after the repair.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyProfileResult"
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: `walletAddress`, `nonce` or the token is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`auth_failed`: the token was not issued to this wallet and nonce.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`profile_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/closure": {
      "post": {
        "tags": [
          "Legacy PLAUS"
        ],
        "operationId": "legacyClosure",
        "summary": "Legacy: mark an issued PLAUS closed",
        "description": "Called after the issuer closed the PLAUS's item contract on chain: flags the entry closed in the issuer's list.",
        "security": [
          {
            "legacyToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The wallet, its nonce and the PLAUS.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyClosureRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Closed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "plaus"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "plaus": {
                      "type": "object",
                      "description": "The PLAUS entry, now with `isClosed: true`."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`badrequest`: a field is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`auth_failed`: the token was not issued to this wallet and nonce.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`profile_not_found`, or `plausnotfound` when the PLAUS is not in the issuer's list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/log": {
      "post": {
        "tags": [
          "App"
        ],
        "operationId": "clientLog",
        "summary": "Report a client error",
        "description": "The app's error sink: the payload is logged and sent to GoPlausible's operators.",
        "requestBody": {
          "required": false,
          "description": "The report.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The error report; any JSON object.",
                "properties": {
                  "message": {
                    "description": "What went wrong."
                  },
                  "walletAddress": {
                    "type": "string",
                    "description": "The connected Algorand wallet, if any."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Logged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "message"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "session": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "A session from `POST /api/auth/signin`: a JWT signed EdDSA (Ed25519) with GoPlausible's session key (`/api/auth/jwks.json`); `iss` `https://goplausible.xyz`, `aud` `https://goplausible.xyz/api`, `sub` the holder DID, `jti` the session id. Valid for 7 days unless ended with `POST /api/auth/logout`."
      },
      "legacyToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "The legacy PLAUS session token: `legacy.jwt` of `POST /api/auth/signin`, for an Algorand wallet that has a legacy profile. It is bound to the wallet and to `legacy.nonce`: the request body carries both as `walletAddress` and `nonce`."
      }
    },
    "parameters": {
      "format": {
        "name": "format",
        "in": "query",
        "description": "`html` for the page, `json` for the JSON answer; without it, an `Accept` header naming `text/html` gets the page.",
        "schema": {
          "type": "string",
          "enum": [
            "html",
            "json"
          ]
        }
      }
    },
    "headers": {
      "Location": {
        "description": "The target of the redirect.",
        "schema": {
          "type": "string",
          "format": "uri"
        }
      },
      "ETag": {
        "description": "A strong validator: the SHA-256 of the bytes, quoted.",
        "schema": {
          "type": "string"
        }
      },
      "CSP": {
        "description": "A sandboxing Content-Security-Policy: the stored page runs in an opaque origin and cannot reach goplausible.xyz storage.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "InternalError": {
        "description": "`internal_error`: something went wrong on GoPlausible's side; quote the request id.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "SessionRequired": {
        "description": "`auth_required` (no bearer token), `auth_failed` (the token does not verify) or `session_ended` (expired or signed out).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "The error envelope. For the codes `badrequest` and `plausnotfound` the message is also repeated under a key of that name, for older clients.",
        "required": [
          "error",
          "code"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "A message for people."
          },
          "code": {
            "type": "string",
            "description": "A stable, machine-readable code."
          },
          "requestId": {
            "type": "string",
            "description": "The request id; quote it to support."
          }
        },
        "additionalProperties": true
      },
      "ProxyError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "ApiDirectory": {
        "type": "object",
        "required": [
          "service",
          "network",
          "status",
          "api"
        ],
        "properties": {
          "service": {
            "const": "GoPlausible API"
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ]
          },
          "status": {
            "const": "ok"
          },
          "app": {
            "type": "string",
            "description": "The app's home.",
            "format": "uri"
          },
          "api": {
            "type": "object",
            "description": "One entry per route group, with its URLs and a short note.",
            "additionalProperties": {
              "type": "object"
            }
          },
          "html": {
            "type": "string"
          }
        }
      },
      "UsageNote": {
        "type": "object",
        "required": [
          "service",
          "network",
          "usage"
        ],
        "properties": {
          "service": {
            "type": "string"
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ]
          },
          "usage": {
            "type": "object",
            "description": "How to call the route.",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "VerifiableDocument": {
        "type": "object",
        "description": "A verifiable credential or verifiable presentation (W3C Verifiable Credentials Data Model 2.0), exactly as stored. Legacy PLAUS credentials follow the older data model.",
        "required": [
          "type"
        ],
        "properties": {
          "@context": {
            "description": "The JSON-LD contexts."
          },
          "id": {
            "type": "string"
          },
          "type": {
            "description": "`VerifiableCredential` or `VerifiablePresentation`, with the more specific types.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "proof": {
            "description": "The proof(s): a `DataIntegrityProof` (`eddsa-jcs-2022`) for current documents."
          }
        },
        "additionalProperties": true
      },
      "VerifyRequest": {
        "type": "object",
        "required": [
          "document"
        ],
        "properties": {
          "document": {
            "$ref": "#/components/schemas/VerifiableDocument"
          },
          "challenge": {
            "type": "string",
            "description": "The challenge the presentation's proof must carry."
          },
          "domain": {
            "type": "string",
            "description": "The domain the presentation's proof must be bound to."
          }
        }
      },
      "Verdict": {
        "type": "string",
        "enum": [
          "verified",
          "not-yet-valid",
          "expired",
          "unverifiable",
          "invalid"
        ],
        "description": "From best to worst. `invalid`: a check failed. `unverifiable`: the proof could not be checked. `expired` / `not-yet-valid`: the proof is genuine but the date is outside the validity window. A presentation's verdict is the worst of its own and its credentials'."
      },
      "Check": {
        "type": "object",
        "description": "One check of the report; checks may carry more facts than these fields.",
        "required": [
          "id",
          "label",
          "status",
          "detail"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The check: `structure`, `proof`, `validity`, `issuer`, `holder`, `assertion`, `registry`, `ipfs`, `status`, and for presentations `challenge`, `domain`, `binding`, `credentials`."
          },
          "label": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pass",
              "warn",
              "fail",
              "skip"
            ]
          },
          "detail": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "ProofResult": {
        "type": "object",
        "description": "The result of checking the document's first proof.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "verified",
              "failed",
              "unsupported",
              "none"
            ]
          },
          "type": {
            "type": "string"
          },
          "cryptosuite": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "description": "The verification method."
          },
          "created": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "description": "Why the proof failed or was not checked."
          }
        },
        "additionalProperties": true
      },
      "VerificationReport": {
        "type": "object",
        "required": [
          "kind",
          "verdict",
          "summary",
          "checks"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "vc",
              "vp"
            ]
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The document's DID."
          },
          "cid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The CID of the pinned copy."
          },
          "uuid": {
            "type": [
              "string",
              "null"
            ]
          },
          "legacy": {
            "type": "boolean",
            "description": "A legacy PLAUS credential."
          },
          "holder": {
            "type": [
              "string",
              "null"
            ],
            "description": "The holder's DID."
          },
          "verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "summary": {
            "type": "string"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Check"
            }
          },
          "proof": {
            "$ref": "#/components/schemas/ProofResult"
          },
          "credentials": {
            "type": "array",
            "description": "A presentation's credentials, each with its own report.",
            "items": {
              "$ref": "#/components/schemas/VerificationReport"
            }
          },
          "index": {
            "type": "integer",
            "description": "The credential's position in its presentation."
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ]
          }
        }
      },
      "VerificationWithDocument": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VerificationReport"
          },
          {
            "type": "object",
            "required": [
              "document"
            ],
            "properties": {
              "document": {
                "$ref": "#/components/schemas/VerifiableDocument"
              }
            }
          }
        ]
      },
      "DidResolutionResult": {
        "type": "object",
        "description": "A DID resolution result (W3C DID Resolution). For DIDs of other methods, the universal resolver's answer as it is.",
        "properties": {
          "@context": {
            "description": "`https://w3id.org/did-resolution/v1`."
          },
          "didDocument": {
            "type": [
              "object",
              "null"
            ],
            "description": "The DID document (W3C DID 1.0): `Multikey` verification methods, services."
          },
          "didDocumentMetadata": {
            "type": "object",
            "description": "`created`, `canonicalId` when relevant, and the method's data under `method`."
          },
          "didResolutionMetadata": {
            "type": "object",
            "description": "`contentType` (`application/did+ld+json`), or an `error`."
          },
          "message": {
            "type": "string",
            "description": "Added by this API: the network and the DID resolved."
          }
        },
        "additionalProperties": true
      },
      "ConstructedDid": {
        "type": "object",
        "required": [
          "did",
          "message"
        ],
        "properties": {
          "did": {
            "type": "string",
            "description": "The `did:algo` DID."
          },
          "did_doc": {
            "$ref": "#/components/schemas/DidResolutionResult"
          },
          "algo_doc": {
            "description": "The account record, when the identifier is an account."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Chain": {
        "type": "string",
        "enum": [
          "algorand",
          "base",
          "solana"
        ]
      },
      "AccountRef": {
        "type": "object",
        "required": [
          "chain",
          "address"
        ],
        "properties": {
          "chain": {
            "$ref": "#/components/schemas/Chain"
          },
          "address": {
            "type": "string",
            "description": "An Algorand address (58 characters, base32), a Base address (`0x…`), or a Solana address (base58)."
          }
        }
      },
      "Challenge": {
        "type": "object",
        "description": "Exactly one of `arc60`, `siwe` or `siws` is present, matching `method`.",
        "required": [
          "account",
          "holder",
          "chain",
          "address",
          "network",
          "nonce",
          "issuedAt",
          "expiresAt",
          "ttlSeconds",
          "host",
          "uri",
          "method"
        ],
        "properties": {
          "account": {
            "type": "string",
            "description": "The CAIP-10 account id, e.g. `eip155:8453:0x…`."
          },
          "holder": {
            "type": "string",
            "description": "The holder DID: `did:algo:<address>`, `did:pkh:eip155:<chain id>:<address>` or `did:sol:<address>`."
          },
          "chain": {
            "$ref": "#/components/schemas/Chain"
          },
          "address": {
            "type": "string",
            "description": "The address, normalized (EIP-55 for Base)."
          },
          "network": {
            "type": "string",
            "enum": [
              "mainnet",
              "testnet"
            ]
          },
          "nonce": {
            "type": "string",
            "description": "The challenge: 64 characters of RFC 4648 base32, bound to the account.",
            "pattern": "^[A-Z2-7]{64}$"
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "ttlSeconds": {
            "type": "integer",
            "const": 300
          },
          "host": {
            "type": "string",
            "description": "The domain the signature is bound to."
          },
          "uri": {
            "type": "string",
            "description": "The sign-in URI.",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "enum": [
              "arc60",
              "siwe",
              "siws"
            ]
          },
          "arc60": {
            "type": "object",
            "description": "What the Algorand wallet signs with ARC-60 `signData` (scope AUTH): a JCS-canonical (RFC 8785) JSON object with the CAIP-122 fields `domain`, `account_address`, `uri`, `version`, `chain_id`, `type`, `nonce`, `statement`, `issued-at`, `expiration-time`, `resources`, built from these values.",
            "properties": {
              "chainId": {
                "type": "string",
                "description": "The genesis hash of the network."
              },
              "type": {
                "const": "ed25519"
              },
              "version": {
                "const": "1"
              },
              "statement": {
                "type": "string"
              },
              "scope": {
                "const": 1
              },
              "encoding": {
                "const": "base64"
              },
              "resources": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "siwe": {
            "type": "object",
            "description": "The ERC-4361 message the Base wallet signs with `personal_sign`, exactly as given.",
            "properties": {
              "chainId": {
                "type": "integer",
                "enum": [
                  8453,
                  84532
                ]
              },
              "version": {
                "const": "1"
              },
              "statement": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "siws": {
            "type": "object",
            "description": "The Sign-In with Solana message, exactly as given, and the input it was built from (for `solana:signIn`).",
            "properties": {
              "chainId": {
                "type": "string",
                "enum": [
                  "mainnet",
                  "devnet"
                ]
              },
              "version": {
                "const": "1"
              },
              "statement": {
                "type": "string"
              },
              "input": {
                "type": "object"
              },
              "message": {
                "type": "string"
              }
            }
          }
        },
        "oneOf": [
          {
            "required": [
              "arc60"
            ]
          },
          {
            "required": [
              "siwe"
            ]
          },
          {
            "required": [
              "siws"
            ]
          }
        ]
      },
      "Arc60SignedData": {
        "type": "object",
        "description": "The ARC-60 `signData` result (bytes in base64).",
        "required": [
          "data",
          "signer",
          "domain",
          "authenticatorData",
          "signature"
        ],
        "properties": {
          "data": {
            "type": "string",
            "description": "The signed JCS-canonical JSON object."
          },
          "signer": {
            "type": "string",
            "description": "The 32-byte Ed25519 public key that signed (the account's key, or its `auth-addr` key when rekeyed)."
          },
          "domain": {
            "type": "string",
            "description": "The domain the wallet bound the signature to."
          },
          "authenticatorData": {
            "type": "string",
            "description": "Starts with SHA-256 of the domain."
          },
          "signature": {
            "type": "string",
            "description": "64 bytes: Ed25519 over SHA-256(data) ‖ SHA-256(authenticatorData)."
          }
        }
      },
      "PaymentFallback": {
        "type": "object",
        "description": "For an Algorand wallet that cannot sign data: a signed payment by the wallet, never broadcast.",
        "required": [
          "signedPayTxn"
        ],
        "properties": {
          "signedPayTxn": {
            "type": "string",
            "description": "The msgpack SignedTxn, base64."
          }
        }
      },
      "SignedMessage": {
        "type": "object",
        "description": "A signed SIWE or SIWS message.",
        "required": [
          "message",
          "signature"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "The message exactly as the challenge gave it."
          },
          "signature": {
            "type": "string",
            "description": "SIWE: the `personal_sign` signature, hex (`0x…`). SIWS: the Ed25519 signature, base64 or base58."
          }
        }
      },
      "SigninRequest": {
        "type": "object",
        "required": [
          "chain",
          "address",
          "nonce",
          "method",
          "response"
        ],
        "properties": {
          "chain": {
            "$ref": "#/components/schemas/Chain"
          },
          "address": {
            "type": "string"
          },
          "nonce": {
            "type": "string",
            "description": "The challenge's `nonce`."
          },
          "method": {
            "type": "string",
            "enum": [
              "arc60",
              "payment",
              "siwe",
              "siws"
            ]
          },
          "response": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Arc60SignedData"
              },
              {
                "$ref": "#/components/schemas/PaymentFallback"
              },
              {
                "$ref": "#/components/schemas/SignedMessage"
              }
            ]
          }
        }
      },
      "AccountSummary": {
        "type": "object",
        "required": [
          "id",
          "chain",
          "address",
          "holder"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The CAIP-10 account id."
          },
          "chain": {
            "$ref": "#/components/schemas/Chain"
          },
          "address": {
            "type": "string"
          },
          "holder": {
            "type": "string",
            "description": "The holder DID."
          },
          "profileDid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The profile DID (`did:algo:<network>:uuid:…`)."
          }
        }
      },
      "Session": {
        "type": "object",
        "required": [
          "token",
          "jti",
          "issuedAt",
          "expiresAt"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "The bearer token (a JWT)."
          },
          "jti": {
            "type": "string",
            "description": "The session id."
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "sub": {
            "type": "string",
            "description": "The holder DID."
          }
        }
      },
      "DidRecord": {
        "type": "object",
        "properties": {
          "did": {
            "type": "string"
          },
          "document": {
            "type": "object",
            "description": "The DID document."
          },
          "cid": {
            "type": "string",
            "description": "The CID of its pinned copy."
          },
          "version": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "CredentialRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The credential's DID."
          },
          "document": {
            "$ref": "#/components/schemas/VerifiableDocument"
          },
          "cid": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked",
              "superseded"
            ]
          }
        },
        "additionalProperties": true
      },
      "SigninResult": {
        "type": "object",
        "required": [
          "kind",
          "account",
          "session"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "subscription",
              "login"
            ]
          },
          "account": {
            "$ref": "#/components/schemas/AccountSummary"
          },
          "profile": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DidRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "credential": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CredentialRecord"
              },
              {
                "type": "null"
              }
            ],
            "description": "The SubscriptionCredential."
          },
          "session": {
            "$ref": "#/components/schemas/Session"
          },
          "legacy": {
            "type": "object",
            "description": "Algorand wallets with a legacy profile: the legacy session.",
            "properties": {
              "did": {
                "type": "string"
              },
              "jwt": {
                "type": "string"
              },
              "nonce": {
                "type": "string"
              }
            }
          }
        }
      },
      "LookupResult": {
        "type": "object",
        "required": [
          "account",
          "holder",
          "chain",
          "address",
          "exists",
          "methods"
        ],
        "properties": {
          "account": {
            "type": "string"
          },
          "holder": {
            "type": "string"
          },
          "chain": {
            "$ref": "#/components/schemas/Chain"
          },
          "address": {
            "type": "string"
          },
          "exists": {
            "type": "boolean"
          },
          "profileDid": {
            "type": [
              "string",
              "null"
            ]
          },
          "legacy": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "did": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "methods": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The sign-in methods of the chain."
          }
        }
      },
      "LogoutResult": {
        "type": "object",
        "required": [
          "ok",
          "jti"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "jti": {
            "type": "string"
          }
        }
      },
      "Jwks": {
        "type": "object",
        "required": [
          "keys"
        ],
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "kty",
                "crv",
                "x",
                "kid"
              ],
              "properties": {
                "kty": {
                  "const": "OKP"
                },
                "crv": {
                  "const": "Ed25519"
                },
                "x": {
                  "type": "string",
                  "description": "The public key, base64url."
                },
                "kid": {
                  "type": "string"
                },
                "use": {
                  "const": "sig"
                },
                "alg": {
                  "const": "EdDSA"
                }
              }
            }
          }
        }
      },
      "Me": {
        "type": "object",
        "required": [
          "account",
          "credentials",
          "presentations",
          "names",
          "media",
          "logins",
          "session"
        ],
        "properties": {
          "account": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountSummary"
              },
              {
                "type": "object",
                "properties": {
                  "createdAt": {
                    "type": "string"
                  },
                  "lastSeenAt": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "profile": {
            "oneOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DidRecord"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "registryTxid": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "credentials": {
            "type": "object",
            "properties": {
              "held": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CredentialSummary"
                },
                "description": "With each credential's `document`."
              },
              "issued": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CredentialSummary"
                }
              }
            }
          },
          "presentations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "cid": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "challenge": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "domain": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "verdict": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "verifiedAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "createdAt": {
                  "type": "string"
                }
              }
            }
          },
          "names": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "nfd",
                    "ens",
                    "sns"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "verifiedAt": {
                  "type": "string"
                }
              }
            }
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaObject"
            }
          },
          "logins": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer"
              },
              "recent": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {},
                    "method": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "subscription",
                        "login"
                      ]
                    },
                    "at": {
                      "type": "string"
                    },
                    "ip": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "session": {
            "type": "object",
            "properties": {
              "jti": {
                "type": "string"
              },
              "issuedAt": {
                "type": "string"
              },
              "expiresAt": {
                "type": "string"
              }
            }
          }
        }
      },
      "CredentialSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "issuer": {
            "type": "string",
            "description": "The issuer's DID."
          },
          "subject": {
            "type": "string",
            "description": "The subject's DID."
          },
          "cid": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked",
              "superseded"
            ]
          },
          "validFrom": {
            "type": [
              "string",
              "null"
            ]
          },
          "validUntil": {
            "type": [
              "string",
              "null"
            ]
          },
          "document": {
            "$ref": "#/components/schemas/VerifiableDocument"
          }
        }
      },
      "MediaObject": {
        "type": "object",
        "required": [
          "id",
          "role",
          "contentType",
          "bytes",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "image",
              "badge",
              "certificate",
              "attachment"
            ]
          },
          "contentType": {
            "type": "string",
            "enum": [
              "image/svg+xml",
              "image/png",
              "image/jpeg",
              "image/webp",
              "application/pdf"
            ]
          },
          "bytes": {
            "type": "integer"
          },
          "sha256": {
            "type": "string",
            "description": "Hex. Returned by the upload."
          },
          "url": {
            "type": "string",
            "description": "Where it is served.",
            "format": "uri"
          },
          "credentialId": {
            "type": [
              "string",
              "null"
            ]
          },
          "presentationId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "MediaDeleted": {
        "type": "object",
        "required": [
          "ok",
          "id"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "id": {
            "type": "string"
          }
        }
      },
      "LegacyAuth": {
        "type": "object",
        "required": [
          "walletAddress",
          "nonce"
        ],
        "properties": {
          "walletAddress": {
            "type": "string",
            "description": "An Algorand address."
          },
          "nonce": {
            "type": "string",
            "description": "The nonce the legacy token was issued for."
          }
        }
      },
      "LegacyProfile": {
        "type": "object",
        "description": "The legacy profile record merged with its lists (`auth_vcs` issued PLAUS, `vcs` claimed PLAUS, and others).",
        "additionalProperties": true
      },
      "LegacyProfileResult": {
        "type": "object",
        "required": [
          "profile"
        ],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/LegacyProfile"
          }
        }
      },
      "LegacyClosureRequest": {
        "type": "object",
        "required": [
          "walletAddress",
          "nonce",
          "plaus"
        ],
        "properties": {
          "walletAddress": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          },
          "plaus": {
            "type": "object",
            "required": [
              "plausId"
            ],
            "properties": {
              "plausId": {
                "description": "The PLAUS's application id."
              },
              "plausEmail": {
                "type": "string",
                "description": "An address to tell the issuer at."
              }
            }
          }
        }
      }
    }
  }
}